Skip to content

Commit

Permalink
Migrate Glide => Go 1.11 modules, de-vendorize
Browse files Browse the repository at this point in the history
Supporting only Go 1.11 with this change, to benefit from build
reproducibility of modules with reduced need for vendoring. Taking my
chances without it.

In Go 1.9 they stopped including `vendor` in `./...` for many tools,
allowing a few Makefile hacks to be removed.
  • Loading branch information
ches committed Oct 28, 2018
1 parent f20f736 commit bf8173e
Show file tree
Hide file tree
Showing 509 changed files with 98 additions and 76,425 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: go
go:
- 1.5
- 1.6
- 1.11
- tip

env:
global:
- GO15VENDOREXPERIMENT=1
# Travis puts the checkout into GOPATH, so we need to force modules
- GO111MODULE=on

install:
- make get-devtools
- export PATH=$PATH:$HOME/gopath/bin
- export PATH=$PATH:$GOPATH/bin

script:
- make lint coverage
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pull requests will be checked to pass the same procedure. The convenience `make
get-devtools` target can install any tools that you're missing.

If you wish to contribute a change that involves updating dependencies, please
use Glide in order to `glide update` or `glide get` the source in `vendor/`.
Use a version constraint, unless the package is imported via gopkg.in with v1
or above.
use Go 1.11 or later for your work so that [the `go` tool supports managing
`go.mod`][mod].

[mod]: https://tip.golang.org/cmd/go/#hdr-Maintaining_module_requirements
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ The CLI's output, exit codes, etc. are provisional and subject to change until
a 1.0 release—please consult the change log before installing new versions if
you rely on these for scripting.

Unreleased Changes
------------------

Updated the build to Go 1.11, and only this version in order to use modules and
drop Glide and not keep dependencies vendored. No functional changes.

kafka-connect CLI
-----------------

Expand Down
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ GO ?= go
SHASUM := shasum -a 256
VERSION := $(shell git describe)

packages := . ./cmd/...
packages := ./...
fordist := find * -type d -exec

# Should use -mod=readonly in CI
build:
$(GO) build $(packages)

install:
$(GO) install $(packages)

# Use `test all` now for CI? https://research.swtch.com/vgo-cmd
# Re: ginkgo, https://github.com/onsi/ginkgo/issues/278
test:
$(GO) test $(packages)
Expand All @@ -29,13 +31,11 @@ coverage:
browse-coverage: coverage
$(GO) tool cover --html connect.coverprofile

# golint only takes one package or else it thinks multiple arguments are
# directories (which it also doesn't support), ./... includes vendor :-/
lint:
$(foreach pkg, $(packages), golint --set_exit_status $(pkg);)
golint --set_exit_status ./...

# TODO: add to CI after dropping 1.5 support
# https://github.com/kisielk/errcheck/issues/75
# Now it needs to be fixed for modules:
# https://github.com/kisielk/errcheck/issues/155
errcheck:
errcheck --asserts --ignore 'io:Close' $(packages)

Expand Down Expand Up @@ -88,10 +88,6 @@ clean:
$(RM) *.coverprofile
$(RM) -r man

# In case you forget -s -v when using `glide get`.
clean-vendor:
glide install --strip-vcs --strip-vendor

distclean: clean
$(RM) -r dist/
$(GO) clean -i $(packages)
Expand Down
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,24 @@ Predictably, use `--completion-script-zsh` for zsh.
Building and Development
------------------------

This project is implemented in Go and uses [Glide] to achieve reproducible
builds. You don't need Glide unless you want to make changes to dependencies,
though, since the dependency sources are checked into source control.
This project is implemented in Go and uses [Go 1.11 modules] to achieve
reproducible builds.

Once you [have a working Go toolchain][write go], it is simple to build like
any standard Go project:
any Go project that uses modules:

```sh
$ go get -d github.com/go-kafka/connect/...
$ cd $GOPATH/github.com/go-kafka/connect
# In someplace you'd like to keep your work:
$ git clone git@github.com:go-kafka/connect.git
$ cd connect
$ go build # or
$ go install # or
$ go test # etc.
```

If you are building with Go 1.5, be sure to `export GO15VENDOREXPERIMENT=1` to
resolve the dependencies in `vendor/`. This is default in Go 1.6.
Note that you _do not_ need to use a workspace, i.e. `$GOPATH`. In fact, you
should not, or else you'll need to set `GO111MODULE=1` in your shell
environment to force module-aware mode on.

Cross-compiling is again standard Go procedure: set `GOOS` and `GOARCH`. For
example if you wanted to build a CLI tool binary for Linux on ARM:
Expand All @@ -194,12 +195,9 @@ kafka-connect: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically link
This project uses the [Ginkgo] BDD testing library. You can run the tests
normally with `go test` or `make test`. If you wish to use additional features
of [the Ginkgo CLI tool][ginkgo cli] like `watch` mode or generating stub test
files, etc. you'll need to install it on your regular `GOPATH` using:
files, etc. you'll need to install it using:

$ go install github.com/onsi/ginkgo/ginkgo

This tool is not included in `vendor/`, in part because [Glide doesn't support
that yet][glide execs], and also because it's optional.
$ go get github.com/onsi/ginkgo/ginkgo

### Using the Go Library ###

Expand All @@ -212,7 +210,7 @@ $ go get -u github.com/go-kafka/connect
```

The library has no dependencies beyond the standard library. Dependencies in
this repository's `vendor/` are for the CLI tool (the `cmd` sub-package, not
this repository's `go.mod` are for the CLI tool (the `cmd` sub-package, not
installed unless you append `/...` to the `go get` command above).

See the API documentation linked above for examples.
Expand Down Expand Up @@ -253,11 +251,10 @@ see the [LICENSE](LICENSE) file for full details.
[Kafka Connect]: http://docs.confluent.io/current/connect/intro.html
[REST API]: http://docs.confluent.io/current/connect/userguide.html#rest-interface
[releases]: https://github.com/go-kafka/connect/releases
[Glide]: https://glide.sh/
[Go 1.11 modules]: https://github.com/golang/go/wiki/Modules
[write go]: https://golang.org/doc/install
[Ginkgo]: https://onsi.github.io/ginkgo/
[ginkgo cli]: https://onsi.github.io/ginkgo/#the-ginkgo-cli
[glide execs]: https://github.com/Masterminds/glide/pull/331

[release-badge]: https://img.shields.io/github/release/go-kafka/connect.svg
[latest release]: https://github.com/go-kafka/connect/releases/latest
Expand Down
20 changes: 0 additions & 20 deletions glide.lock

This file was deleted.

12 changes: 0 additions & 12 deletions glide.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module github.com/go-kafka/connect

require (
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 // indirect
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 // indirect
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 // indirect
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/onsi/ginkgo v1.6.0
github.com/onsi/gomega v1.4.2
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/stretchr/testify v1.2.2 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.2
)
48 changes: 48 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/alecthomas/kingpin.v2 v2.2.2 h1:VBV8OzdyP4EuRQy9lkr5gkIGaGt5FRC0JH/+TmQVfd8=
gopkg.in/alecthomas/kingpin.v2 v2.2.2/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
25 changes: 0 additions & 25 deletions vendor/github.com/alecthomas/template/README.md

This file was deleted.

Loading

0 comments on commit bf8173e

Please sign in to comment.