Files
garble/testdata/scripts/syntax.txt
Daniel Martí 5aaa086e5d don't remove "//go:" compile directives
For example, this broke cgo, since it uses go:linkname.

Updates #12.
2020-04-05 17:28:33 +01:00

47 lines
611 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
}
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}