Can we create binaries for a package in golang


(akhil) #1

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?

Thanks,
Akhil


(Norbert Melzer) #2

According to the documenation, binary-only packages are no longer supported since 1.12.


(akhil) #3

Thanks @NobbZ
So that means we cannot release a package without source code.


(Norbert Melzer) #4

Yes.


(Holloway) #5

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.


(akhil) #6

Thanks @hollowaykeanho


(Norbert Melzer) #7

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 libc


(akhil) #8

@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.


(Holloway) #9

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.