Unknown 5 years ago
parent
commit
9d983f27d6

+ 2 - 2
gogs.go

@@ -1,3 +1,5 @@
1
+// +build go1.2
2
+
1 3
 // Copyright 2014 The Gogs Authors. All rights reserved.
2 4
 // Use of this source code is governed by a MIT-style
3 5
 // license that can be found in the LICENSE file.
@@ -14,8 +16,6 @@ import (
14 16
 	"github.com/gogits/gogs/modules/base"
15 17
 )
16 18
 
17
-// +build go1.2
18
-
19 19
 // Test that go1.2 tag above is included in builds. main.go refers to this definition.
20 20
 const go12tag = true
21 21
 

+ 2 - 2
models/models_sqlite.go

@@ -1,9 +1,9 @@
1
+// +build sqlite
2
+
1 3
 // Copyright 2014 The Gogs Authors. All rights reserved.
2 4
 // Use of this source code is governed by a MIT-style
3 5
 // license that can be found in the LICENSE file.
4 6
 
5
-// +build sqlite
6
-
7 7
 package models
8 8
 
9 9
 import (

+ 2 - 2
models/update.go

@@ -39,12 +39,12 @@ func Update(refName, oldCommitId, newCommitId, userName, repoName string, userId
39 39
 	if isNew {
40 40
 		l, err = newCommit.CommitsBefore()
41 41
 		if err != nil {
42
-			qlog.Fatalf("Find CommitsBefore erro:", err)
42
+			qlog.Fatalf("Find CommitsBefore erro: %v", err)
43 43
 		}
44 44
 	} else {
45 45
 		l, err = newCommit.CommitsBeforeUntil(oldCommitId)
46 46
 		if err != nil {
47
-			qlog.Fatalf("Find CommitsBeforeUntil erro:", err)
47
+			qlog.Fatalf("Find CommitsBeforeUntil erro: %v", err)
48 48
 			return
49 49
 		}
50 50
 	}

+ 0 - 1
modules/base/tool.go

@@ -284,7 +284,6 @@ func TimeSince(then time.Time) string {
284 284
 	default:
285 285
 		return fmt.Sprintf("%d years %s", diff/Year, lbl)
286 286
 	}
287
-	return then.String()
288 287
 }
289 288
 
290 289
 const (

+ 1 - 1
modules/mailer/mail.go

@@ -152,7 +152,7 @@ func SendIssueMentionMail(user, owner *models.User, repo *models.Repository, iss
152 152
 	}
153 153
 
154 154
 	issueLink := fmt.Sprintf("%s%s/%s/issues/%d", base.AppUrl, owner.Name, repo.Name, issue.Index)
155
-	body := fmt.Sprintf(`%s mentioned you.`)
155
+	body := fmt.Sprintf(`%s mentioned you.`, user.Name)
156 156
 	subject := fmt.Sprintf("[%s] %s", repo.Name, issue.Name)
157 157
 	content := fmt.Sprintf("%s<br>-<br> <a href=\"%s\">View it on Gogs</a>.", body, issueLink)
158 158
 	msg := NewMailMessageFrom(tos, user.Name, subject, content)

+ 2 - 2
modules/middleware/binding_test.go

@@ -121,7 +121,7 @@ func handle(test testCase, t *testing.T, index int, post BlogPost, errors Errors
121 121
 	if test.ok && errors.Count() > 0 {
122 122
 		t.Errorf("%+v should be OK (0 errors), but had errors: %+v", test, errors)
123 123
 	} else if !test.ok && errors.Count() == 0 {
124
-		t.Errorf("%+v should have errors, but was OK (0 errors): %+v", test)
124
+		t.Errorf("%+v should have errors, but was OK (0 errors)", test)
125 125
 	}
126 126
 }
127 127
 
@@ -132,7 +132,7 @@ func handleEmpty(test emptyPayloadTestCase, t *testing.T, index int, section Blo
132 132
 	if test.ok && errors.Count() > 0 {
133 133
 		t.Errorf("%+v should be OK (0 errors), but had errors: %+v", test, errors)
134 134
 	} else if !test.ok && errors.Count() == 0 {
135
-		t.Errorf("%+v should have errors, but was OK (0 errors): %+v", test)
135
+		t.Errorf("%+v should have errors, but was OK (0 errors)", test)
136 136
 	}
137 137
 }
138 138
 

+ 0 - 6
modules/oauth2/oauth2.go

@@ -9,7 +9,6 @@ package oauth2
9 9
 
10 10
 import (
11 11
 	"encoding/json"
12
-	"fmt"
13 12
 	"net/http"
14 13
 	"net/url"
15 14
 	"strings"
@@ -95,11 +94,6 @@ func (t *token) ExpiryTime() time.Time {
95 94
 	return t.Expiry
96 95
 }
97 96
 
98
-// Formats tokens into string.
99
-func (t *token) String() string {
100
-	return fmt.Sprintf("tokens: %v", t)
101
-}
102
-
103 97
 // Returns a new Google OAuth 2.0 backend endpoint.
104 98
 func Google(opts *Options) martini.Handler {
105 99
 	opts.AuthUrl = "https://accounts.google.com/o/oauth2/auth"