I created a simple lazy package manager for go. I published it at https://github.com/kfirufk/glpm.
when I execute go get github.com/kfirufk/glpm
I get no errors, but it compiles it as a module since the resulted pkg content at $GOPATH/pkg/darwin_amd64/github.com/kfirufk
is glpm.a
.
I want it to be compiled as an executable. what am I missing?
thanks
To get your project building as an executable, you need to have:
main
, andmain
function to be the entry point for your programHowever, if your package can also be used as a library, a common pattern is to have your executable stored in $PACKAGE/cmd/$EXECUTABLE_NAME
. This would mean your package executable would be fetched using:
go get -u github.com/kfirufk/glpm/cmd/glpm