Merge pull request #361 from jehiah/gofmt_361
travis: run gofmt and go vet
This commit is contained in:
commit
bb9b607440
@ -3,11 +3,11 @@ package providers
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/bitly/go-simplejson"
|
||||||
"github.com/bitly/oauth2_proxy/api"
|
"github.com/bitly/oauth2_proxy/api"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"github.com/bitly/go-simplejson"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AzureProvider struct {
|
type AzureProvider struct {
|
||||||
@ -74,14 +74,14 @@ func getEmailFromJSON(json *simplejson.Json) (string, error) {
|
|||||||
|
|
||||||
if err != nil || email == "" {
|
if err != nil || email == "" {
|
||||||
otherMails, otherMailsErr := json.Get("otherMails").Array()
|
otherMails, otherMailsErr := json.Get("otherMails").Array()
|
||||||
if len(otherMails) > 0{
|
if len(otherMails) > 0 {
|
||||||
email = otherMails[0].(string)
|
email = otherMails[0].(string)
|
||||||
}
|
}
|
||||||
err = otherMailsErr
|
err = otherMailsErr
|
||||||
}
|
}
|
||||||
|
|
||||||
return email, err
|
return email, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AzureProvider) GetEmailAddress(s *SessionState) (string, error) {
|
func (p *AzureProvider) GetEmailAddress(s *SessionState) (string, error) {
|
||||||
var email string
|
var email string
|
||||||
|
6
test.sh
6
test.sh
@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
echo "gofmt"
|
||||||
|
diff -u <(echo -n) <(gofmt -d $(find . -type f -name '*.go' -not -path "./.godeps/*"))
|
||||||
|
echo "go vet"
|
||||||
|
go vet ./...
|
||||||
|
echo "go test"
|
||||||
go test -timeout 60s ./...
|
go test -timeout 60s ./...
|
||||||
|
echo "go test -race"
|
||||||
GOMAXPROCS=4 go test -timeout 60s -race ./...
|
GOMAXPROCS=4 go test -timeout 60s -race ./...
|
||||||
|
Loading…
Reference in New Issue
Block a user