| 1 |
[short] skip 'builds go programs' |
| 2 |
|
| 3 |
go build -o cacheprog$GOEXE cacheprog.go |
| 4 |
env GOCACHEPROG=$GOPATH/src/cacheprog$GOEXE |
| 5 |
|
| 6 |
# This should not deadlock |
| 7 |
go build simple.go |
| 8 |
! stderr 'cacheprog closed' |
| 9 |
|
| 10 |
-- simple.go -- |
| 11 |
package main |
| 12 |
|
| 13 |
func main() {} |
| 14 |
-- cacheprog.go -- |
| 15 |
// This is a minimal GOCACHEPROG program that doesn't respond to close. |
| 16 |
package main |
| 17 |
|
| 18 |
import ( |
| 19 |
"encoding/json" |
| 20 |
"os" |
| 21 |
) |
| 22 |
|
| 23 |
func main() { |
| 24 |
json.NewEncoder(os.Stdout).Encode(map[string][]string{"KnownCommands": {"close"}}) |
| 25 |
var res struct{} |
| 26 |
json.NewDecoder(os.Stdin).Decode(&res) |
| 27 |
} |