Quellcode durchsuchen

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 vor 5 Jahren
Ursprung
Commit
f9b734f9ee
4 geänderte Dateien mit 40 neuen und 15 gelöschten Zeilen
  1. 14
    10
      .travis.yml
  2. 5
    5
      appveyor.yml
  3. 11
    0
      go.mod
  4. 10
    0
      go.sum

+ 14
- 10
.travis.yml Datei anzeigen

@@ -4,36 +4,36 @@ go_import_path: github.com/google/pprof
4 4
 
5 5
 matrix:
6 6
   include:
7
-    - os: linux
8
-      go: 1.11.x
9 7
     - os: linux
10 8
       go: 1.12.x
9
+    - os: linux
10
+      go: 1.13.x
11 11
     - os: linux
12 12
       go: master
13 13
     - os: osx
14 14
       osx_image: xcode8.3
15
-      go: 1.11.x
15
+      go: 1.12.x
16 16
     - os: osx
17 17
       osx_image: xcode8.3
18
-      go: 1.12.x
18
+      go: 1.13.x
19 19
     - os: osx
20 20
       osx_image: xcode8.3
21 21
       go: master
22 22
     - os: osx
23 23
       osx_image: xcode9.4
24
-      go: 1.11.x
24
+      go: 1.12.x
25 25
     - os: osx
26 26
       osx_image: xcode9.4
27
-      go: 1.12.x
27
+      go: 1.13.x
28 28
     - os: osx
29 29
       osx_image: xcode9.4
30 30
       go: master
31 31
     - os: osx
32 32
       osx_image: xcode10.1
33
-      go: 1.11.x
33
+      go: 1.12.x
34 34
     - os: osx
35 35
       osx_image: xcode10.1
36
-      go: 1.12.x
36
+      go: 1.13.x
37 37
     - os: osx
38 38
       osx_image: xcode10.1
39 39
       go: master
@@ -46,9 +46,10 @@ addons:
46 46
     packages:
47 47
       - graphviz
48 48
     update: true
49
-    
49
+ 
50 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 54
 script:
54 55
   - gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
@@ -56,5 +57,8 @@ script:
56 57
   - go vet -all ./...
57 58
   - ./test.sh
58 59
 
60
+  # Check still works in GOPATH mode.
61
+  - env GO111MODULE=off go get -d . && go test -v ./...
62
+
59 63
 after_success:
60 64
   - bash <(curl -s https://codecov.io/bash)

+ 5
- 5
appveyor.yml Datei anzeigen

@@ -1,13 +1,13 @@
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 6
 install:
4 7
  - cinst graphviz
5 8
 
6
-before_build:
7
- - go get github.com/ianlancetaylor/demangle
8
- - go get github.com/chzyer/readline
9
-
10 9
 build_script:
10
+ - go env
11 11
  - go build github.com/google/pprof
12 12
 
13 13
 test_script:

+ 11
- 0
go.mod Datei anzeigen

@@ -0,0 +1,11 @@
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 Datei anzeigen

@@ -0,0 +1,10 @@
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=