From 6b5d342dd11ecbd7556736f12851048a9c62c1ea Mon Sep 17 00:00:00 2001 From: Michael Tibben <michael.tibben@99designs.com> Date: Fri, 31 Aug 2018 10:35:42 +1000 Subject: [PATCH 1/2] go fmt --- vault/config.go | 4 ++-- vault/provider.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vault/config.go b/vault/config.go index 7eeb7af46..9d3a86334 100644 --- a/vault/config.go +++ b/vault/config.go @@ -39,7 +39,7 @@ func ConfigPath() (string, error) { } // CreateConfig will create the config directory and file if they do not exist -func CreateConfig() (error) { +func CreateConfig() error { file, err := ConfigPath() if err != nil { return err @@ -57,7 +57,7 @@ func CreateConfig() (error) { } newFile.Close() log.Printf("Config file %s created", file) - } + } return nil } diff --git a/vault/provider.go b/vault/provider.go index cd16231be..f604e89ad 100644 --- a/vault/provider.go +++ b/vault/provider.go @@ -323,8 +323,8 @@ func (p *VaultProvider) assumeRole(creds credentials.Value, profile Profile) (st } if profile.ExternalID != "" { - input.ExternalId = aws.String(profile.ExternalID) - } + input.ExternalId = aws.String(profile.ExternalID) + } // if we don't have a session, we need to include MFA token in the AssumeRole call if profile.MFASerial != "" { From 8b777d93c2c7324d6cff8f79381e36fef30ff7b1 Mon Sep 17 00:00:00 2001 From: Michael Tibben <michael.tibben@99designs.com> Date: Fri, 31 Aug 2018 10:27:04 +1000 Subject: [PATCH 2/2] Update travis config --- .travis.yml | 18 +++++++++--------- Makefile | 20 +++++++------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9385dc5e7..024285443 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,18 @@ language: go -go_import_path: github.com/99designs/aws-vault - -install: - - go get -u github.com/kardianos/govendor - - govendor status go: - - "1.8.x" - - "1.9.x" - "1.10.x" - - "master" + - "1.11.x" os: - linux - osx -osx_image: xcode7.3 +before_install: + - go get -u github.com/kardianos/govendor + +script: + - govendor status + - diff -u <(echo -n) <(gofmt -d $(git ls-files '*.go' | grep -v ^vendor/)) + - go vet + - go test -race ./... diff --git a/Makefile b/Makefile index 82c73e42b..fb4fb9d90 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,9 @@ -BIN=aws-vault -OS=$(shell uname -s) -ARCH=$(shell uname -m) -GOVERSION=$(shell go version) -GOBIN=$(shell go env GOBIN) VERSION=$(shell git describe --tags --candidates=1 --dirty) FLAGS=-X main.Version=$(VERSION) -s -w CERT="Developer ID Application: 99designs Inc (NRM9HVJ62Z)" SRC=$(shell find . -name '*.go') -test: - go test -v $(shell go list ./... | grep -v /vendor/) +.PHONY: build install sign release clean build: go build -o aws-vault -ldflags="$(FLAGS)" . @@ -20,17 +14,17 @@ install: sign: codesign -s $(CERT) ./aws-vault -$(BIN)-linux-amd64: $(SRC) +aws-vault-linux-amd64: $(SRC) GOOS=linux GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" . -$(BIN)-darwin-amd64: $(SRC) +aws-vault-darwin-amd64: $(SRC) GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" . + codesign -s $(CERT) $@ -$(BIN)-windows-386.exe: $(SRC) +aws-vault-windows-386.exe: $(SRC) GOOS=windows GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" . -release: $(BIN)-linux-amd64 $(BIN)-darwin-amd64 $(BIN)-windows-386.exe - codesign -s $(CERT) $(BIN)-darwin-amd64 +release: aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe clean: - rm -f $(BIN)-*-* + rm -f aws-vault aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe