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

39 lines
1.1 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.
# This used to cause multiple errors, mainly since std vendors some external
# packages so we must properly support ImportMap.
# Plus, some packages like net make heavy use of complex features like Cgo.
# Note that we won't obfuscate a few std packages just yet, mainly those around runtime.
env GOPRIVATE='*'
garble build std
-- 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"