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/goprivate.txt

47 lines
1.4 KiB
Plaintext

env GOPRIVATE=match-absolutely/nothing
! garble build -o=out ./standalone
stderr '^GOPRIVATE="match-absolutely/nothing" does not match any packages to be built$'
env GOPRIVATE=test/main/imported
! garble build ./importer
stderr '^public package "test/main/importer" can''t depend on obfuscated package "test/main/imported" \(matched via GOPRIVATE="test/main/imported"\)$'
[short] stop
# Try garbling all of std, given some std packages.
# No need for a main package here; building the std packages directly works the
# same, and is faster as we don't need to link a binary.
env GOPRIVATE='*'
# This used to cause errors since the "net" import causes 'go list -json'
# to output ImportMap, since "net" imports packages vendored in std.
# Another quirk of "net" is that it makes rather heavy use of cgo, which was
# hitting some edge cases we did not handle.
garble build net
# This used to cause incorrect errors since we would not obfuscate
# runtime/pprof, but we would try to obfuscate its dependencies. For now, this
# simply errors because we obfuscate nothing, since we can't obfuscate the
# runtime package just yet.
! garble build runtime/pprof
stderr 'does not match any packages to be built'
-- go.mod --
module test/main
go 1.15
-- standalone/main.go --
package main
func main() {}
-- importer/importer.go --
package importer
import "test/main/imported"
var _ = imported.Name
-- imported/imported.go --
package imported
var Name = "value"