Skip to content

Commit

Permalink
chore: gofmt all source files
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertJohan committed Sep 16, 2019
1 parent b9d655e commit c34dfb7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions contact_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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"`
}

Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
20 changes: 10 additions & 10 deletions user_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c34dfb7

Please sign in to comment.