How to share code with others

We have golang code . This code is our business login.

We want to share with other company . but we want to share like dll or .so file not code .

It should work like sdk for them.

There is no good way to do it. binary-only-package support was dropped after go1.12. There was a huge discussion here. You can try to use plugin but it has very limited options, looks ugly, does not work on windows and requires cgo for compilation. On the other hand, you can try and share your source code under the strict license.

This is really a disadvantage of this language .It is common in all language.

Dunno what you are talking about, when on the contrary there is only a list of some languages which can be used this way. Most part of them don’t have this kind of functionality and I see valid points why golang decided to drop support of it.

1 Like

Maybe check this out?

https://www.reddit.com/r/golang/comments/sco4ul/dll_architecture_in_go/

This is in general impossible. Smart people can reverse engineer everything. It is just a matter of effort. Even if you are technically able to provide them a standalone binary.

Two options come into my mind.
1. Microservice.
2. Obfuscation. I mean, why not? :partying_face:

2 Likes

Thank you.

Microservice is one choice.in my application I have lot of database transaction. I don’t know how to manage transaction with microservices.

How to do obfuscation of golang code.

Please guide if you know.

You might want to look at GitHub - burrowers/garble: Obfuscate Go builds. I don’t have experience of it myself, but I believe that wails uses it.

Obfuscation is good if you are shipping the whole application. But here the question is to provide the package but without showing the code.

A possible option will be to build an executable .exe file, save it on your Google Drive or Microsoft OneDrive or Amazon AWS, and share it with your business partners.