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í 64317883c9 handle aliases to foreign named types properly
When such an alias name was used to define an embedded field, we handled
that case gracefully via the code using:

	tf.info.Uses[node].(*types.TypeName)

Unfortunately, when the same field name was used elsewhere, such as a
composite literal, tf.Info.Uses gave us a *types.Var, not a
*types.TypeName, meaning we could no longer tell if this was an alias,
or what it pointed to.

Thus, we failed to obfuscate the name properly in the added test case:

	> garble build
	[stderr]
	# test/main/sub
	xxWZf66u.go:36: unknown field 'foreignAlias' in struct literal of type smhWelwn

It doesn't seem like any of the go/types APIs allows us to obtain the
*types.TypeName directly in this scenario. Thus, use a trick that we
used before: after typechecking, but before obfuscating, record all
embedded struct field *types.Var which are aliases via a map, where the
value holds the *types.TypeName for the alias.

Updates #349.
4 years ago
..
asm.txt obfuscate asm function names as well (#273) 4 years ago
basic.txt testdata: use longer Go filenames for binsubstr 4 years ago
cgo.txt all: drop support for Go 1.15.x (#265) 4 years ago
crossbuild.txt fix windows/arm cross-build linking 4 years ago
debugdir.txt refactor "current package" with TOOLEXEC_IMPORTPATH (#266) 4 years ago
embed.txt support embedding via embed.FS 4 years ago
goprivate.txt avoid reproducibility issues with full rebuilds 4 years ago
goversion.txt use "go env -json" to collect env info all at once 4 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) 4 years ago
ldflags.txt testdata: remove some unnecessary execs (#267) 4 years ago
linkname.txt fix obfuscating linkname directives that where the package name contained a dot 4 years ago
literals.txt make -literals succeed on all of std 4 years ago
modinfo.txt testdata: remove some unnecessary execs (#267) 4 years ago
plugin.txt all: drop support for Go 1.15.x (#265) 4 years ago
position.txt testdata: use longer Go filenames for binsubstr 4 years ago
reflect.txt testdata: use longer Go filenames for binsubstr 4 years ago
reverse.txt reverse lone filenames as well 4 years ago
seed.txt make flags like -literals and GOPRIVATE affect hashing (#288) 4 years ago
syntax.txt handle aliases to foreign named types properly 4 years ago
test.txt testdata: reduce the cost of short tests 4 years ago
tiny.txt testdata: deduplicate GODEBUG cleanup line 4 years ago