Comments (4)
Isaac, thanks for the detailed issue. I cannot reproduce the issue locally. There was a bug in the Go compiler a while ago that manifested in gocov-instrumented tests. Can you please let me know the output of go version
?
FYI, I am running 1.1.1 on the machine I just tested on.
from gocov.
Thanks for responding.
So all I had to do was remove the $GOPATH/pkg dir so that it would recompile the packages. Once I did that it worked fine.
FYI: I'm new to golang, is there a reason why "go clean" and "go build" didn't rebuild the binaries in the pkg dir?
from gocov.
So all I had to do was remove the $GOPATH/pkg dir so that it would recompile the packages. Once I did that it worked fine.
Thanks for letting me know. This is a bit concerning though. You shouldn't need to clean the pkg dir. There have been other issues reported that may stem from the same issue. I'll try again later to reproduce this. If you're able to nail down some steps to reproduce this from a clean pkg dir, then that would be very helpful.
FYI: I'm new to golang, is there a reason why "go clean" and "go build" didn't rebuild the binaries in the pkg dir?
go clean -i
will clean installed binaries/packages. Plain old go clean
is just for removing binary artefacts from the source directory (e.g. a binary left behind from running "go build" in the source dir).
However, you shouldn't need to manually clean the installed packages. The go
tool will (should) detect timestamp discrepancies between source and binaries.
from gocov.
So, at least, in one scenario...
The "go" command is getting a bit confused with regards to which package
archive to use; the one in the temporary GOROOT, or the one in GOPATH. The
one in GOPATH is being taken if its timestamp is newer than the source
files. I'm not really sure why the go command is getting confused here,
though; the source has been updated in the temporary GOROOT, after all.
I'm going to put in a hack for now, to temporarily remove package files for
instrumented packages, and replace them after running go test. Sucky, but
it works.
On Wed, Sep 25, 2013 at 4:57 AM, Isaac Mosquera [email protected]:
Thanks for responding.
So all I had to do was remove the $GOPATH/pkg dir so that it would
recompile the packages. Once I did that it worked fine.FYI: I'm new to golang, is there a reason why "go clean" and "go build"
didn't rebuild the binaries in the pkg dir?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-25041865
.
Andrew Wilkins
http://awilkins.id.au
from gocov.
Related Issues (20)
- [Question] Can i use gocov to get code coverage report for a go application if my tests are written in another framework using python HOT 3
- Does gocov not support generics in Go version 1.20? HOT 1
- Does gocov currently support generics,expected '(', found '[' (and 5 more errors)
- When the file size of coverage is large (420KB), generating json is very slow, taking several hours
- how to confirm the supported GO version of gocov
- gocov's result is different from go test HOT 1
- If a package has no test files, the lines in that package are not added to the total line count. HOT 10
- Pass arguments to go list HOT 4
- please tag a version, to make go modules usage easier HOT 2
- gocov: gocov report print total coverage NaN% when totalReached and totalStatements are zero
- gocov does not pass -tags parameter HOT 1
- What is the difference to the go standard tools?
- gocov failed when trying on file that has a formatting directive
- 按照指示安装不了,有什么国内的镜像地址吗 HOT 1
- go get doesn't install HOT 2
- the code source default is $GOROOT. whether the code source path can be specified by the user when using gocov convert? HOT 3
- Unable to use go install HOT 2
- gocov with go1.18 generics HOT 3
- [question] Is it possible to exclude a method from code coverage? HOT 1
- gocov with coverprofile raise error, the file path contains duplicate parts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocov.