don't remove "//go:" compile directives

For example, this broke cgo, since it uses go:linkname.

Updates #12.
This commit is contained in:
Daniel Martí
2020-04-05 17:27:04 +01:00
parent cf3f54aa88
commit 5aaa086e5d
3 changed files with 36 additions and 11 deletions

View File

@@ -2,6 +2,8 @@ garble build main.go
exec ./main
cmp stderr main.stderr
! binsubstr main$exe 'valuable information'
-- main.go --
package main
@@ -10,6 +12,7 @@ import (
"go/ast"
)
// This comment contains valuable information. Ensure it's not in the final binary.
var V interface{}
type T struct {