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í 1d31a139f5 support aliases as embedded fields in dependencies
Our recent work in fieldToAlias worked well when the embedded field
declaration (using an alias) was in the same package as the use of that
field. We would have the *ast.Ident for the field declaration, so
types.Info.Uses would give us the TypeName for the alias.

Unfortunately, if the declaration was in a dependency package, we did
not have that same *ast.Ident, as we weren't parsing the source code for
dependencies for type-checking. This resulted in us incorrectly
obfuscating the use of such an embedded field:

	> garble build
	[stderr]
	# test/main
	JtzmzxWf.go:4: unknown field 'ExternalForeignAlias' in struct literal of type _BdSNiEL.Vcs_smer

To fix this, look through the direct imports of the package defining the
field to find an alias under the exact same name. Not a foolproof
solution, as there's a TODO, but it should work for most cases.

Fixes the obfuscation of google.golang.org/grpc/internal/status, too.

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