...

Text file src/cmd/go/testdata/script/build_cacheprog_issue70848.txt

Documentation: cmd/go/testdata/script

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

View as plain text