@@ -152,23 +152,23 @@ func validateUpdate(request *Request) error {
152
152
}
153
153
154
154
// AddContacts adds a maximum of 50 contacts to the group.
155
- func AddContacts (c * messagebird.Client , groupID string , contactIDS []string ) error {
156
- if err := validateAddContacts (contactIDS ); err != nil {
155
+ func AddContacts (c * messagebird.Client , groupID string , contactIDs []string ) error {
156
+ if err := validateAddContacts (contactIDs ); err != nil {
157
157
return err
158
158
}
159
159
160
- query := addContactsQuery (contactIDS )
160
+ query := addContactsQuery (contactIDs )
161
161
formattedPath := fmt .Sprintf ("%s/%s/%s?%s" , path , groupID , contactPath , query )
162
162
163
163
return c .Request (nil , http .MethodGet , formattedPath , nil )
164
164
}
165
165
166
- func validateAddContacts (contactIDS []string ) error {
167
- count := len (contactIDS )
166
+ func validateAddContacts (contactIDs []string ) error {
167
+ count := len (contactIDs )
168
168
169
169
// len(nil) == 0: https://golang.org/ref/spec#Length_and_capacity
170
170
if count == 0 {
171
- return fmt .Errorf ("contactIDS is required" )
171
+ return fmt .Errorf ("contactIDs is required" )
172
172
}
173
173
174
174
if count > 50 {
@@ -183,12 +183,12 @@ func validateAddContacts(contactIDS []string) error {
183
183
// as GET params. Sending these in the request body would require a painful
184
184
// workaround, as client.Request sends request bodies as JSON by default. See
185
185
// also: https://developers.messagebird.com/docs/alternatives.
186
- func addContactsQuery (contactIDS []string ) string {
186
+ func addContactsQuery (contactIDs []string ) string {
187
187
// Slice's length is one bigger than len(IDs) for the _method param.
188
- params := make ([]string , 0 , len (contactIDS )+ 1 )
188
+ params := make ([]string , 0 , len (contactIDs )+ 1 )
189
189
params = append (params , "_method=" + http .MethodPut )
190
190
191
- for _ , contactID := range contactIDS {
191
+ for _ , contactID := range contactIDs {
192
192
params = append (params , "ids[]=" + contactID )
193
193
}
194
194
0 commit comments