Test using Go 1.8-1.10; official builds with 1.10 (#4041)

This commit is contained in:
Daniel Nelson
2018-04-18 16:14:06 -07:00
committed by GitHub
parent 571ce86d10
commit 78d4a95ce6
6 changed files with 89 additions and 25 deletions

View File

@@ -29,6 +29,11 @@ const (
DefaultShutdownTimeout = 5
)
var (
// DefaultNetwork is the network to listen on; use only in tests.
DefaultNetwork = "tcp"
)
// Recorder represents a type which can record zipkin trace data as well as
// any accompanying errors, and process that data.
type Recorder interface {
@@ -94,7 +99,7 @@ func (z *Zipkin) Start(acc telegraf.Accumulator) error {
}
addr := ":" + strconv.Itoa(z.Port)
ln, err := net.Listen("tcp", addr)
ln, err := net.Listen(DefaultNetwork, addr)
if err != nil {
return err
}

View File

@@ -557,6 +557,10 @@ func TestZipkinPlugin(t *testing.T) {
},
}
// Workaround for Go 1.8
// https://github.com/golang/go/issues/18806
DefaultNetwork = "tcp4"
z := &Zipkin{
Path: "/api/v1/spans",
Port: 0,