Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Add explicit library dependencies (#703)
Browse files Browse the repository at this point in the history
Adds Gopkg.toml and Gopkg.lock with initial dependency
versions. Includes workaround for Apache Thrift repo migration.
Ignores the vendor folder and adds a travis test to ensure dependency
version updates don't break the build.

Fixes #684.
  • Loading branch information
johanbrandhorst authored and rakyll committed Apr 16, 2018
1 parent 9b24783 commit 36f8bed
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
# go.opencensus.io/exporter/aws
/exporter/aws/

# Ignore Go vendor directory
/.vendor/
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ notifications:
before_script:
- GO_FILES=$(find . -iname '*.go' | grep -v /vendor/) # All the .go files, excluding vendor/ if any
- PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/ if any
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh # Install latest dep release

script:
- if [ -n "$(gofmt -s -l .)" ]; then echo "gofmt the following files:"; gofmt -s -l .; exit 1; fi
- dep ensure -v
- go build ./... # Ensure dependency updates don't break build
- if [ -n "$(gofmt -s -l $GO_FILES)" ]; then echo "gofmt the following files:"; gofmt -s -l $GO_FILES; exit 1; fi
- go vet ./...
- go test -v -race $PKGS # Run all the tests with the race detector enabled
- 'if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then ! golint ./... | grep -vE "(_mock|_string|\.pb)\.go:"; fi'
247 changes: 247 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[[constraint]]
name = "cloud.google.com/go"
version = "0.21.0"

[[constraint]]
branch = "master"
name = "git.apache.org/thrift.git"
source = "github.com/apache/thrift"

[[constraint]]
name = "github.com/golang/protobuf"
version = "1.0.0"

[[constraint]]
name = "github.com/openzipkin/zipkin-go"
version = "0.1.0"

[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.8.0"

[[constraint]]
branch = "master"
name = "golang.org/x/net"

[[constraint]]
branch = "master"
name = "golang.org/x/oauth2"

[[constraint]]
branch = "master"
name = "google.golang.org/api"

[[constraint]]
branch = "master"
name = "google.golang.org/genproto"

[[constraint]]
name = "google.golang.org/grpc"
version = "1.11.3"

[prune]
go-tests = true
unused-packages = true

0 comments on commit 36f8bed

Please sign in to comment.