Skip to content

Instantly share code, notes, and snippets.

@ilmiawan
Last active January 1, 2021 03:18
Show Gist options
  • Select an option

  • Save ilmiawan/f66e40cfb131d7ce17a076eb28fa967b to your computer and use it in GitHub Desktop.

Select an option

Save ilmiawan/f66e40cfb131d7ce17a076eb28fa967b to your computer and use it in GitHub Desktop.
Contoh struct
package pengguna
type User struct {
id int
name string
age int
gender string
email string
password string
}
func (u User) GetUserByID(id int) User {
return User {
id: id,
name: "",
age: 0,
gender: "",
email: "",
password: "",
}
}
func (u User) CreateUser(user User) int {
id := user.id
return id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment