Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 58af7d8

Browse files
committed
#21 code cleanup
1 parent 3a3b837 commit 58af7d8

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

gogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func Version() string {
17-
return "0.10.1"
17+
return "0.10.2"
1818
}
1919

2020
// Client represents a Gogs API client.

org_members.go renamed to org_member.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015 The Gogs Authors. All rights reserved.
1+
// Copyright 2016 The Gogs Authors. All rights reserved.
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

@@ -12,15 +12,14 @@ import (
1212
)
1313

1414
type AddOrgMembershipOption struct {
15-
Role string `json:"role"`
15+
Role string `json:"role"`
1616
}
1717

18-
func (c *Client) AddOrgMembership(orgname string, username string, opt AddOrgMembershipOption) error {
18+
func (c *Client) AddOrgMembership(org, user string, opt AddOrgMembershipOption) error {
1919
body, err := json.Marshal(&opt)
2020
if err != nil {
2121
return err
2222
}
23-
_, err = c.getResponse("PUT", fmt.Sprintf("/orgs/%s/membership/%s", orgname, username),
24-
http.Header{"content-type": []string{"application/json"}}, bytes.NewReader(body))
23+
_, err = c.getResponse("PUT", fmt.Sprintf("/orgs/%s/membership/%s", org, user), jsonHeader, bytes.NewReader(body))
2524
return err
2625
}

0 commit comments

Comments
 (0)