After upgrading from Go 1.2.1 to 1.3 (Windows 7 64 bit) "go build" execution time has increased from around 4 to over 45 seconds. There were no other changes except the go version update. Switching off the virus scanner seems to have no effect. Any clues?
After upgrading from Go 1.2. 1 to 1.3 (Windows 7 64 bit) "go build" execution time has increased from around 4 to over 45 seconds. There were no other changes except the go version update.
Additionally, other commands, such as go build or go test, will add new dependencies automatically based on the stipulated requirements. For example, as earlier illustrated, they can do this to satisfy import requirements, including upgrading go. mod file and installing the new dependencies.
Go The Go Command Go Build Println("Hello, World!") } build creates an executable program, in this case: main or main.exe . You can then run this file to see the output Hello, World! . You can also copy it to a similar system that doesn't have Go installed, make it executable, and run it there.
The same way you'd run any other executable. ./program or program.exe . After you run go build main.go , there will be a new file with the name of the folder containing your main.go file. That is the executable. If the directory containing the main.go file is named toto , on unix you have to type ./toto to execute it.
You probably have dependencies that are being recompiled each time. Try go install -a mypackage
to rebuild all dependencies.
Removing $GOPATH/pkg
also helps to ensure you don't have old object files around.
Building with the -x
flag will show you if the toolchain is finding incompatible versions.
I have the exact same problem, running this command solves it:
go get -u -v github.com/mattn/go-sqlite3
Another tip: http://kokizzu.blogspot.co.id/2016/06/solution-for-golang-slow-compile.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With