2021-09-12から1日間の記事一覧
Goでmapの値を更新したい場合 次のようにmapへ直接更新することはできない type Sample struct { state bool } var samples = map[string]Sample{ "hoge": {true}, "fuga": {false}, } fmt.Println(samples["hoge"].state) // getはできる samples["hoge"].s…
Goでmapの値を更新したい場合 次のようにmapへ直接更新することはできない type Sample struct { state bool } var samples = map[string]Sample{ "hoge": {true}, "fuga": {false}, } fmt.Println(samples["hoge"].state) // getはできる samples["hoge"].s…