Skip to content

Instantly share code, notes, and snippets.

@ilhamarrouf
Created March 16, 2021 12:58
Show Gist options
  • Save ilhamarrouf/f38fee022f2f9b29a4dbd46c6d52841e to your computer and use it in GitHub Desktop.
Save ilhamarrouf/f38fee022f2f9b29a4dbd46c6d52841e to your computer and use it in GitHub Desktop.
Go lets you create your own data type using structs
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