Skip to content

Commit 04b23f0

Browse files
Apply suggestions from code review
Co-authored-by: Arve Knudsen <[email protected]>
1 parent f5f15d9 commit 04b23f0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

team.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (c *Client) Team(id int64) (*Team, error) {
7979
// AddTeam makes a new team
8080
// email arg is an optional value.
8181
// If you don't want to set email, please set "" (empty string).
82-
// When team creation is successful, returns the team id
82+
// When team creation is successful, returns the team ID.
8383
func (c *Client) AddTeam(name string, email string) (int64, error) {
8484
id := int64(0)
8585
path := fmt.Sprintf("/api/teams")
@@ -94,16 +94,15 @@ func (c *Client) AddTeam(name string, email string) (int64, error) {
9494
}
9595

9696
tmp := struct {
97-
Id int64 `json:"teamId"`
97+
ID int64 `json:"teamId"`
9898
}{}
9999

100100
err = c.request("POST", path, nil, bytes.NewBuffer(data), &tmp)
101-
102101
if err != nil {
103102
return id, err
104103
}
105104

106-
return tmp.Id, err
105+
return tmp.ID, err
107106
}
108107

109108
// UpdateTeam updates a Grafana team.

teams_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func TestAddTeam(t *testing.T) {
163163
t.Error(err)
164164
}
165165
if id == 0 {
166-
t.Error("AddTeam returned an invalid id.")
166+
t.Error("AddTeam returned an invalid ID")
167167
}
168168
}
169169

0 commit comments

Comments
 (0)