Skip to content

Commit

Permalink
completely remove github.com/zeebo/errs
Browse files Browse the repository at this point in the history
Signed-off-by: junya koyama <arukiidou@yahoo.co.jp>
  • Loading branch information
arukiidou committed Nov 3, 2024
1 parent b67b4ea commit 598202b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/Microsoft/go-winio v0.6.2
github.com/go-jose/go-jose/v4 v4.0.4
github.com/stretchr/testify v1.9.0
github.com/zeebo/errs v1.4.0
google.golang.org/grpc v1.67.1
google.golang.org/grpc/examples v0.0.0-20230224211313-3775f633ce20
google.golang.org/protobuf v1.34.2
Expand Down
2 changes: 0 additions & 2 deletions v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM=
github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
Expand Down
10 changes: 5 additions & 5 deletions v2/spiffetls/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package spiffetls
import (
"context"
"crypto/tls"
"errors"
"fmt"
"io"
"net"

"github.com/spiffe/go-spiffe/v2/spiffeid"
"github.com/spiffe/go-spiffe/v2/spiffetls/tlsconfig"
"github.com/spiffe/go-spiffe/v2/workloadapi"
"github.com/zeebo/errs"
)

// Dial creates an mTLS connection using an X509-SVID obtained from the
Expand Down Expand Up @@ -89,14 +89,14 @@ type clientConn struct {
}

func (c *clientConn) Close() error {
var group errs.Group
var group []error
if c.sourceCloser != nil {
group.Add(c.sourceCloser.Close())
group = append(group, c.sourceCloser.Close())
}
if err := c.Conn.Close(); err != nil {
group.Add(wrapSpiffetlsErr(fmt.Errorf("unable to close TLS connection: %w", err)))
group = append(group, wrapSpiffetlsErr(fmt.Errorf("unable to close TLS connection: %w", err)))
}
return group.Err()
return errors.Join(group...)
}

// PeerID returns the peer SPIFFE ID on the connection. The handshake must have
Expand Down
10 changes: 5 additions & 5 deletions v2/spiffetls/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package spiffetls
import (
"context"
"crypto/tls"
"errors"
"fmt"
"io"
"net"

"github.com/spiffe/go-spiffe/v2/spiffeid"
"github.com/spiffe/go-spiffe/v2/spiffetls/tlsconfig"
"github.com/spiffe/go-spiffe/v2/workloadapi"
"github.com/zeebo/errs"
)

// Listen creates an mTLS listener accepting connections on the given network
Expand Down Expand Up @@ -129,14 +129,14 @@ func (l *listener) Addr() net.Addr {
}

func (l *listener) Close() error {
var group errs.Group
var group []error
if l.sourceCloser != nil {
group.Add(l.sourceCloser.Close())
group = append(group, l.sourceCloser.Close())
}
if err := l.inner.Close(); err != nil {
group.Add(wrapSpiffetlsErr(fmt.Errorf("unable to close TLS connection: %w", err)))
group = append(group, wrapSpiffetlsErr(fmt.Errorf("unable to close TLS connection: %w", err)))
}
return group.Err()
return errors.Join(group...)
}

type serverConn struct {
Expand Down

0 comments on commit 598202b

Please sign in to comment.