From 7cb8ffe104bd5dd4732f64d79df198291b7753a7 Mon Sep 17 00:00:00 2001 From: Geert-Johan Riemer Date: Mon, 16 Sep 2019 11:48:44 +0200 Subject: [PATCH] chore: gofmt all source files --- contact.go | 6 +++--- contact_api.go | 16 ++++++++-------- user.go | 10 +++++----- user_api.go | 20 ++++++++++---------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/contact.go b/contact.go index 2bff906..52e29bf 100644 --- a/contact.go +++ b/contact.go @@ -9,8 +9,8 @@ type ContactService struct { // ContactList holds a list of Contacts and paging information type ContactList struct { - Pages PageParams - Contacts []Contact + Pages PageParams + Contacts []Contact ScrollParam string `json:"scroll_param,omitempty"` } @@ -69,7 +69,7 @@ func (c *ContactService) List(params PageParams) (ContactList, error) { // List all Contacts for App via Scroll API func (c *ContactService) Scroll(scrollParam string) (ContactList, error) { - return c.Repository.scroll(scrollParam) + return c.Repository.scroll(scrollParam) } // ListByEmail looks up a list of Contacts by their Email. diff --git a/contact_api.go b/contact_api.go index f42384a..0be7916 100644 --- a/contact_api.go +++ b/contact_api.go @@ -49,14 +49,14 @@ func (api ContactAPI) list(params contactListParams) (ContactList, error) { } func (api ContactAPI) scroll(scrollParam string) (ContactList, error) { - contactList := ContactList{} - params := scrollParams{ ScrollParam: scrollParam } - data, err := api.httpClient.Get("/contacts/scroll", params) - if err != nil { - return contactList, err - } - err = json.Unmarshal(data, &contactList) - return contactList, err + contactList := ContactList{} + params := scrollParams{ScrollParam: scrollParam} + data, err := api.httpClient.Get("/contacts/scroll", params) + if err != nil { + return contactList, err + } + err = json.Unmarshal(data, &contactList) + return contactList, err } func (api ContactAPI) create(contact *Contact) (Contact, error) { diff --git a/user.go b/user.go index 7dcf446..ec1f76a 100644 --- a/user.go +++ b/user.go @@ -9,8 +9,8 @@ type UserService struct { // UserList holds a list of Users and paging information type UserList struct { - Pages PageParams - Users []User + Pages PageParams + Users []User ScrollParam string `json:"scroll_param,omitempty"` } @@ -81,7 +81,7 @@ type UserIdentifiers struct { // UserAvatar represents an avatar for a User. type UserAvatar struct { - Type string `json:"type,omitempty"` + Type string `json:"type,omitempty"` ImageURL string `json:"image_url,omitempty"` } @@ -92,7 +92,7 @@ type userListParams struct { } type scrollParams struct { - ScrollParam string `url:"scroll_param,omitempty"` + ScrollParam string `url:"scroll_param,omitempty"` } // FindByID looks up a User by their Intercom ID. @@ -121,7 +121,7 @@ func (u *UserService) List(params PageParams) (UserList, error) { // List all Users for App via Scroll API func (u *UserService) Scroll(scrollParam string) (UserList, error) { - return u.Repository.scroll(scrollParam) + return u.Repository.scroll(scrollParam) } // List Users by Segment. diff --git a/user_api.go b/user_api.go index 9ccba6c..236d780 100644 --- a/user_api.go +++ b/user_api.go @@ -23,7 +23,7 @@ type UserAPI struct { } type requestScroll struct { - ScrollParam string `json:"scroll_param,omitempty"` + ScrollParam string `json:"scroll_param,omitempty"` } type requestUser struct { ID string `json:"id,omitempty"` @@ -68,17 +68,17 @@ func (api UserAPI) list(params userListParams) (UserList, error) { } func (api UserAPI) scroll(scrollParam string) (UserList, error) { - userList := UserList{} + userList := UserList{} - url := "/users/scroll" - params := scrollParams{ ScrollParam: scrollParam } - data, err := api.httpClient.Get(url, params) + url := "/users/scroll" + params := scrollParams{ScrollParam: scrollParam} + data, err := api.httpClient.Get(url, params) - if err != nil { - return userList, err - } - err = json.Unmarshal(data, &userList) - return userList, err + if err != nil { + return userList, err + } + err = json.Unmarshal(data, &userList) + return userList, err } func (api UserAPI) save(user *User) (User, error) {