Skip to content

Instantly share code, notes, and snippets.

@xvbnm48
Created March 6, 2022 15:14
Show Gist options
  • Save xvbnm48/e3f20d92d7d5e7345daf3eff2bbe4afc to your computer and use it in GitHub Desktop.
Save xvbnm48/e3f20d92d7d5e7345daf3eff2bbe4afc to your computer and use it in GitHub Desktop.
struct example in golang
package main
import "fmt"
type Student struct {
ID string
Name string
Age int
Email string
}
func main(){
student := Student{}
student.ID = "123"
student.Name = "sakura"
student.Age = 20
student.Email = "[email protected]"
fmt.Println(student)
// hasilnya adalah
// {123 sakura 20 [email protected]}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment