Build go module with main.go not in the root of the repo

Highly respected community,

I’m trying to build Golang module that holds main.go source file not in the root of the repo but rather in the ./cmd/alps subdirectory.

To build such module imperatively, I would run:

go build ./cmd/alps

Go compiler would start processing ./cmd/alps/main.go as a main source file, but binary file would be produced to the ./ directory.

Is it possible to define such argument for the buildGoModule function?