Merge pull request #6952 from huydx/format-gofmt

(format) run go fmt in pkg
This commit is contained in:
Carl Bergquist 2016-12-14 09:26:38 +01:00 committed by GitHub
commit 38d8ba8faa
12 changed files with 78 additions and 79 deletions

View File

@ -56,7 +56,7 @@ func OAuthLogin(ctx *middleware.Context) {
if setting.OAuthService.OAuthInfos[name].HostedDomain == "" { if setting.OAuthService.OAuthInfos[name].HostedDomain == "" {
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline)) ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
} else { } else {
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline)); ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline))
} }
return return
} }

View File

@ -23,7 +23,6 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
) )
type DatabaseConfig struct { type DatabaseConfig struct {
Type, Host, Name, User, Pwd, Path, SslMode string Type, Host, Name, User, Pwd, Path, SslMode string
CaCertPath string CaCertPath string

View File

@ -186,7 +186,7 @@ func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error) {
Email: data.Email, Email: data.Email,
} }
if (userInfo.Email == "" && data.Attributes["email:primary"] != nil) { if userInfo.Email == "" && data.Attributes["email:primary"] != nil {
userInfo.Email = data.Attributes["email:primary"][0] userInfo.Email = data.Attributes["email:primary"][0]
} }
@ -197,11 +197,11 @@ func (s *GenericOAuth) UserInfo(client *http.Client) (*BasicUserInfo, error) {
} }
} }
if (userInfo.Login == "" && data.Username != "") { if userInfo.Login == "" && data.Username != "" {
userInfo.Login = data.Username userInfo.Login = data.Username
} }
if (userInfo.Login == "") { if userInfo.Login == "" {
userInfo.Login = data.Email userInfo.Login = data.Email
} }

View File

@ -3,9 +3,9 @@ package opentsdb
import ( import (
"testing" "testing"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/tsdb" "github.com/grafana/grafana/pkg/tsdb"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
"github.com/grafana/grafana/pkg/components/simplejson"
) )
func TestOpenTsdbExecutor(t *testing.T) { func TestOpenTsdbExecutor(t *testing.T) {