Skip to content
Permalink
Browse files

Ensure that go modules are enabled in all helper scripts (#243)

* Ensure that go modules are enabled in all helper scripts

This ensures that they can be run individually.

* Add missing go-cmp dependency to go.{mod,sum}

* Limit scope when enabling go modules
  • Loading branch information...
corneliusweig authored and k8s-ci-robot committed Jul 5, 2019
1 parent d043a2e commit 3951c0556aa77d1193b1ea818cf5e0bad5aab00f
Showing with 8 additions and 3 deletions.
  1. +1 −0 go.mod
  2. +2 −0 go.sum
  3. +1 −1 hack/run-integration-tests.sh
  4. +3 −1 hack/run-lint.sh
  5. +1 −1 hack/run-tests.sh
1 go.mod
@@ -7,6 +7,7 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/gogo/protobuf v1.0.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.6 // indirect
2 go.sum
@@ -7,6 +7,8 @@ github.com/gogo/protobuf v1.0.0 h1:2jyBKDKU/8v3v2xVR2PtiWQviFUyiaGk2rpfyFT8rTM=
github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
@@ -47,4 +47,4 @@ fi
KREW_BINARY="${krew_binary_realpath}"
export KREW_BINARY

go test -test.v sigs.k8s.io/krew/integration_test
GO111MODULE=on go test -test.v sigs.k8s.io/krew/integration_test
@@ -16,11 +16,13 @@

set -euo pipefail

[[ -n "${DEBUG:-}" ]] && set -x

if ! [[ -x "$GOPATH/bin/golangci-lint" ]]
then
echo 'Installing golangci-lint'
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$GOPATH/bin" v1.16.0
fi

# configured by .golangci.yml
"$GOPATH/bin/golangci-lint" run
GO111MODULE=on "$GOPATH/bin/golangci-lint" run
@@ -44,7 +44,7 @@ print_with_color "$color_blue" 'Running gofmt'
"$SCRIPTDIR"/verify-gofmt.sh

print_with_color "$color_blue" 'Running tests'
go test -v -short -race sigs.k8s.io/krew/...
GO111MODULE=on go test -v -short -race sigs.k8s.io/krew/...

print_with_color "$color_blue" 'Running linter'
"$SCRIPTDIR"/run-lint.sh

0 comments on commit 3951c05

Please sign in to comment.
You can’t perform that action at this time.