Home > other >  How can I track down what is causing `go build` to take a long time?
How can I track down what is causing `go build` to take a long time?

Time:02-11

Running it with -v does not really tell me what the problem is. It takes about 20s before printing even a single line.

Running it under strace outputs a lot of noise, and strace does not run on Mac OS.

Removing dependencies to see if they are the problem would be a ridiculous amount of work.

CodePudding user response:

You can use the -x flag to show all commands being executed:

https://godocs.io/cmd/go#hdr-Compile_packages_and_dependencies

  •  Tags:  
  • go
  • Related