If you only need the map conditionally, you need to declare it and then conditionally make it.
``` var m map[string]int if needMap { m = make(map[string]int) } ``` On Mon, 2017-10-16 at 21:52 -0700, Alex Dvoretskiy wrote: > Hello, Golang Nuts! > > I have an interesting question about maps. What is the possible usage > of > nil maps, which can be declared like "var m map[string]int"? You > can't > write to nil map but have an option to create it. > > Perhaps there is no use at all and this is just language specific > feature? > > Thank you. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.