"go test -coverprofile" report "unknown command"

I execute go test -coverprofile for my code, but it always report Error: unknown command "/usr1/code/src/github.com/squirreldb/clm" for "clm". Is there someone know the reason?

go version
go version go1.7 linux/amd64
go test -coverprofile /tmp/test0.cov -coverpkg=github.com/clm/agent,github.com/clm/cfg,github.com/clm/cli,github.com/clm/cm,github.com/clm/cm/common,github.com/clm/cm/monitor,github.com/clm/conftool,github.com/clm/etcd_manager,github.com/clm/keys,github.com/clm,github.com/clm/service,github.com/clm/topo,github.com/clm/util/log,github.com/clm/util github.com/clm

Error: unknown command "/usr1/code/src/github.com/clm" for "clm"

Hey @YuleiXiao,

The last part of your go test args is this:

github.com/clm/util github.com/clm

Did you mean to write this:


with the comma and not a space?

P.S. I have no idea if that would cause the issue, but just noticed all of the other things are comma separated so just a suggestion.

Thanks reply @radovskyb . But it looks like not the problem. I had try, but still happen.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.