Closed smallnest closed 6 years ago
Try putting the target package argument github.com/hashicorp/raft
after all the flags, like this:
go-callvis -focus github.com/hashicorp/raft -limit github.com/hashicorp/raft -nostd github.com/hashicorp/raft
Thanks @TrueFurby , but it still has some errors:
go-callvis -focus github.com/hashicorp/raft -limit github.com/hashicorp/raft github.com/hashicorp/raft
.......
Users/yuepan/go/src/github.com/hashicorp/raft/util.go:23:47: undeclared name: math
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:25:9: undeclared name: fmt
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:35:12: undeclared name: time
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:35:26: undeclared name: rand
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:36:9: undeclared name: time
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:58:15: undeclared name: crand
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:59:9: undeclared name: fmt
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:62:9: undeclared name: fmt
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:129:9: undeclared name: fmt
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:132:9: invalid operation: buf (variable of type *invalid type) has no field or method Bytes
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:140:9: undeclared name: fmt
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:154:7: undeclared name: bytes
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:162:9: undeclared name: bytes
go-callvis: couldn't load packages due to errors: github.com/hashicorp/raft, github.com/hashicorp/go-msgpack/codec, github.com/armon/go-metrics and 2 more
This seems like issue with compiling the package github.com/hashicorp/raft itself.
Try running: go install github.com/hashicorp/raft
I tried downloading it and compiling with go 1.8.3 successfully. What Go version do you use?
Go 1.9.
I have updated "raft" : go get -u github.com/hashicorp/raft
So, it works now?
No, same problems to the above. It looks it can't find stdlib:
/Users/yuepan/go/src/github.com/hashicorp/go-msgpack/codec/binc.go:7:2: could not import math (cannot find package "math" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/math (from $GOROOT)
/Users/yuepan/go/src/math (from $GOPATH))
/Users/yuepan/go/src/github.com/hashicorp/go-msgpack/codec/binc.go:10:2: could not import time (cannot find package "time" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/time (from $GOROOT)
/Users/yuepan/go/src/time (from $GOPATH))
/Users/yuepan/go/src/github.com/hashicorp/go-msgpack/codec/decode.go:7:2: could not import io (cannot find package "io" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/io (from $GOROOT)
/Users/yuepan/go/src/io (from $GOPATH))
/Users/yuepan/go/src/github.com/hashicorp/go-msgpack/codec/decode.go:8:2: could not import reflect (cannot find package "reflect" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/reflect (from $GOROOT)
/Users/yuepan/go/src/reflect (from $GOPATH))
/Users/yuepan/go/src/github.com/hashicorp/go-msgpack/codec/encode.go:7:2: could not import io (cannot find package "io" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/io (from $GOROOT)
/Users/yuepan/go/src/io (from $GOPATH))
/Users/yuepan/go/src/github.com/hashicorp/go-msgpack/codec/encode.go:8:2: could not import reflect (cannot find package "reflect" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/reflect (from $GOROOT)
But I installed go1.9
➜ raft git:(master) ✗ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/yuepan/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gq/jd9v5dd95p570hkztblb8ht40000gn/T/go-build725023326=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
You have GOROOT
set to /usr/local/go
, but for some reason during the compilation it seems to using /usr/local/Cellar/go/1.7.4/libexec/
to look for stdlib.
It should be caused by this. I have ever installed go by brew but I have uninstalled it then. Now I install go manually. It is not an issue of go-callvis.
I will investigate how to fix it .
Thanks @TrueFurby
I use the below command"
go-callvis -focus github.com/hashicorp/raft github.com/hashicorp/raft -limit github.com/hashicorp/raft -nostd
but there are many errors:
/Users/yuepan/go/src/github.com/hashicorp/raft/util.go:58:15: undeclared name: crand /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:59:9: undeclared name: fmt /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:62:9: undeclared name: fmt /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:129:9: undeclared name: fmt /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:132:9: invalid operation: buf (variable of type *invalid type) has no field or method Bytes /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:140:9: undeclared name: fmt /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:154:7: undeclared name: bytes /Users/yuepan/go/src/github.com/hashicorp/raft/util.go:162:9: undeclared name: bytes cannot find package "-limit" in any of: /usr/local/Cellar/go/1.7.4/libexec/src/-limit (from $GOROOT) /Users/yuepan/go/src/-limit (from $GOPATH) cannot find package "-nostd" in any of:
Maybe I have made a mistake to use it.
My question is how to use it for github.com/hashicorp/raft github.com/hashicorp/raft
have you fix it ?
I use the below command"
but there are many errors:
Maybe I have made a mistake to use it.
My question is how to use it for github.com/hashicorp/raft github.com/hashicorp/raft