The type changes from Go 1.4->1.5, and it's not worth tearing it apart.
"net"
"net/url"
"sync"
- "syscall"
"testing"
+ "github.com/stretchr/testify/require"
+
"github.com/anacrolix/torrent/util"
)
for msgLen := 1; ; msgLen *= 2 {
n, err := c.Write(make([]byte, msgLen))
if err != nil {
- err := err.(*net.OpError).Err
- if err != syscall.EMSGSIZE {
- t.Fatalf("write error isn't EMSGSIZE: %s", err)
- }
+ require.Contains(t, err.Error(), "message too long")
return
}
if n < msgLen {