* 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.
Make TestHttpsInsecure test reliably passing on Darwin. (#171)
* Make TestHttpsInsecure test reliably passing on Darwin.
TestHttpsInsecure test runs a profiling session and checks that the
results contain expected function name. On OSX prior to 10.11 El Capitan
the SIGPROF signal is delivered to the process rather than to the thread
which skews the results enough for the test to fail.
Relax the check when running on OSX and other operating systems known to
have issues with the profiling signal (the list is taken from
src/runtime/pprof/pprof_test.go in Go source).
Also add the multiple variants of OSX to the continuous testing.
Fixes #146 and #156.
* Document the motivation for the empty loop.
Measure coverage of tests using codecov.io. (#123)
* Measure coverage of tests using codecov.io.
* Add codecov badge to README.md
* Recurse into packages when testing with coverage.
* Push testing kind of commands down to test.sh
*: golint, go tool vet, unsued, gosimple, staticcheck (#113)
* `git ls-files -- '*.go' | xargs gofmt -s -w`
* driver: unexport InternalOptions
This was an exported method that returned an internal type, so it's
unlikely that anyone depends on its presence.
* internal/binutils: remove newline in error string
golint reported: error strings should not be capitalized or end with
punctuation or a newline
* internal/driver: s/buildId/buildID/ per golint
* internal/elfexec: remove punctuation in error string
golint reported: error strings should not be capitalized or end with
punctuation or a newline
* internal/graph: correct comment
Found with golint.
* internal/graph: add method comment
golint reported: exported method Edge.WeightValue should have comment
or be unexported
* internal/report: remove newline in error string
golint reported: error strings should not be capitalized or end with
punctuation or a newline
* *: remove unused code
Found with honnef.co/go/tools/cmd/unused:
internal/binutils/disasm_test.go:137:8: const objdump is unused (U1000)
internal/driver/driver_test.go:353:6: type testProfile is unused (U1000)
internal/graph/graph.go:838:6: func countEdges is unused (U1000)
profile/proto.go:148:6: func encodeStringOpt is unused (U1000)
* *: simply code
Found with honnef.co/go/tools/cmd/gosimple:
internal/driver/commands.go:471:24: should omit comparison to bool constant, can be simplified to !b (S1002)
internal/driver/driver.go:163:5: should omit comparison to bool constant, can be simplified to !trim (S1002)
internal/driver/driver.go:168:5: should omit comparison to bool constant, can be simplified to !focus (S1002)
internal/driver/driver.go:172:5: should omit comparison to bool constant, can be simplified to !tagfocus (S1002)
internal/driver/driver.go:176:5: should omit comparison to bool constant, can be simplified to !hide (S1002)
internal/graph/dotgraph.go:213:34: should use make(map[string][]*Tag) instead (S1019)
internal/report/report.go:1061:3: should replace loop with label = append(label, rpt.options.ProfileLabels...) (S1011)
profile/proto.go:157:5: should omit comparison to bool constant, can be simplified to !x (S1002)
* *: correct mistakes
Found with honnef.co/go/tools/cmd/staticcheck:
driver/driver.go:280:20: infinite recursive call (SA5007)
internal/driver/driver_focus.go:54:11: this value of err is never used (SA4006)
profile/proto.go:74:32: x | 0 always equals x (SA4016)
* Add linters to .travis.yml
Go 1.6 currently fails the tests with build error
`profile/legacy_profile_test.go:309: t.Run undefined (type *testing.T has no field or method Run)`
Alternatively, we can fix it but I am not sure there is a strong reason
to support Go 1.6 or older.
Also add build status badge in the README.md file.