Repository: kubernetes-sigs/krew
Pull request #243 (2019-07-03 07:23:49)

Ensure that go modules are enabled in all helper scripts
Before, these scripts failed on my system when run individually.

k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/krew/pull/243#" title="Author self-approved">corneliusweig</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkrew).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/krew/blob/master/OWNERS)~~ [corneliusweig]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
codecov-io: # [Codecov](https://codecov.io/gh/kubernetes-sigs/krew/pull/243?src=pr&el=h1) Report
> Merging [#243](https://codecov.io/gh/kubernetes-sigs/krew/pull/243?src=pr&el=desc) into [master](https://codecov.io/gh/kubernetes-sigs/krew/commit/d043a2eabfab99e285c95ba8c5f102d2c62a1062?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/kubernetes-sigs/krew/pull/243/graphs/tree.svg?width=650&token=J3nFtARI2m&height=150&src=pr)](https://codecov.io/gh/kubernetes-sigs/krew/pull/243?src=pr&el=tree)

```diff
@@          Coverage Diff           @@
##           master    #243   +/-   ##
======================================
  Coverage    53.6%   53.6%           
======================================
  Files          16      16           
  Lines         735     735           
======================================
  Hits          394     394           
  Misses        289     289           
  Partials       52      52
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/kubernetes-sigs/krew/pull/243?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/kubernetes-sigs/krew/pull/243?src=pr&el=footer). Last update [d043a2e...0132aef](https://codecov.io/gh/kubernetes-sigs/krew/pull/243?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

ahmetb: /lgtm
/approve
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/krew/pull/243#issuecomment-508868329" title="Approved">ahmetb</a>*, *<a href="https://github.com/kubernetes-sigs/krew/pull/243#" title="Author self-approved">corneliusweig</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fkrew).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/krew/blob/master/OWNERS)~~ [ahmetb,corneliusweig]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/go.mod b/go.mod
index 8257b85..284c1c3 100644
--- a/go.mod
+++ b/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
diff --git a/go.sum b/go.sum
index f7bdabe..c9ea4d6 100644
--- a/go.sum
+++ b/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=
diff --git a/hack/run-lint.sh b/hack/run-lint.sh
index 6ad52a0..983fe20 100755
--- a/hack/run-lint.sh
+++ b/hack/run-lint.sh
@@ -16,6 +16,8 @@
 
 set -euo pipefail
 
+[[ -n "${DEBUG:-}" ]] && set -x
+
 if ! [[ -x "$GOPATH/bin/golangci-lint" ]]
 then
    echo 'Installing golangci-lint'
@@ -23,4 +25,4 @@ then
 fi
 
 # configured by .golangci.yml
-"$GOPATH/bin/golangci-lint" run
+GO111MODULE=on "$GOPATH/bin/golangci-lint" run


Test patch:
diff --git a/hack/run-integration-tests.sh b/hack/run-integration-tests.sh
index ea27b31..02f0d6f 100755
--- a/hack/run-integration-tests.sh
+++ b/hack/run-integration-tests.sh
@@ -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
diff --git a/hack/run-tests.sh b/hack/run-tests.sh
index 3c06f53..5177602 100755
--- a/hack/run-tests.sh
+++ b/hack/run-tests.sh
@@ -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