Skip to content

Commit

Permalink
Update CI configs to v0.10.6
Browse files Browse the repository at this point in the history
Update lint scripts and CI configs.
  • Loading branch information
pionbot authored and Sean-Der committed Apr 8, 2023
1 parent ce17e12 commit 2008af3
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
release:
uses: pion/.goassets/.github/workflows/release.reusable.yml@master
with:
go-version: '1.19' # auto-update/latest-go-version
go-version: '1.20' # auto-update/latest-go-version
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
strategy:
matrix:
go: ['1.19', '1.18'] # auto-update/supported-go-version-list
go: ['1.20', '1.19'] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}
Expand All @@ -30,12 +30,12 @@ jobs:
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
strategy:
matrix:
go: ['1.19', '1.18'] # auto-update/supported-go-version-list
go: ['1.20', '1.19'] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}

test-wasm:
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
with:
go-version: '1.19' # auto-update/latest-go-version
go-version: '1.20' # auto-update/latest-go-version
2 changes: 1 addition & 1 deletion .github/workflows/tidy-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
tidy:
uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master
with:
go-version: '1.19' # auto-update/latest-go-version
go-version: '1.20' # auto-update/latest-go-version
10 changes: 5 additions & 5 deletions connctx/connctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ type connAddrMock struct{}

func (*connAddrMock) RemoteAddr() net.Addr { return stringAddr{"remote_net", "remote_addr"} }
func (*connAddrMock) LocalAddr() net.Addr { return stringAddr{"local_net", "local_addr"} }
func (*connAddrMock) Read(b []byte) (n int, err error) { panic("unimplemented") }
func (*connAddrMock) Write(b []byte) (n int, err error) { panic("unimplemented") }
func (*connAddrMock) Read(_ []byte) (n int, err error) { panic("unimplemented") }
func (*connAddrMock) Write(_ []byte) (n int, err error) { panic("unimplemented") }
func (*connAddrMock) Close() error { panic("unimplemented") }
func (*connAddrMock) SetDeadline(t time.Time) error { panic("unimplemented") }
func (*connAddrMock) SetReadDeadline(t time.Time) error { panic("unimplemented") }
func (*connAddrMock) SetWriteDeadline(t time.Time) error { panic("unimplemented") }
func (*connAddrMock) SetDeadline(_ time.Time) error { panic("unimplemented") }
func (*connAddrMock) SetReadDeadline(_ time.Time) error { panic("unimplemented") }
func (*connAddrMock) SetWriteDeadline(_ time.Time) error { panic("unimplemented") }

