Golang : How to protect your source code ؟

Golang : How to protect your source code from client, hosting company or hacker?

  1. client: don’t hand the sources over, but a prebuilt executable only
  2. hoster: self host instead
  3. hacker: pray that my firewall and passwords are stronger than the hackers foo

As you can see, the usual stuff.


Or, if really paranoid, only work with code on a non-connected computer, transfer binary to networked computer by sneaker net (ie. USB, SD card, etc.) :grin:.


You can also offer your code as services (web API, sites, etc).


Don’t give it to them.

Go compiles to executable binaries. The source code is not required by end users, hosting companies, etc.

1 Like

How about they will decompile the binary?

1 Like

You can’t do much against reverse engineering except not giving away the binary and only selling SaaS.


for hosting you can that how ?

I do not understand the question. As you hand over a binary to a client, you can handover the binary to a hoster.

for Windows you can building .exe(binary) you hand over a client
for Linux I don’t know how it works ? but i think you can build .sh (binary)
for host I don’t know how it works ?

On Linux when you build it, it will produce a executable binary without an extension, same on host if it is a Linux server.

1 Like

Well, another thing is that one should actually know about how ones target system handles executable code and permissions. If you do not know how linux works, you shouldn’t deploy on linux, if you don’t know mac, don’t deploy there and if you do not know windows, don’t do it…

Some measures do deepend on the system you deploy to.

1 Like

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