You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/scripts
Daniel Martí 5c70681fee detect more std API calls which use reflection
Before, we would just notice direct calls to reflect's TypeOf and
ValueOf. Any other uses of reflection, such as encoding/json or
google.golang.org/protobuf, would require hints as documented by the
README.

Issue #162 outlines some ways we could fix this issue in a general way,
automatically detecting what functions use reflection on their parameters,
even for third party API funcs.

However, that goal is pretty significant in terms of code and effort.
As a temporary improvement, we can expand the list of "known" reflection
APIs via a static table.

Since this table is keyed by "func full name" strings, we could
potentially include third party APIs, such as:

	google.golang.org/protobuf/proto.Marshal

However, for now simply include all the std APIs we know about.
If we fail to do the proper fix for automatic detection in the future,
we can then fall back to expanding this global table for third parties.

Update the README's docs, to clarify that the hint is not always
necessary anymore.

Also update the reflect.txt test to stop using the hint for encoding/json,
and to also start testing text/template with a method call.
While at it, I noticed that we weren't testing the println outputs,
as they'd go to stderr - fix that too.

Updates #162.
4 years ago
..
asm.txt obfuscate asm function names as well (#273) 5 years ago
basic.txt testdata: use longer Go filenames for binsubstr 4 years ago
cgo.txt keep cgo-exported Go names non-obfuscated 4 years ago
crossbuild.txt fix windows/arm cross-build linking 5 years ago
debugdir.txt refactor "current package" with TOOLEXEC_IMPORTPATH (#266) 5 years ago
embed.txt support embedding via embed.FS 4 years ago
goprivate.txt avoid reproducibility issues with full rebuilds 5 years ago
goversion.txt use "go env -json" to collect env info all at once 5 years ago
help.txt make "garble command -h" give command-specific help 4 years ago
implement.txt remove tinyfmt implementation from a test script 4 years ago
imports.txt testdata: use longer Go filenames for binsubstr 4 years ago
init.txt all: drop support for Go 1.15.x (#265) 5 years ago
ldflags.txt testdata: remove some unnecessary execs (#267) 5 years ago
linkname.txt fix obfuscating linkname directives that where the package name contained a dot 5 years ago
literals.txt Follow up: Obfuscate more byte slice literals 4 years ago
modinfo.txt testdata: remove some unnecessary execs (#267) 5 years ago
plugin.txt all: drop support for Go 1.15.x (#265) 5 years ago
position.txt testdata: use longer Go filenames for binsubstr 4 years ago
reflect.txt detect more std API calls which use reflection 4 years ago
reverse.txt update support for Go 1.17 in time for beta1 4 years ago
seed.txt make flags like -literals and GOPRIVATE affect hashing (#288) 5 years ago
syntax.txt support aliases as embedded fields in dependencies 4 years ago
test.txt testdata: reduce the cost of short tests 5 years ago
tiny.txt testdata: deduplicate GODEBUG cleanup line 4 years ago