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

60 lines
803 B
Plaintext

garble build main.go
exec ./main
cmp stderr main.stderr
! binsubstr main$exe 'valuable information'
-- main.go --
package main
import (
"encoding/json"
"go/ast"
)
// This comment contains valuable information. Ensure it's not in the final binary.
var V interface{}
type T struct {
ast.Node
*ast.Ident
}
type EncodingT struct {
Foo int
}
type Embedded int
type Embedding struct {
Embedded
}
type embedded int
type embedding struct {
embedded
}
// embedded fields whose type is in the universe scope used to crash garble
type EmbeddingUniverseScope struct {
error
int
string
}
func main() {
switch V := V.(type) {
case int:
var _ int = V
case nil:
println("nil case")
}
enc, _ := json.Marshal(EncodingT{Foo: 3})
println(string(enc))
}
-- main.stderr --
nil case
{"Foo":3}