Suppose If we create a package in golang we have host it on GitHub so that user can download it using go get github.com/package.
I have seen most of the people hosting their source code under the GitHub account.
Can we put binary instead of source code?
Is it possible to create a binary for the package?
According to the documenation, binary-only packages are no longer supported since 1.12.
So that means we cannot release a package without source code.
If you’re on Github, you can try out https://github.com/goreleaser/goreleaser. It helps packaging your binary into OS oriented release packages. However, that will be separated from
go get a binary.
It seems I originally missunderstood your question… I was under the impression that this question was about library packages, not executables.
Executables of course can be distributed after compilation and usually do not require anything to be installed on the target system except for a
@NobbZ you understood it in the right way. I posted it to know we can create binaries for a package.
But @hollowaykeanho post helped me for other thing.
Did we solved your question? If it does, feel free to “mark as solved”. Please Mark @NobbZ first reply as that is the right answer.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.