How to Use go tool link and go tool compile

Cli
Use go tool compile to create object files and go tool link to combine them into an executable binary.

Use go tool compile to compile Go source files into object files and go tool link to link those object files into an executable. These low-level tools are typically invoked by the go command but can be run directly for fine-grained control.

go tool compile -o main.o main.go
go tool link -o myapp main.o

The compile step translates .go files into .o object files, while the link step combines them with dependencies into a final binary.