garble build exec ./main cmp stdout main.stdout ! bingrep main$exe 'ImportedVar' 'ImportedConst' 'ImportedFunc' 'ImportedType' [short] stop # checking that the build is reproducible is slow # Also check that the binary is reproducible when many imports are involved. cp main$exe main_old$exe rm main$exe garble build bincmp main$exe main_old$exe -- go.mod -- module foo.com/main -- main.go -- package main import ( "fmt" "foo.com/main/imported" ) func main() { fmt.Println(imported.ImportedVar) fmt.Println(imported.ImportedConst) imported.ImportedFunc('x') fmt.Println(imported.ImportedType(3)) fmt.Println(nil) } -- main.stdout -- imported var value imported const value 3 -- imported/imported.go -- package imported var ImportedVar = "imported var value" const ImportedConst = "imported const value" func ImportedFunc(param rune) string { return string(param) } type ImportedType int