Переглянути джерело

Add go.mod to the repository (#502)

* 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.
Hyang-Ah Hana Kim 5 роки тому
джерело
коміт
f9b734f9ee
4 змінених файлів з 40 додано та 15 видалено
  1. 14
    10
      .travis.yml
  2. 5
    5
      appveyor.yml
  3. 11
    0
      go.mod
  4. 10
    0
      go.sum

+ 14
- 10
.travis.yml Переглянути файл

4
 
4
 
5
 matrix:
5
 matrix:
6
   include:
6
   include:
7
-    - os: linux
8
-      go: 1.11.x
9
     - os: linux
7
     - os: linux
10
       go: 1.12.x
8
       go: 1.12.x
9
+    - os: linux
10
+      go: 1.13.x
11
     - os: linux
11
     - os: linux
12
       go: master
12
       go: master
13
     - os: osx
13
     - os: osx
14
       osx_image: xcode8.3
14
       osx_image: xcode8.3
15
-      go: 1.11.x
15
+      go: 1.12.x
16
     - os: osx
16
     - os: osx
17
       osx_image: xcode8.3
17
       osx_image: xcode8.3
18
-      go: 1.12.x
18
+      go: 1.13.x
19
     - os: osx
19
     - os: osx
20
       osx_image: xcode8.3
20
       osx_image: xcode8.3
21
       go: master
21
       go: master
22
     - os: osx
22
     - os: osx
23
       osx_image: xcode9.4
23
       osx_image: xcode9.4
24
-      go: 1.11.x
24
+      go: 1.12.x
25
     - os: osx
25
     - os: osx
26
       osx_image: xcode9.4
26
       osx_image: xcode9.4
27
-      go: 1.12.x
27
+      go: 1.13.x
28
     - os: osx
28
     - os: osx
29
       osx_image: xcode9.4
29
       osx_image: xcode9.4
30
       go: master
30
       go: master
31
     - os: osx
31
     - os: osx
32
       osx_image: xcode10.1
32
       osx_image: xcode10.1
33
-      go: 1.11.x
33
+      go: 1.12.x
34
     - os: osx
34
     - os: osx
35
       osx_image: xcode10.1
35
       osx_image: xcode10.1
36
-      go: 1.12.x
36
+      go: 1.13.x
37
     - os: osx
37
     - os: osx
38
       osx_image: xcode10.1
38
       osx_image: xcode10.1
39
       go: master
39
       go: master
46
     packages:
46
     packages:
47
       - graphviz
47
       - graphviz
48
     update: true
48
     update: true
49
-    
49
+ 
50
 before_install:
50
 before_install:
51
-  - go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
51
+  # Do not let tools interfere with the main module's go.mod
52
+  - env GO111MODULE=off go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
52
 
53
 
53
 script:
54
 script:
54
   - gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
55
   - gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
56
   - go vet -all ./...
57
   - go vet -all ./...
57
   - ./test.sh
58
   - ./test.sh
58
 
59
 
60
+  # Check still works in GOPATH mode.
61
+  - env GO111MODULE=off go get -d . && go test -v ./...
62
+
59
 after_success:
63
 after_success:
60
   - bash <(curl -s https://codecov.io/bash)
64
   - bash <(curl -s https://codecov.io/bash)

+ 5
- 5
appveyor.yml Переглянути файл

1
-clone_folder: c:\go\src\github.com\google\pprof
1
+clone_folder: c:\gopath\src\github.com\google\pprof
2
+
3
+environment:
4
+  GOPATH: c:\gopath
2
 
5
 
3
 install:
6
 install:
4
  - cinst graphviz
7
  - cinst graphviz
5
 
8
 
6
-before_build:
7
- - go get github.com/ianlancetaylor/demangle
8
- - go get github.com/chzyer/readline
9
-
10
 build_script:
9
 build_script:
10
+ - go env
11
  - go build github.com/google/pprof
11
  - go build github.com/google/pprof
12
 
12
 
13
 test_script:
13
 test_script:

+ 11
- 0
go.mod Переглянути файл

1
+module github.com/google/pprof
2
+
3
+go 1.14
4
+
5
+require (
6
+	github.com/chzyer/logex v1.1.10 // indirect
7
+	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
8
+	github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
9
+	github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6
10
+	golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e // indirect
11
+)

+ 10
- 0
go.sum Переглянути файл

1
+github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
2
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
3
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
4
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
5
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
6
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
7
+github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=
8
+github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
9
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e h1:9vRrk9YW2BTzLP0VCB9ZDjU4cPqkg+IDWL7XgxA1yxQ=
10
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=