lol, that's a new one: came across a Go library that distributes its source code, but has a commercial license. Nothing amazing so far, but the code's been run through an "obfuscator" minifier thing, seemingly in an effort to protect it. Now, couple issues with that.
First, the authors wanted package docs to work for their customers. So, the obfuscator doesn't remove any docstrings. It also can't rename any exported types, methods, functions, or struct fields. And it can't alter the structure of the code in any major way, which immediately nerfs most available obfuscation techniques.
Second, it's still valid Go code that you can feed into the compiler and get a package back. Therefore, you can use the leet hacker tool known as `gofmt` to undo almost all of the "obfuscation" instantly. Some weak obfuscation tricks remain, but a couple hundred LoC with Go's parser packages would have those undone very easily.
I wouldn't encourage doing any of this mind you. First because the code isn't very good so you shouldn't use it anyway, and also it's still under a weird proprietary license, being able to recover the source code doesn't change that. I just stumbled upon it while browsing, a Go file proudly advertising that it was PROtECtED by AN obFUScAtor, and had a moment of "wait, how does that work... oh, I see, it doesn't."
- replies
- 0
- announces
- 0
- likes
- 0