Skip to content

Commit

Permalink
replace errors.Join with errorsJoin
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Lehner <[email protected]>
  • Loading branch information
florianl committed May 31, 2024
1 parent 9fcaa5b commit 5f7dfce
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package diag

import (
"encoding/binary"
"errors"
"fmt"

"github.com/florianl/go-diag/internal/unix"
Expand Down Expand Up @@ -33,7 +32,7 @@ func extractUnixAttributes(data []byte, info *UnixAttribute) error {
case unixDiagVFS:
vfs := &UnixDiagVfs{}
err := unmarshalStruct(ad.Bytes(), vfs)
multiError = errors.Join(multiError, err)
multiError = errorsJoin(multiError, err)
info.Vfs = vfs
case unixDiagPeer:
info.Peer = uint32Ptr(ad.Uint32())
Expand All @@ -46,22 +45,22 @@ func extractUnixAttributes(data []byte, info *UnixAttribute) error {
case unixDiagRQLen:
rqlen := &UnixDiagRqLen{}
err := unmarshalStruct(ad.Bytes(), rqlen)
multiError = errors.Join(multiError, err)
multiError = errorsJoin(multiError, err)
info.RQLen = rqlen
case unixDiagMemInfo:
mi := &MemInfo{}
err := unmarshalStruct(ad.Bytes(), mi)
multiError = errors.Join(multiError, err)
multiError = errorsJoin(multiError, err)
info.MemInfo = mi
case unixDiagShutdown:
info.Shutdown = uint8Ptr(ad.Uint8())
case unixDiagUID:
info.UID = uint32Ptr(ad.Uint32())
default:
multiError = errors.Join(multiError, fmt.Errorf("unix type %d not implemented", adType))
multiError = errorsJoin(multiError, fmt.Errorf("unix type %d not implemented", adType))
}
}
return errors.Join(multiError, ad.Err())
return errorsJoin(multiError, ad.Err())
}

// UnixOption defines a query to Unix sockets.
Expand Down

0 comments on commit 5f7dfce

Please sign in to comment.