How to use static Library when compiling go language

how to use the static library of go language when compiling, such as hello.a, I want to package a package of go language into a static library, and then do not provide the source code, let other go programs use this static library directly, how to implement it, ask for help.

Mar.06,2021

/ / assume that hello.an is in the current folder, and other programs are called main.go

go tool compile -I . main.go
go tool link -o main -L . main.o
Menu