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í 8d36e1d80e avoid go/printer from breaking imports
We obfuscate import paths in import declarations like:

	"domain.com/somepkg"

by replacing them with the obfuscated package path:

	somepkg "HPS4Mskq"

Note how we add a name to the import if there wasn't one,
so that references like somepkg.Foo keep working in the code.

This could break in some edge cases involving comments between imports
in the Go code, because go/printer is somewhat brittle with positions:

	> garble build -tags buildtag
	[stderr]
	# test/main/importedpkg
	:16: syntax error: missing import path
	exit status 2
	exit status 2

To prevent that, ensure the name has a reasonable position.

This was preventing github.com/gorilla/websocket from being obufscated.
It is a fairly popular library in Go, but we don't add it to
scripts/check-third-party.sh for now as wireguard already gives us
coverage over networking and cryptography.
2 years ago
..
asm.txt all: drop support for Go 1.17 2 years ago
basic.txt add missing context to two unmarshal errors 2 years ago
cgo.txt obfuscate cgo-generated-Go filenames 2 years ago
crossbuild.txt all: drop support for Go 1.17 2 years ago
debugdir.txt all: drop support for Go 1.17 2 years ago
embed.txt all: drop support for Go 1.17 2 years ago
goenv.txt actually remove temporary directories after obfuscation 2 years ago
gogarble.txt all: drop support for Go 1.17 2 years ago
goversion.txt all: drop support for Go 1.17 2 years ago
help.txt fix support with the latest Go master version 2 years ago
implement.txt all: drop support for Go 1.17 2 years ago
imports.txt avoid go/printer from breaking imports 2 years ago
init.txt all: drop support for Go 1.17 2 years ago
ldflags.txt slight simplifications and alloc reductions 2 years ago
linkname.txt all: drop support for Go 1.17 2 years ago
literals.txt Disable seed obfuscator (#535) 2 years ago
modinfo.txt all: drop support for Go 1.17 2 years ago
plugin.txt all: drop support for Go 1.17 2 years ago
position.txt all: drop support for Go 1.17 2 years ago
reflect.txt fix support with the latest Go master version 2 years ago
reverse.txt actually remove temporary directories after obfuscation 2 years ago
seed-cache.txt all: drop support for Go 1.17 2 years ago
seed.txt all: drop support for Go 1.17 2 years ago
syntax.txt all: drop support for Go 1.17 2 years ago
test.txt skip unnecessary "refusing to list" test errors 2 years ago
tiny.txt all: drop support for Go 1.17 2 years ago
typeparams.txt fix hashing of generic field names 2 years ago