The oracle command seems to work on some projects,
$ 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
But when I try another popular Go project,
$ 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
I don't understand why I am receiving errors from cgo. Can anyone help?