unixpickle / gobfuscate

Obfuscate Go binaries and packages
BSD 2-Clause "Simplified" License
1.45k stars 157 forks source link

Exclude "main" package #14

Open CaledoniaProject opened 5 years ago

CaledoniaProject commented 5 years ago

My go project file structure is like the following:

src/main/main.go
src/package1/...
src/package2/..

However gobfuscate processed all packages, so I had to rename it back to main and build it.

Can you add an argument to exclude certain package names?

unixpickle commented 5 years ago

Is an argument necessary, or would you rather the tool explicitly noticed if a package was called "main" and didn't rename it?

CaledoniaProject commented 5 years ago

Since the main function in the main package is the entrypoint of a go program, I usually build the program like this:

GOPATH=$PWD go build src/main/main.go

So if the main directory is renamed I will need to locate that directory first.