How to build with Golang archive?

A Golang project xxx/api has been built into an archive file api.a with command: go build -buildmode archive -o api.a a.go b.go

I’d like import package xxx/api and link against the api.a without accessing its source code in another main project. How to do this?