Skip to content

Commit

Permalink
updated the example using getters and setters
Browse files Browse the repository at this point in the history
  • Loading branch information
heycatch committed Jun 2, 2024
1 parent cb6e70f commit 996c536
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions examples/getter_setter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@ func main() {
fmt.Println(err)
return
}
brief, err := fast.UserBriefInfo()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(brief.Id, brief.Nickname)

// Getting an id.
fmt.Println(fast.Id)
// Additional option for receiving id.
fmt.Println(fast.GetFastId())
fmt.Println(fast.Id) // fmt.Println(fast.GetFastId())
// Quick id change.
new_id := c.SetFastId(1337)
fmt.Println(new_id.Id)
new_fast := c.SetFastId(1) // fmt.Println(new_fast.Id)
new_brief, err := new_fast.UserBriefInfo()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(new_brief.Id, new_brief.Nickname)

// Getting configuration.
fmt.Println(c.GetConfiguration())
Expand Down

0 comments on commit 996c536

Please sign in to comment.