Created
March 16, 2021 12:58
-
-
Save ilhamarrouf/f38fee022f2f9b29a4dbd46c6d52841e to your computer and use it in GitHub Desktop.
Go lets you create your own data type using structs
This file contains 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
type User struct { | |
name string | |
age int | |
} | |
tole := User { | |
name: "Scott", | |
age: 23, | |
} | |
fmt.Println("Name", tole.name) | |
fmt.Println("Age", tole.age) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment