mirror of
https://github.com/burrowers/garble.git
synced 2025-12-24 12:58:05 +08:00
Added cleanup of the Comment field. In some cases, the appearance of a comment in a random place may break the compilation (e.g. cgo and runtime package). This is safe because the Comment field cannot contain any directives. Part of #149.
31 lines
605 B
Plaintext
31 lines
605 B
Plaintext
env GOPRIVATE=test/main
|
|
|
|
garble -debugdir ./test1 build
|
|
exists 'test1/test/main/imported/imported.go' 'test1/main/main.go'
|
|
! grep ImportedFunc $WORK/test1/test/main/imported/imported.go
|
|
! grep ImportedFunc $WORK/test1/main/main.go
|
|
! grep 'some comment' $WORK/test1/main/main.go
|
|
|
|
-- go.mod --
|
|
module test/main
|
|
-- main.go --
|
|
package main
|
|
|
|
import "test/main/imported" // some comment
|
|
|
|
type someType int // some comment
|
|
var someVar = 0
|
|
|
|
type someStruct struct {
|
|
someField int // some comment
|
|
}
|
|
|
|
func main() {
|
|
imported.ImportedFunc()
|
|
}
|
|
|
|
-- imported/imported.go --
|
|
package imported
|
|
|
|
func ImportedFunc() {}
|