Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Commit f4e2587

Browse files
committed
Support Go modules
This is mostly just adding `go.mod` and `go.sum`. But the generate scripts don't entirely work well with modules: - `rm -rf $TEMPDIR` won't work, because `${GOPATH}/pkg/mod` directories are chmod o-w (this can be worked around by calling chmod). - The various `go` commands put other packages in 'go.mod', which we don't want. Instead of trying to adjust all of the scripts, just set GO111MODULE=off in the Makefile when calling them.
1 parent 6fa0160 commit f4e2587

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ test-examples:
1313

1414
.PHONY: generate
1515
generate: _output/kubernetes _output/bin/protoc _output/bin/gomvpkg _output/bin/protoc-gen-gofast _output/src/github.com/golang/protobuf
16-
./scripts/generate.sh
17-
go run scripts/register.go
16+
GO111MODULE=off ./scripts/generate.sh
17+
GO111MODULE=off go run scripts/register.go
1818
cp scripts/json.go.partial apis/meta/v1/json.go
1919

2020
.PHONY: verify-generate
2121
verify-generate: generate
2222
./scripts/git-diff.sh
2323

2424
_output/bin/protoc-gen-gofast:
25-
./scripts/go-install.sh \
25+
GO111MODULE=off ./scripts/go-install.sh \
2626
https://github.com/gogo/protobuf \
2727
github.com/gogo/protobuf \
2828
github.com/gogo/protobuf/protoc-gen-gofast \
2929
tags/v0.5
3030

3131
_output/bin/gomvpkg:
32-
./scripts/go-install.sh \
32+
GO111MODULE=off ./scripts/go-install.sh \
3333
https://github.com/golang/tools \
3434
golang.org/x/tools \
3535
golang.org/x/tools/cmd/gomvpkg \

go.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module github.com/ericchiang/k8s
2+
3+
require (
4+
github.com/golang/protobuf v1.2.0
5+
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
6+
golang.org/x/text v0.3.0 // indirect
7+
)

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
2+
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
3+
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY=
4+
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
5+
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
6+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 commit comments

Comments
 (0)