+// +build go1.2
+
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
"github.com/gogits/gogs/modules/base"
)
-// +build go1.2
-
// Test that go1.2 tag above is included in builds. main.go refers to this definition.
const go12tag = true
+// +build sqlite
+
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
-// +build sqlite
-
package models
import (
if isNew {
l, err = newCommit.CommitsBefore()
if err != nil {
- qlog.Fatalf("Find CommitsBefore erro:", err)
+ qlog.Fatalf("Find CommitsBefore erro: %v", err)
}
} else {
l, err = newCommit.CommitsBeforeUntil(oldCommitId)
if err != nil {
- qlog.Fatalf("Find CommitsBeforeUntil erro:", err)
+ qlog.Fatalf("Find CommitsBeforeUntil erro: %v", err)
return
}
}
default:
return fmt.Sprintf("%d years %s", diff/Year, lbl)
}
- return then.String()
}
const (
}
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)
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)
}
}
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)
}
}
import (
"encoding/json"
- "fmt"
"net/http"
"net/url"
"strings"
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"