Skip to content

Commit

Permalink
Merge pull request #1 from libp2p/master
Browse files Browse the repository at this point in the history
Add badges, fix spello, and test unresolvable dials (libp2p#68)
  • Loading branch information
exition authored Feb 14, 2019
2 parents d779e4e + a07ef43 commit 05d4919
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# go-reuseport

[![travisbadge](https://travis-ci.org/libp2p/go-reuseport.svg)](https://travis-ci.org/libp2p/go-reuseport)
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)
[![](https://img.shields.io/badge/project-libp2p-blue.svg?style=flat-square)](https://libp2p.io/)
[![](https://img.shields.io/badge/freenode-%23libp2p-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23libp2p)
[![codecov](https://codecov.io/gh/libp2p/go-reuseport/branch/master/graph/badge.svg)](https://codecov.io/gh/libp2p/go-reuseport)
[![Travis CI](https://travis-ci.org/libp2p/go-reuseport.svg?branch=master)](https://travis-ci.org/libp2p/go-reuseport)

**NOTE:** This package REQUIRES go >= 1.11.

Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func ListenPacket(network, address string) (net.PacketConn, error) {
}

// Dial dials the given network and address. see net.Dialer.Dial
// Returns a net.Conn created from a file discriptor for a socket
// Returns a net.Conn created from a file descriptor for a socket
// with SO_REUSEPORT and SO_REUSEADDR option set.
func Dial(network, laddr, raddr string) (net.Conn, error) {
nla, err := ResolveAddr(network, laddr)
Expand Down
6 changes: 0 additions & 6 deletions old_go_warning.go

This file was deleted.

10 changes: 10 additions & 0 deletions reuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
"strings"
"testing"

"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -43,3 +46,10 @@ func TestListenPacketWildcardAddress(t *testing.T) {
require.NoError(t, err)
pc.Close()
}

func TestErrorWhenDialUnresolvable(t *testing.T) {
_, err := Dial("asd", "127.0.0.1:1234", "127.0.0.1:1234")
assert.IsType(t, net.UnknownNetworkError(""), errors.Cause(err))
_, err = Dial("tcp", "a.b.c.d:1234", "a.b.c.d:1235")
assert.Error(t, err)
}

0 comments on commit 05d4919

Please sign in to comment.