Skip to content

Commit 1e87762

Browse files
committed
Remove unneccessary newlines
1 parent 205fc66 commit 1e87762

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

contact/contact.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ func Create(c *messagebird.Client, contactRequest *Request) (*Contact, error) {
7474
}
7575

7676
contact := &Contact{}
77-
7877
if err := c.Request(contact, http.MethodPost, path, contactRequest); err != nil {
7978
return nil, err
8079
}
@@ -109,10 +108,11 @@ func List(c *messagebird.Client, options *ListOptions) (*ContactList, error) {
109108
}
110109

111110
contactList := &ContactList{}
111+
if err = c.Request(contactList, http.MethodGet, path+"?"+query, nil); err != nil {
112+
return nil, err
113+
}
112114

113-
err = c.Request(contactList, http.MethodGet, path+"?"+query, nil)
114-
115-
return contactList, err
115+
return contactList, nil
116116
}
117117

118118
func listQuery(options *ListOptions) (string, error) {
@@ -135,7 +135,6 @@ func listQuery(options *ListOptions) (string, error) {
135135
// Read retrieves the information of an existing contact.
136136
func Read(c *messagebird.Client, id string) (*Contact, error) {
137137
contact := &Contact{}
138-
139138
if err := c.Request(contact, http.MethodGet, path+"/"+id, nil); err != nil {
140139
return nil, err
141140
}
@@ -147,7 +146,6 @@ func Read(c *messagebird.Client, id string) (*Contact, error) {
147146
// Do not set any values that should not be updated.
148147
func Update(c *messagebird.Client, id string, contactRequest *Request) (*Contact, error) {
149148
contact := &Contact{}
150-
151149
if err := c.Request(contact, http.MethodPatch, path+"/"+id, contactRequest); err != nil {
152150
return nil, err
153151
}

0 commit comments

Comments
 (0)