Skip to content

Instantly share code, notes, and snippets.

@tokubass
Created October 18, 2018 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tokubass/547efe156e232e70cb18bbb4476ba9e6 to your computer and use it in GitHub Desktop.
Save tokubass/547efe156e232e70cb18bbb4476ba9e6 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
type Hoge struct {
Id int
}
func main() {
l := make([]map[int]Hoge, 1)
l[0] = map[int]Hoge{
1: Hoge{Id: 200},
}
fmt.Println(l)
l2 := map[int64]Hoge{}
l2[0] = Hoge{Id: 100}
l2[1] = Hoge{Id: 100}
fmt.Println(l2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment