GoLang package without code

I have built a package in GoLang-1.9.2 in which I am sharing the source that contains the following two lines.

//go:binary-only-package

package ssApi
If I use this package in GoLang-1.9.2 every thing works fine, but if I use this package with GoLang-1.9.4 I am getting the following error.

./sampleA.go:7:2: import /usr/local/go/pkg/linux_amd64/ssApi.a: object is [linux amd64 go1.9.2 X:framepointer] expected [linux amd64 go1.9.4 X:framepointer]

My ultimate goal is to build a package in GoLang which can be used for all versions (at least for some range) of Go, without sharing the source code of package.

You will need to build the package for each version of the compiler you support.

Thanks for the help.

You can eventually make this “secret code” as a separate service and connect to it using gRPC or something. Then you can distribute binaries for platforms you support.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.