func TestLocalAddrAndRemoteAddr(t *testing.T) {
c := New(&connAddrMock{})
Expand Down
8 changes: 4 additions & 4 deletions test/connctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ type wrappedReader struct {
io.Reader
}

func (r *wrappedReader) ReadContext(ctx context.Context, b []byte) (int, error) {
func (r *wrappedReader) ReadContext(_ context.Context, b []byte) (int, error) {
return r.Reader.Read(b)
}

type wrappedWriter struct {
io.Writer
}

func (r *wrappedWriter) WriteContext(ctx context.Context, b []byte) (int, error) {
func (r *wrappedWriter) WriteContext(_ context.Context, b []byte) (int, error) {
return r.Writer.Write(b)
}

type wrappedReadWriter struct {
io.ReadWriter
}

func (r *wrappedReadWriter) ReadContext(ctx context.Context, b []byte) (int, error) {
func (r *wrappedReadWriter) ReadContext(_ context.Context, b []byte) (int, error) {
return r.ReadWriter.Read(b)
}

func (r *wrappedReadWriter) WriteContext(ctx context.Context, b []byte) (int, error) {
func (r *wrappedReadWriter) WriteContext(_ context.Context, b []byte) (int, error) {
return r.ReadWriter.Write(b)
}
2 changes: 1 addition & 1 deletion test/util_nowasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

package test

func filterRoutineWASM(stack string) bool {
func filterRoutineWASM(string) bool {
return false
}
1 change: 1 addition & 0 deletions utils/xor/xor_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package xor

// XorBytes xors the bytes in a and b. The destination should have enough
// space, otherwise xorBytes will panic. Returns the number of bytes xor'd.
//
//revive:disable-next-line
func XorBytes(dst, a, b []byte) int {
n := len(a)
Expand Down
1 change: 1 addition & 0 deletions utils/xor/xor_arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func isAligned(a *byte) bool {

// XorBytes xors the bytes in a and b. The destination should have enough
// space, otherwise xorBytes will panic. Returns the number of bytes xor'd.
//
//revive:disable-next-line
func XorBytes(dst, a, b []byte) int {
n := len(a)
Expand Down
1 change: 1 addition & 0 deletions utils/xor/xor_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func isAligned(a *byte) bool {

// XorBytes xors the bytes in a and b. The destination should have enough
// space, otherwise xorBytes will panic. Returns the number of bytes xor'd.
//
//revive:disable-next-line
func XorBytes(dst, a, b []byte) int {
n := len(a)
Expand Down
1 change: 1 addition & 0 deletions utils/xor/xor_ppc64x.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package xor

// XorBytes xors the bytes in a and b. The destination should have enough
// space, otherwise xorBytes will panic. Returns the number of bytes xor'd.
//
//revive:disable-next-line
func XorBytes(dst, a, b []byte) int {
n := len(a)
Expand Down
10 changes: 5 additions & 5 deletions vnet/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (c *UDPConn) SetReadDeadline(t time.Time) error {
// Even if write times out, it may return n > 0, indicating that
// some of the data was successfully written.
// A zero value for t means WriteTo will not time out.
func (c *UDPConn) SetWriteDeadline(t time.Time) error {
func (c *UDPConn) SetWriteDeadline(time.Time) error {
// Write never blocks.
return nil
}
Expand Down Expand Up @@ -207,7 +207,7 @@ func (c *UDPConn) ReadFromUDP(b []byte) (int, *net.UDPAddr, error) {
//
// The packages golang.org/x/net/ipv4 and golang.org/x/net/ipv6 can be
// used to manipulate IP-level socket options in oob.
func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) {
func (c *UDPConn) ReadMsgUDP([]byte, []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) {
return -1, -1, -1, nil, transport.ErrNotSupported
}

Expand Down Expand Up @@ -264,19 +264,19 @@ func (c *UDPConn) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error) {
//
// The packages golang.org/x/net/ipv4 and golang.org/x/net/ipv6 can be
// used to manipulate IP-level socket options in oob.
func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error) {
func (c *UDPConn) WriteMsgUDP([]byte, []byte, *net.UDPAddr) (n, oobn int, err error) {
return -1, -1, transport.ErrNotSupported
}

// SetReadBuffer sets the size of the operating system's
// receive buffer associated with the connection.
func (c *UDPConn) SetReadBuffer(bytes int) error {
func (c *UDPConn) SetReadBuffer(int) error {
return transport.ErrNotSupported
}

// SetWriteBuffer sets the size of the operating system's
// transmit buffer associated with the connection.
func (c *UDPConn) SetWriteBuffer(bytes int) error {
func (c *UDPConn) SetWriteBuffer(int) error {
return transport.ErrNotSupported
}

Expand Down
6 changes: 3 additions & 3 deletions vnet/conn_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (

type myConnObserver struct{}

func (obs *myConnObserver) write(c Chunk) error {
func (obs *myConnObserver) write(Chunk) error {
return nil
}

func (obs *myConnObserver) onClosed(addr net.Addr) {
func (obs *myConnObserver) onClosed(net.Addr) {
}

func (obs *myConnObserver) determineSourceIP(locIP, dstIP net.IP) net.IP {
func (obs *myConnObserver) determineSourceIP(net.IP, net.IP) net.IP {
return net.IP{}
}

Expand Down
2 changes: 1 addition & 1 deletion vnet/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (o *dummyObserver) onClosed(addr net.Addr) {
o.onOnClosed(addr)
}

func (o *dummyObserver) determineSourceIP(locIP, dstIP net.IP) net.IP {
func (o *dummyObserver) determineSourceIP(locIP, _ net.IP) net.IP {
return locIP
}

Expand Down
6 changes: 3 additions & 3 deletions vnet/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (v *Net) Dial(network string, address string) (net.Conn, error) {
}

// ResolveIPAddr returns an address of IP end point.
func (v *Net) ResolveIPAddr(network, address string) (*net.IPAddr, error) {
func (v *Net) ResolveIPAddr(_, address string) (*net.IPAddr, error) {
var err error

// Check if host is a domain name
Expand Down Expand Up @@ -588,12 +588,12 @@ func NewNet(config *NetConfig) (*Net, error) {
}

// DialTCP acts like Dial for TCP networks.
func (v *Net) DialTCP(network string, laddr, raddr *net.TCPAddr) (transport.TCPConn, error) {
func (v *Net) DialTCP(string, *net.TCPAddr, *net.TCPAddr) (transport.TCPConn, error) {
return nil, transport.ErrNotSupported
}

// ListenTCP acts like Listen for TCP networks.
func (v *Net) ListenTCP(network string, laddr *net.TCPAddr) (transport.TCPListener, error) {
func (v *Net) ListenTCP(string, *net.TCPAddr) (transport.TCPListener, error) {
return nil, transport.ErrNotSupported
}

Expand Down
6 changes: 1 addition & 5 deletions vnet/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,7 @@ func (r *Router) addNIC(nic NIC) error {
r.nics[ip.String()] = nic
}

if err = nic.setRouter(r); err != nil {
return err
}

return nil
return nic.setRouter(r)
}

// AddRouter adds a child Router.
Expand Down
2 changes: 1 addition & 1 deletion vnet/udpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (v *aUDPProxyWorker) Close() error {
return nil
}

func (v *aUDPProxyWorker) Proxy(ctx context.Context, client *Net, serverAddr *net.UDPAddr) error { // nolint:gocognit
func (v *aUDPProxyWorker) Proxy(ctx context.Context, _ *Net, serverAddr *net.UDPAddr) error { // nolint:gocognit
// Create vnet for real server by serverAddr.
nw, err := NewNet(&NetConfig{
StaticIP: serverAddr.IP.String(),
Expand Down
2 changes: 1 addition & 1 deletion vnet/udpproxy_direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (v *UDPProxy) Deliver(sourceAddr, destAddr net.Addr, b []byte) (nn int, err
return
}

func (v *aUDPProxyWorker) Deliver(sourceAddr, destAddr net.Addr, b []byte) (nn int, err error) {
func (v *aUDPProxyWorker) Deliver(sourceAddr, _ net.Addr, b []byte) (nn int, err error) {
addr, ok := sourceAddr.(*net.UDPAddr)
if !ok {
return 0, fmt.Errorf("invalid addr %v", sourceAddr) // nolint:goerr113
Expand Down

0 comments on commit 2008af3

Please sign in to comment.