diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_test.go | 8 | ||||
-rw-r--r-- | models/migrations/v23.go | 7 | ||||
-rw-r--r-- | models/org_team.go | 2 | ||||
-rw-r--r-- | models/user_follow.go | 1 | ||||
-rw-r--r-- | models/user_openid.go | 9 | ||||
-rw-r--r-- | models/user_openid_test.go | 8 |
6 files changed, 17 insertions, 18 deletions
diff --git a/models/issue_test.go b/models/issue_test.go index 52724d07d4..71ce92ea7e 100644 --- a/models/issue_test.go +++ b/models/issue_test.go @@ -67,8 +67,10 @@ func TestGetParticipantsByIssueID(t *testing.T) { checkPartecipants := func(issueID int64, userIDs []int) { partecipants, err := GetParticipantsByIssueID(issueID) if assert.NoError(t, err) { - partecipantsIDs := make([]int,len(partecipants)) - for i,u := range partecipants { partecipantsIDs[i] = int(u.ID) } + partecipantsIDs := make([]int, len(partecipants)) + for i, u := range partecipants { + partecipantsIDs[i] = int(u.ID) + } sort.Ints(partecipantsIDs) sort.Ints(userIDs) assert.Equal(t, userIDs, partecipantsIDs) @@ -79,6 +81,6 @@ func TestGetParticipantsByIssueID(t *testing.T) { // User 1 is issue1 poster (see fixtures/issue.yml) // User 2 only labeled issue1 (see fixtures/comment.yml) // Users 3 and 5 made actual comments (see fixtures/comment.yml) - checkPartecipants(1, []int{3,5}) + checkPartecipants(1, []int{3, 5}) } diff --git a/models/migrations/v23.go b/models/migrations/v23.go index efde684104..4aadf7ef0d 100644 --- a/models/migrations/v23.go +++ b/models/migrations/v23.go @@ -12,12 +12,11 @@ import ( // UserOpenID is the list of all OpenID identities of a user. type UserOpenID struct { - ID int64 `xorm:"pk autoincr"` - UID int64 `xorm:"INDEX NOT NULL"` - URI string `xorm:"UNIQUE NOT NULL"` + ID int64 `xorm:"pk autoincr"` + UID int64 `xorm:"INDEX NOT NULL"` + URI string `xorm:"UNIQUE NOT NULL"` } - func addUserOpenID(x *xorm.Engine) error { if err := x.Sync2(new(UserOpenID)); err != nil { return fmt.Errorf("Sync2: %v", err) diff --git a/models/org_team.go b/models/org_team.go index db25e61547..115e13feab 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -143,7 +143,7 @@ func (t *Team) removeRepository(e Engine, repo *Repository, recalculate bool) (e if err != nil { return fmt.Errorf("getTeamUsersByTeamID: %v", err) } - for _, teamUser:= range teamUsers { + for _, teamUser := range teamUsers { has, err := hasAccess(e, teamUser.UID, repo, AccessModeRead) if err != nil { return err diff --git a/models/user_follow.go b/models/user_follow.go index ac0cf0a8f3..2d64d05473 100644 --- a/models/user_follow.go +++ b/models/user_follow.go @@ -68,4 +68,3 @@ func UnfollowUser(userID, followID int64) (err error) { } return sess.Commit() } - diff --git a/models/user_openid.go b/models/user_openid.go index 18e847d89d..db84e2e08f 100644 --- a/models/user_openid.go +++ b/models/user_openid.go @@ -18,10 +18,10 @@ var ( // UserOpenID is the list of all OpenID identities of a user. type UserOpenID struct { - ID int64 `xorm:"pk autoincr"` - UID int64 `xorm:"INDEX NOT NULL"` - URI string `xorm:"UNIQUE NOT NULL"` - Show bool `xorm:"DEFAULT false"` + ID int64 `xorm:"pk autoincr"` + UID int64 `xorm:"INDEX NOT NULL"` + URI string `xorm:"UNIQUE NOT NULL"` + Show bool `xorm:"DEFAULT false"` } // GetUserOpenIDs returns all openid addresses that belongs to given user. @@ -122,4 +122,3 @@ func GetUserByOpenID(uri string) (*User, error) { return nil, ErrUserNotExist{0, uri, 0} } - diff --git a/models/user_openid_test.go b/models/user_openid_test.go index 74e3cf6f00..e4734cc428 100644 --- a/models/user_openid_test.go +++ b/models/user_openid_test.go @@ -52,14 +52,14 @@ func TestGetUserByOpenID(t *testing.T) { func TestToggleUserOpenIDVisibility(t *testing.T) { assert.NoError(t, PrepareTestDatabase()) oids, err := GetUserOpenIDs(int64(2)) - if ! assert.NoError(t, err) { + if !assert.NoError(t, err) { return } assert.Len(t, oids, 1) assert.True(t, oids[0].Show) err = ToggleUserOpenIDVisibility(oids[0].ID) - if ! assert.NoError(t, err) { + if !assert.NoError(t, err) { return } @@ -69,12 +69,12 @@ func TestToggleUserOpenIDVisibility(t *testing.T) { assert.False(t, oids[0].Show) } err = ToggleUserOpenIDVisibility(oids[0].ID) - if ! assert.NoError(t, err) { + if !assert.NoError(t, err) { return } oids, err = GetUserOpenIDs(int64(2)) - if ! assert.NoError(t, err) { + if !assert.NoError(t, err) { return } assert.Len(t, oids, 1) |