Test using Go 1.8-1.10; official builds with 1.10 (#4041)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user