Skip to content

Commit

Permalink
Add go.mod to the repository (#502)
Browse files Browse the repository at this point in the history
* Add go.mod/go.sum

* travis: update to test in modules mode and with go1.13

Remove go1.11 setup

* fix appveyor config

AppVeyor sets the latest go stack in C:\go and that is GOROOT.
Cloning this repo under C:\go\src\.. directory confused go build
(as discussed in golang/go#34657). The fix in go is not yet
released. Thus this commit changes GOPATH to c:\gopath and clones
the repo under the directory.

Also, this commit removes the go get commands intended to pull in
dependencies. In modules mode, `go build` pulls in the required
dependencies.
  • Loading branch information
hyangah authored and aalexand committed Dec 5, 2019
1 parent 27840ff commit f9b734f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
24 changes: 14 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ go_import_path: github.com/google/pprof

matrix:
include:
- os: linux
go: 1.11.x
- os: linux
go: 1.12.x
- os: linux
go: 1.13.x
- os: linux
go: master
- os: osx
osx_image: xcode8.3
go: 1.11.x
go: 1.12.x
- os: osx
osx_image: xcode8.3
go: 1.12.x
go: 1.13.x
- os: osx
osx_image: xcode8.3
go: master
- os: osx
osx_image: xcode9.4
go: 1.11.x
go: 1.12.x
- os: osx
osx_image: xcode9.4
go: 1.12.x
go: 1.13.x
- os: osx
osx_image: xcode9.4
go: master
- os: osx
osx_image: xcode10.1
go: 1.11.x
go: 1.12.x
- os: osx
osx_image: xcode10.1
go: 1.12.x
go: 1.13.x
- os: osx
osx_image: xcode10.1
go: master
Expand All @@ -46,15 +46,19 @@ addons:
packages:
- graphviz
update: true

before_install:
- go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
# Do not let tools interfere with the main module's go.mod
- env GO111MODULE=off go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...

script:
- gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
- golintlint=$(golint ./...) && if [ -n "$golintlint" ]; then printf 'golint found:\n%s\n' "$golintlint" && exit 1; fi
- go vet -all ./...
- ./test.sh

# Check still works in GOPATH mode.
- env GO111MODULE=off go get -d . && go test -v ./...

after_success:
- bash <(curl -s https://codecov.io/bash)
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
clone_folder: c:\go\src\github.com\google\pprof
clone_folder: c:\gopath\src\github.com\google\pprof

environment:
GOPATH: c:\gopath

install:
- cinst graphviz

before_build:
- go get github.com/ianlancetaylor/demangle
- go get github.com/chzyer/readline

build_script:
- go env
- go build github.com/google/pprof

test_script:
Expand Down
11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/google/pprof

go 1.14

require (
github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e // indirect
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e h1:9vRrk9YW2BTzLP0VCB9ZDjU4cPqkg+IDWL7XgxA1yxQ=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

0 comments on commit f9b734f

Please sign in to comment.