-
Notifications
You must be signed in to change notification settings - Fork 4
Reading Resources
Andrew Waters edited this page Mar 29, 2019
·
2 revisions
// create an implicit client
client := gomo.NewClient(
gomo.NewImplicitCredentials(
os.Getenv("CLIENT_ID"),
),
)
// handle authentication error
if err := client.Authenticate(); err != nil {
log.Fatal(err)
}
products := []YourProductStruct{}
wrapper, err := client.Get("products", &products)
// handle client request error
if err != nil {
log.Fatal(err)
}
log.Println("Status Code:", wrapper.StatusCode)
log.Println("Resource Count:", len(products))