From e86c55f0457333083b78e4cd8ccffe7585c5b904 Mon Sep 17 00:00:00 2001 From: Christopher Burnett Date: Wed, 5 Aug 2020 15:55:31 -0400 Subject: [PATCH] migrating from glide to go modules (#81) * Modules Support * update travis Co-authored-by: Chris Roche --- .travis.yml | 6 +----- Makefile | 23 +++++++++++------------ glide.lock | 40 ---------------------------------------- glide.yaml | 11 ----------- go.mod | 9 +++++++++ go.sum | 45 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 66 insertions(+), 68 deletions(-) delete mode 100644 glide.lock delete mode 100644 glide.yaml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index 895374d..7ab01b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,14 @@ language: go -go: "1.12.8" +go: "1.14.6" go_import_path: github.com/lyft/protoc-gen-star env: - global: - - GLIDE_VER="v0.13.1" matrix: - PROTOC_VER="3.5.1" - PROTOC_VER="3.6.1" before_install: - mkdir -p $GOPATH/bin - - wget "https://github.com/Masterminds/glide/releases/download/${GLIDE_VER}/glide-${GLIDE_VER}-linux-amd64.tar.gz" -O /tmp/glide.tar.gz - - tar -xvf /tmp/glide.tar.gz --strip-components 1 -C ${GOPATH}/bin - wget "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip" -O /tmp/protoc.zip - unzip /tmp/protoc.zip -d /tmp - sudo mv /tmp/bin/protoc /usr/local/bin/protoc diff --git a/Makefile b/Makefile index 59f10c3..709fbd0 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,30 @@ -# the name of this package & all subpackages +# the name of this package PKG := $(shell go list .) -PKGS := $(shell go list ./...) .PHONY: bootstrap -bootstrap: vendor testdata # set up the project for development +bootstrap: testdata # set up the project for development .PHONY: lint lint: # lints the package for common code smells - set -e; for f in `find . -name "*.go" -not -name "*.pb.go" | grep -v vendor`; do \ + set -e; for f in `find . -name "*.go" -not -name "*.pb.go"`; do \ out=`gofmt -s -d $$f`; \ test -z "$$out" || (echo $$out && exit 1); \ done which golint || go get -u golang.org/x/lint/golint - golint -set_exit_status $(PKGS) + golint -set_exit_status ./... go vet -all .PHONY: quick -quick: vendor testdata # runs all tests without the race detector or coverage +quick: testdata # runs all tests without the race detector or coverage go test $(PKGS) .PHONY: tests -tests: vendor testdata # runs all tests against the package with race detection and coverage percentage - go test -race -cover $(PKGS) +tests: testdata # runs all tests against the package with race detection and coverage percentage + go test -race -cover ./... .PHONY: cover -cover: vendor testdata # runs all tests against the package, generating a coverage report and opening it in the browser - go test -race -covermode=atomic -coverprofile=cover.out $(PKGS) || true +cover: testdata # runs all tests against the package, generating a coverage report and opening it in the browser + go test -race -covermode=atomic -coverprofile=cover.out ./... || true go tool cover -html cover.out -o cover.html open cover.html @@ -86,10 +85,10 @@ vendor: # install project dependencies protoc-gen-go: which protoc-gen-go || (go get -u github.com/golang/protobuf/protoc-gen-go) -bin/protoc-gen-example: vendor # creates the demo protoc plugin for demonstrating uses of PG* +bin/protoc-gen-example: # creates the demo protoc plugin for demonstrating uses of PG* go build -o ./bin/protoc-gen-example ./testdata/protoc-gen-example -bin/protoc-gen-debug: vendor # creates the protoc-gen-debug protoc plugin for output ProtoGeneratorRequest messages +bin/protoc-gen-debug: # creates the protoc-gen-debug protoc plugin for output ProtoGeneratorRequest messages go build -o ./bin/protoc-gen-debug ./protoc-gen-debug .PHONY: clean diff --git a/glide.lock b/glide.lock deleted file mode 100644 index aaabce9..0000000 --- a/glide.lock +++ /dev/null @@ -1,40 +0,0 @@ -hash: a98be71ff763a2b4b183feef097ec7a862c3d26d01cb7c7484975b8e10dabeb5 -updated: 2019-03-19T18:13:23.892274-07:00 -imports: -- name: github.com/golang/protobuf - version: b5d812f8a3706043e23a9cd5babf2e5423744d30 - subpackages: - - descriptor - - proto - - protoc-gen-go/descriptor - - protoc-gen-go/generator - - protoc-gen-go/generator/internal/remap - - protoc-gen-go/plugin - - ptypes/any -- name: github.com/spf13/afero - version: f4711e4db9e9a1d3887343acb72b2bbfc2f686f5 - subpackages: - - mem -- name: golang.org/x/sync - version: 37e7f081c4d4c64e13b10787722085407fe5d15f - subpackages: - - errgroup -- name: golang.org/x/text - version: e6919f6577db79269a6443b9dc46d18f2238fb5d - subpackages: - - transform - - unicode/norm -testImports: -- name: github.com/davecgh/go-spew - version: d8f796af33cc11cb798c1aaeb27a4ebc5099927d - subpackages: - - spew -- name: github.com/pmezard/go-difflib - version: 5d4384ee4fb2527b0a1256a821ebfc92f91efefc - subpackages: - - difflib -- name: github.com/stretchr/testify - version: 363ebb24d041ccea8068222281c2e963e997b9dc - subpackages: - - assert - - require diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 727b21b..0000000 --- a/glide.yaml +++ /dev/null @@ -1,11 +0,0 @@ -package: github.com/lyft/protoc-gen-star -import: -- package: github.com/golang/protobuf - version: ^1.1.0 -- package: github.com/spf13/afero -- package: golang.org/x/text -- package: golang.org/x/sync - subpackages: - - errgroup -testImport: -- package: github.com/stretchr/testify diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c185fcc --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module github.com/lyft/protoc-gen-star + +go 1.14 + +require ( + github.com/golang/protobuf v1.4.2 + github.com/spf13/afero v1.3.3 + github.com/stretchr/testify v1.6.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a0ec335 --- /dev/null +++ b/go.sum @@ -0,0 +1,45 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +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/spf13/afero v1.3.3 h1:p5gZEKLYoL7wh8VrJesMaYeNxdEd1v3cb4irOk9zB54= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=