最終更新日: 2026-07-25
TOP(About this memo)) > 一覧(Go) > 宣言
https://go.dev/ref/spec#Assignability
https://go-tour-jp.appspot.com/basics/12
var i int
var f float64
var b bool
var s string
a := 1
a := 2 //再宣言としてエラーになる。
a := 1
a,b := 2,3
const (
zero = iota // 0
one/* = iota // 1 (省略可)*/
two/* = iota // 2 (省略可)*/
three/* = iota //3 (省略可)*/
)
type HttpRequestType int
const (
_ HttpRequestType = iota
HttpTypeGet
HttpTypePost
)
func HttpDo(url string, requestType HttpRequestType, token string, body string) (string, error) {
...
}