如何查看"go get"安装中出错的内部编译命令?

I am pulling and installing a package with dependencies, and a compilation fails, in this case not finding a file, magic.h. How do I see what the compilation commands and flags were? The -v option does not help. (I do NOT want ideas about where to get magic.h from, this is just an example.)

$ go get -u github.com/presbrey/magicmime
# github.com/presbrey/magicmime
../../../src/github.com/presbrey/magicmime/magicmime.go:20:11: fatal error:   'magic.h' file not found
#include <magic.h>

How can I find, for example, where it was looking for include files, what source exactly it was compiling? (In this case the source file I see in $GO_PATH/src has that #include commented out, and a /usr/local/include/match.h exists anyway.)

转载于:https://stackoverflow.com/questions/31345230/how-can-i-see-the-internal-compile-commands-which-fail-in-a-go-get-installatio

Run go build -x on problem package:

go build -x github.com/presbrey/magicmime