summaryrefslogtreecommitdiffstats
path: root/modules/convert
diff options
context:
space:
mode:
Diffstat (limited to 'modules/convert')
-rw-r--r--modules/convert/notification.go6
-rw-r--r--modules/convert/pull_test.go4
-rw-r--r--modules/convert/repository.go2
-rw-r--r--modules/convert/status.go1
4 files changed, 6 insertions, 7 deletions
diff --git a/modules/convert/notification.go b/modules/convert/notification.go
index a0bd4cdc27..f304eadf69 100644
--- a/modules/convert/notification.go
+++ b/modules/convert/notification.go
@@ -22,12 +22,12 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
URL: n.APIURL(),
}
- //since user only get notifications when he has access to use minimal access mode
+ // since user only get notifications when he has access to use minimal access mode
if n.Repository != nil {
result.Repository = ToRepo(n.Repository, perm.AccessModeRead)
}
- //handle Subject
+ // handle Subject
switch n.Source {
case models.NotificationSourceIssue:
result.Subject = &api.NotificationSubject{Type: api.NotifySubjectIssue}
@@ -83,7 +83,7 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
// ToNotifications convert list of Notification to api.NotificationThread list
func ToNotifications(nl models.NotificationList) []*api.NotificationThread {
- var result = make([]*api.NotificationThread, 0, len(nl))
+ result := make([]*api.NotificationThread, 0, len(nl))
for _, n := range nl {
result = append(result, ToNotificationThread(n))
}
diff --git a/modules/convert/pull_test.go b/modules/convert/pull_test.go
index 5351b5e172..8574ccfd26 100644
--- a/modules/convert/pull_test.go
+++ b/modules/convert/pull_test.go
@@ -18,7 +18,7 @@ import (
)
func TestPullRequest_APIFormat(t *testing.T) {
- //with HeadRepo
+ // with HeadRepo
assert.NoError(t, unittest.PrepareTestDatabase())
headRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
pr := unittest.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest)
@@ -34,7 +34,7 @@ func TestPullRequest_APIFormat(t *testing.T) {
Repository: ToRepo(headRepo, perm.AccessModeRead),
}, apiPullRequest.Head)
- //withOut HeadRepo
+ // withOut HeadRepo
pr = unittest.AssertExistsAndLoadBean(t, &models.PullRequest{ID: 1}).(*models.PullRequest)
assert.NoError(t, pr.LoadIssue())
assert.NoError(t, pr.LoadAttributes())
diff --git a/modules/convert/repository.go b/modules/convert/repository.go
index 459f98f396..a356925539 100644
--- a/modules/convert/repository.go
+++ b/modules/convert/repository.go
@@ -40,7 +40,7 @@ func innerToRepo(repo *repo_model.Repository, mode perm.AccessMode, isParent boo
}
}
- //check enabled/disabled units
+ // check enabled/disabled units
hasIssues := false
var externalTracker *api.ExternalTracker
var internalTracker *api.InternalTracker
diff --git a/modules/convert/status.go b/modules/convert/status.go
index eb77c14dab..1ac2a0f3e1 100644
--- a/modules/convert/status.go
+++ b/modules/convert/status.go
@@ -33,7 +33,6 @@ func ToCommitStatus(status *models.CommitStatus) *api.CommitStatus {
// ToCombinedStatus converts List of CommitStatus to a CombinedStatus
func ToCombinedStatus(statuses []*models.CommitStatus, repo *api.Repository) *api.CombinedStatus {
-
if len(statuses) == 0 {
return nil
}