summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-13 03:14:43 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-13 03:14:43 -0400
commit9d983f27d69b72f42eeb833cb0f38e78e3819839 (patch)
tree41fe885c7ee0a2ddfca1e3f2c8597b692167ead7 /modules
parent5c2da610a2cfd3fa9666d20739e054c3588b4d05 (diff)
downloadgitea-9d983f27d69b72f42eeb833cb0f38e78e3819839.tar.gz
gitea-9d983f27d69b72f42eeb833cb0f38e78e3819839.zip
go vet
Diffstat (limited to 'modules')
-rw-r--r--modules/base/tool.go1
-rw-r--r--modules/mailer/mail.go2
-rw-r--r--modules/middleware/binding_test.go4
-rw-r--r--modules/oauth2/oauth2.go6
4 files changed, 3 insertions, 10 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 0f06b3e0e2..082c039250 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -284,7 +284,6 @@ func TimeSince(then time.Time) string {
default:
return fmt.Sprintf("%d years %s", diff/Year, lbl)
}
- return then.String()
}
const (
diff --git a/modules/mailer/mail.go b/modules/mailer/mail.go
index d2bf1310a0..834f4a898a 100644
--- a/modules/mailer/mail.go
+++ b/modules/mailer/mail.go
@@ -152,7 +152,7 @@ func SendIssueMentionMail(user, owner *models.User, repo *models.Repository, iss
}
issueLink := fmt.Sprintf("%s%s/%s/issues/%d", base.AppUrl, owner.Name, repo.Name, issue.Index)
- body := fmt.Sprintf(`%s mentioned you.`)
+ body := fmt.Sprintf(`%s mentioned you.`, user.Name)
subject := fmt.Sprintf("[%s] %s", repo.Name, issue.Name)
content := fmt.Sprintf("%s<br>-<br> <a href=\"%s\">View it on Gogs</a>.", body, issueLink)
msg := NewMailMessageFrom(tos, user.Name, subject, content)
diff --git a/modules/middleware/binding_test.go b/modules/middleware/binding_test.go
index 654cef29f1..2a74e1a6cc 100644
--- a/modules/middleware/binding_test.go
+++ b/modules/middleware/binding_test.go
@@ -121,7 +121,7 @@ func handle(test testCase, t *testing.T, index int, post BlogPost, errors Errors
if test.ok && errors.Count() > 0 {
t.Errorf("%+v should be OK (0 errors), but had errors: %+v", test, errors)
} else if !test.ok && errors.Count() == 0 {
- t.Errorf("%+v should have errors, but was OK (0 errors): %+v", test)
+ t.Errorf("%+v should have errors, but was OK (0 errors)", test)
}
}
@@ -132,7 +132,7 @@ func handleEmpty(test emptyPayloadTestCase, t *testing.T, index int, section Blo
if test.ok && errors.Count() > 0 {
t.Errorf("%+v should be OK (0 errors), but had errors: %+v", test, errors)
} else if !test.ok && errors.Count() == 0 {
- t.Errorf("%+v should have errors, but was OK (0 errors): %+v", test)
+ t.Errorf("%+v should have errors, but was OK (0 errors)", test)
}
}
diff --git a/modules/oauth2/oauth2.go b/modules/oauth2/oauth2.go
index 05ae4606a5..dcb6d0a434 100644
--- a/modules/oauth2/oauth2.go
+++ b/modules/oauth2/oauth2.go
@@ -9,7 +9,6 @@ package oauth2
import (
"encoding/json"
- "fmt"
"net/http"
"net/url"
"strings"
@@ -95,11 +94,6 @@ func (t *token) ExpiryTime() time.Time {
return t.Expiry
}
-// Formats tokens into string.
-func (t *token) String() string {
- return fmt.Sprintf("tokens: %v", t)
-}
-
// Returns a new Google OAuth 2.0 backend endpoint.
func Google(opts *Options) martini.Handler {
opts.AuthUrl = "https://accounts.google.com/o/oauth2/auth"