From abffb0d065e5da201b31082aedeed0df3944a9b8 Mon Sep 17 00:00:00 2001 From: "Deomid \"rojer\" Ryabkov" Date: Sun, 25 Aug 2019 12:25:47 +0100 Subject: [PATCH] gofmt everything --- auth_server/authn/bindata.go | 11 ++++++----- auth_server/authn/ldap_auth.go | 2 +- auth_server/server/server.go | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/auth_server/authn/bindata.go b/auth_server/authn/bindata.go index a37fc695..f55774ba 100644 --- a/auth_server/authn/bindata.go +++ b/auth_server/authn/bindata.go @@ -15,6 +15,7 @@ import ( "strings" "time" ) + type asset struct { bytes []byte info os.FileInfo @@ -365,9 +366,9 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "data/github_auth.tmpl": dataGithub_authTmpl, + "data/github_auth.tmpl": dataGithub_authTmpl, "data/github_auth_result.tmpl": dataGithub_auth_resultTmpl, - "data/google_auth.tmpl": dataGoogle_authTmpl, + "data/google_auth.tmpl": dataGoogle_authTmpl, } // AssetDir returns the file names below a certain @@ -409,11 +410,12 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ "data": &bintree{nil, map[string]*bintree{ - "github_auth.tmpl": &bintree{dataGithub_authTmpl, map[string]*bintree{}}, + "github_auth.tmpl": &bintree{dataGithub_authTmpl, map[string]*bintree{}}, "github_auth_result.tmpl": &bintree{dataGithub_auth_resultTmpl, map[string]*bintree{}}, - "google_auth.tmpl": &bintree{dataGoogle_authTmpl, map[string]*bintree{}}, + "google_auth.tmpl": &bintree{dataGoogle_authTmpl, map[string]*bintree{}}, }}, }} @@ -463,4 +465,3 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } - diff --git a/auth_server/authn/ldap_auth.go b/auth_server/authn/ldap_auth.go index 1135dad3..fe1f7a47 100644 --- a/auth_server/authn/ldap_auth.go +++ b/auth_server/authn/ldap_auth.go @@ -23,8 +23,8 @@ import ( "io/ioutil" "strings" - "github.com/go-ldap/ldap" "github.com/cesanta/glog" + "github.com/go-ldap/ldap" ) type LabelMap struct { diff --git a/auth_server/server/server.go b/auth_server/server/server.go index c0fd22d3..9c33354c 100644 --- a/auth_server/server/server.go +++ b/auth_server/server/server.go @@ -365,16 +365,16 @@ func (as *AuthServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) { // https://developers.google.com/identity/sign-in/web/server-side-flow func (as *AuthServer) doIndex(rw http.ResponseWriter, req *http.Request) { switch { - case as.ga != nil: - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - fmt.Fprintf(rw, "

%s

\n", as.config.Token.Issuer) - fmt.Fprint(rw, `

Login with Google account

`) - case as.gha != nil: - url := as.config.Server.PathPrefix + "/github_auth" - http.Redirect(rw, req, url, 301) - default: - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - fmt.Fprintf(rw, "

%s

\n", as.config.Token.Issuer) + case as.ga != nil: + rw.Header().Set("Content-Type", "text/html; charset=utf-8") + fmt.Fprintf(rw, "

%s

\n", as.config.Token.Issuer) + fmt.Fprint(rw, `

Login with Google account

`) + case as.gha != nil: + url := as.config.Server.PathPrefix + "/github_auth" + http.Redirect(rw, req, url, 301) + default: + rw.Header().Set("Content-Type", "text/html; charset=utf-8") + fmt.Fprintf(rw, "

%s

\n", as.config.Token.Issuer) } }