Questions tagged [go-toolchain]

The Go toolchain is an umbrella term that refers to the Go CLI and its commands, as go run, go build, go test, and so on. Use this tag for questions related to the usage of these commands. For questions specifically related to the go mod command, you may also use [go-modules] tag.

The Go toolchain is the set of commands supported by the go command line interface. It is developed and maintained as part of the Go programming language itself, and is part of the official Go distribution.

The full documentation can be found here: https://pkg.go.dev/cmd/go.

Some of the most frequently used commands are:

  • go get to fetch, update and/or install dependencies
  • go build to compile Go programs and build binaries
  • go test to run unit tests
  • go mod to initialize, organize and maintain Go modules
  • go vet to run static analysis
24 questions
1
vote
0 answers

Is it possible to link object files generated from the Go toolchain using gcc/clang linker?

executable files built by the Go compiler are not compatible on target environment as the loader expects program sections to be in specific order. As a result, I'm trying to compile the Go source using go tool compile to generate .o files, which I…
0xFFFFFFF0
  • 65
  • 5
1
vote
1 answer

Get registry info regarding where dependencies are coming from

I would like to get my dependencies from a private golang registry. By using GOPROXY. I would like to make sure all dependencies are coming from that private registry. The only way I found for now is by doing go get -v -t …
nono
  • 2,262
  • 3
  • 23
  • 32
1
vote
1 answer

Checking to make sure project compiles before pushing to version control remote

I have a script for TypeScript projects that makes sure my code compiles before I push it to the remote: simple_git_push_typescript(){ ( set -e top_level="$(git rev-parse --show-toplevel)" if [[ "$cm_ignore_tsc" != 'yes' ]]; then …
user12849275
1
vote
1 answer

go bin - just 3 files

I installed Go 1.6.2 on Windows but in my bin directory I now have only 3 files: go.exe godoc.exe gofmt.exe I wonder if that's normal or my installation didn't go quite well.
peter.petrov
  • 38,363
  • 16
  • 94
  • 159
1
vote
0 answers

Is there a way to copy and restore the callstack in a Go program?

I am trying to implement continuations with unlimited extent in a Go program (for those curious, I am writing a scheme interpreter). One way to do this is to copy the callstack to the heap so that it can be restored later. Go's garbage collector…
Matt
  • 21,026
  • 18
  • 63
  • 115
0
votes
1 answer

Go error installing dependency, producing EOF

I have just received a new notebook with Win onboard (21H2 build 19044.1415) and tried to install my Go project. After running go build I just keep receiving EOF errors. I tried to sync dependencies in Jetbrains Goland, in VS Code (it is saying EOF…
Jack
  • 857
  • 14
  • 39
0
votes
1 answer

makefile variables within variables executing bash scripts

I have a makefile that I want to run against both linux (debian/Ubuntu) and Windows/Cygwin. I need to do something slightly different according to the running environment and I came out with the following piece of code which is supposed to store in…
TPPZ
  • 4,447
  • 10
  • 61
  • 106
-1
votes
1 answer

Unit test does not cover locally imported packages

I am new to golang and trying to understand how i can make this scenario work? Here is my structure GOPATH set to /Users/xyz/project /Users/xyz/project/src/main.go // import calculator and call SUM with two…
Ashish Sharma
  • 331
  • 1
  • 5
  • 12
-4
votes
1 answer

What does Go's pprof stand for?

pprof is a profiling tool of Go. But what does the word pprof stand for? It might be a silly question but I can't get an answer of it from anywhere. Google's pprof source code Go blog article about pprof
Coconut
  • 2,024
  • 18
  • 25
1
2