From a5f28a4544e51c81c793518e5231a2c2a91ebac6 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Thu, 4 May 2017 01:54:56 -0400 Subject: [PATCH] gofmt (#1662) --- models/error_oauth2.go | 4 ++-- models/login_source.go | 2 +- models/oauth2.go | 12 ++++++------ routers/api/v1/misc/version.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/models/error_oauth2.go b/models/error_oauth2.go index 94c68a2c1..a25be896c 100644 --- a/models/error_oauth2.go +++ b/models/error_oauth2.go @@ -9,8 +9,8 @@ import "fmt" // ErrOpenIDConnectInitialize represents a "OpenIDConnectInitialize" kind of error. type ErrOpenIDConnectInitialize struct { OpenIDConnectAutoDiscoveryURL string - ProviderName string - Cause error + ProviderName string + Cause error } // IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist. diff --git a/models/login_source.go b/models/login_source.go index 9c8121977..3c7bff8cb 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -685,4 +685,4 @@ func UserSignIn(username, password string) (*User, error) { } return nil, ErrUserNotExist{user.ID, user.Name, 0} -} \ No newline at end of file +} diff --git a/models/oauth2.go b/models/oauth2.go index 9de64a058..158f52b96 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -6,15 +6,16 @@ package models import ( "sort" + "code.gitea.io/gitea/modules/auth/oauth2" ) // OAuth2Provider describes the display values of a single OAuth2 provider type OAuth2Provider struct { - Name string - DisplayName string - Image string - CustomURLMapping *oauth2.CustomURLMapping + Name string + DisplayName string + Image string + CustomURLMapping *oauth2.CustomURLMapping } // OAuth2Providers contains the map of registered OAuth2 providers in Gitea (based on goth) @@ -47,7 +48,7 @@ var OAuth2Providers = map[string]OAuth2Provider{ // OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls // key is used to map the OAuth2Provider // value is the mapping as defined for the OAuth2Provider -var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping { +var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{ "github": OAuth2Providers["github"].CustomURLMapping, "gitlab": OAuth2Providers["gitlab"].CustomURLMapping, } @@ -119,4 +120,3 @@ func wrapOpenIDConnectInitializeError(err error, providerName string, oAuth2Conf } return err } - diff --git a/routers/api/v1/misc/version.go b/routers/api/v1/misc/version.go index ed4107eb3..873326a2c 100644 --- a/routers/api/v1/misc/version.go +++ b/routers/api/v1/misc/version.go @@ -23,6 +23,6 @@ func Version(ctx *context.APIContext) { // // Responses: // 200: ServerVersion - + ctx.JSON(200, &gitea.ServerVersion{Version: setting.AppVer}) }