Guest User

Untitled

a guest
Nov 13th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // Go
  2. type User struct {
  3. Username string
  4. password string
  5. }
  6.  
  7. func (u User) GetPassword() string{
  8. return u.secretPassword()
  9. }
  10.  
  11. func (u User) secretPassword() string {
  12. return u.password
  13. }
  14.  
  15. func main(){
  16. user := User{"username", "password"}
  17. fmt.Println("username: " + user.Username)
  18. fmt.Println("password: " + user.GetPassword())
  19. }
Add Comment
Please, Sign In to add comment