oracle命令似乎适用于某些项目,
$ oracle -pos $PWD/src/golang.org/x/tools/oracle/peers.go:#860 callers golang.org/x/tools/oracle
/Users/charlie/gowork/src/golang.org/x/tools/oracle/peers.go:26:6: golang.org/x/tools/oracle.peers is called from these 1 sites:
/Users/charlie/gowork/src/golang.org/x/tools/oracle/oracle.go:118:15: static function call from golang.org/x/tools/oracle.Run
但是当我尝试另一个流行的Go项目时,
$ oracle -pos $PWD/src/github.com/rogpeppe/godef/doc.go:#860 callers github.com/rogpeppe/godef
/usr/local/go/src/os/user/lookup_unix.go:21:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
^
1 error generated.
cgo failed: [go tool cgo -objdir /var/folders/_f/ctj4_3hn5pj8s_h3zkwj4gzm0000gn/T/os_user_C106771339 -- -I /var/folders/_f/ctj4_3hn5pj8s_h3zkwj4gzm0000gn/T/os_user_C106771339 lookup_unix.go]: exit status 1
/usr/local/go/src/net/cgo_bsd.go:11:10: fatal error: 'netdb.h' file not found
#include <netdb.h>
^
1 error generated.
cgo failed: [go tool cgo -objdir /var/folders/_f/ctj4_3hn5pj8s_h3zkwj4gzm0000gn/T/net_C499245934 -- -I /var/folders/_f/ctj4_3hn5pj8s_h3zkwj4gzm0000gn/T/net_C499245934 cgo_bsd.go cgo_resnew.go cgo_sockold.go cgo_unix.go]: exit status 1
我不明白为什么我从cgo收到错误。有人可以帮忙吗?