Re: [go-nuts] In-Method declaration of array of struct literals vs global var?

2019-06-06 Thread 'Aaron Spangler' via golang-nuts
Thank you! You are correct. That was exactly my problem. Adding the equals sign (=) solved it. I guess I need to be more aware that sometimes an equals statement is required on a 'var' line and other times it is not. (perhaps only when it has a literal) Thanks again! On Thu, Jun 6, 2019 at 1

Re: [go-nuts] In-Method declaration of array of struct literals vs global var?

2019-06-07 Thread 'Aaron Spangler' via golang-nuts
site literal expression. It could also be written as > > var bar []struct{a, b, c string} = []struct{a, b, c string} { > { "really", "long", "row"}, > { "many", "many", "rows"}, > ... > } > > On Thu, Jun 6, 2019 at 2

[go-nuts] Is there a better way to write this?

2022-09-13 Thread 'Aaron Spangler' via golang-nuts
I seem to be regularly working with maps of stringsets and I have found myself writing the same pattern over and over and I ended up having my own utility function. More importantly the syntax seems clunky when a key doesn't exist in the map. Is there a better way (go idiomatically way) to write