Run "make fmt" with go-1.6 (#1333)
This commit is contained in:
parent
888dee3b5f
commit
f73e734411
15 changed files with 62 additions and 67 deletions
|
@ -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})
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -68,4 +68,3 @@ func UnfollowUser(userID, followID int64) (err error) {
|
|||
}
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
|
|
|
@ -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}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue