Last active
January 1, 2021 03:18
-
-
Save ilmiawan/f66e40cfb131d7ce17a076eb28fa967b to your computer and use it in GitHub Desktop.
Contoh struct
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 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