Skip to content

Instantly share code, notes, and snippets.

@Barbery
Created October 13, 2014 13:58
Show Gist options
  • Save Barbery/173f4f3dcdfbfcc366d4 to your computer and use it in GitHub Desktop.
Save Barbery/173f4f3dcdfbfcc366d4 to your computer and use it in GitHub Desktop.
package user
type User struct {
id int
name string
age int
}
func New() *User {
user = new(User)
return user
}
func (this *user) GetUserInfo() {
this.id = 123
this.name = "xxx"
this.age = 25
}
func (this *user)GetUserId() int {
return this.id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment