Created
November 24, 2019 03:07
-
-
Save moomdate/ad9661f3aa9c6c68578c8aaca561ba65 to your computer and use it in GitHub Desktop.
without pointer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| type Student struct { | |
| id string | |
| name string | |
| age int | |
| } | |
| func main() { | |
| student1 := make(map[string]Student) | |
| student1["0"] = Student{ | |
| id: "B99999", | |
| name: "Surasak ABC", | |
| age: 18, | |
| } | |
| fmt.Printf("%v\r\n", student1) | |
| fmt.Println("name:", student1["0"].name) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment