Build your Program
Was this helpful?
When building your application using our SDK, we recommend two primary methods:
Standard Go build
Go build with Garble
Both approaches are valid; however, building with Garble provides additional benefits that are important to consider.
Garble is a tool that works as a compiler wrapper around go build, designed to obfuscate Go code. Here’s why we encourage you to use it:
Obfuscation: Garble reduces the risk of reverse-engineering by renaming symbols, stripping debug information, and minimizing the visibility of the internal structure of your binaries.
Security: Protects proprietary algorithms, sensitive logic, and API interactions from easy inspection.
Reduced Binary Predictability: Makes the binary less predictable, which can deter certain types of static analysis or targeted attacks.
Minimal Overhead: Garble integrates easily into the Go toolchain without major changes to your build pipeline.
Important: Garble is best used in release builds. For development, use standard go build for faster builds and better debuggability.
Garble offers several options to fine-tune the obfuscation process. Some recommended flags:
-literals: Obfuscates literals like strings and numbers.
-tiny: Reduces binary size further and increases obfuscation.
-debug: Enables some debug features (not recommended for production).
Example with extra obfuscation:
go build
Fast, easy, debuggable
No protection against reverse engineering
garble build
Obfuscated, more secure, less predictable binaries
Slightly slower builds, harder to debug
Was this helpful?
Was this helpful?
garble -literals -tiny build -o your-program