Go言語の勉強メモ
:=
ってなんや?ってやつ。
var
がいらない && 暗黙の型定義するときに使うらしい
下はすべて同じ意味
var msg1 string = "Hello World"
var msg2 = "Hello World"
msg3 := "Hello World"
var msg4 := "Hello World" // syntax error
msg5 string = "Hello World" // syntax error
msg6 = "Hello World" // syntax error
refers
https://qiita.com/HiromuMasuda0228/items/65b9a593275f769f6b69
https://qiita.com/tfrcm/items/e2a3d7ce7ab8868e37f7
あと文字列内で変数展開ができないという衝撃
https://qiita.com/KEINOS/items/baef1be88f15515026ec
なんかちょっと、VBAを思い出す感じだった