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í b6dee63b32 improve handling of reflect on foreign unnamed types
If a package A imports package B, and uses reflect.TypeOf on an unnamed
struct type B.T (such as an alias), we don't want to record B.T's fields
as "do not obfuscate". This is for the same reason that we don't if B.T
is a named struct type: the detection only works for the package
defining the type, as otherwise it's inconsistent.

We failed to handle this case well, because we assumed all struct types
would be under some named type. This is not the case for type aliases.

Fortunately, struct fields are named, and as such they are objects.
Check their package too, just like we do for named types.

Fixes another build error when obfuscating the protobuf module.
We add a simplified version of the example above as a test case,
which originated from debugging the protobuf build failure.
5 years ago
..
asm.txt obfuscate asm function names as well (#273) 5 years ago
basic.txt testdata: reduce the cost of short tests 5 years ago
cgo.txt all: drop support for Go 1.15.x (#265) 5 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 don't obfuscate the "embed" import path 5 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 "help" refuse arguments for now 5 years ago
implement.txt hash field names equally in all packages 5 years ago
imports.txt testdata: split reflection test cases into reflect.txt 5 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 make -literals succeed on all of std 5 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 hopefully fix position test on Windows by not matching on 'main.go' 5 years ago
reflect.txt improve handling of reflect on foreign unnamed types 5 years ago
reverse.txt support reversing field names 5 years ago
seed.txt make flags like -literals and GOPRIVATE affect hashing (#288) 5 years ago
syntax.txt testdata: split reflection test cases into reflect.txt 5 years ago
test.txt testdata: reduce the cost of short tests 5 years ago
tiny.txt testdata: scope GODEBUG to a single test case 5 years ago