Skip to content

Commit

Permalink
Merge pull request #20 from wmnsk/remove-pkgerr
Browse files Browse the repository at this point in the history
Remove pkg/errors
  • Loading branch information
wmnsk authored Apr 2, 2024
2 parents abe9bd7 + 920451b commit a29c6c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions dialogue-pdu.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ package tcap
import (
"fmt"
"io"

"github.com/pkg/errors"
)

// Code definitions.
Expand Down Expand Up @@ -266,11 +264,11 @@ func NewAUDT(protover int, context, contextver uint8, userinfo ...*IE) *Dialogue
}
*/

// MarshalBinary returns the byte sequence generated from a Dialogue instance.
// MarshalBinary returns the byte sequence generated from a DialoguePDU.
func (d *DialoguePDU) MarshalBinary() ([]byte, error) {
b := make([]byte, d.MarshalLen())
if err := d.MarshalTo(b); err != nil {
return nil, errors.Wrap(err, "failed to marshal DialoguePDU:")
return nil, fmt.Errorf("failed to marshal DialoguePDU: %w", err)
}
return b, nil
}
Expand Down
6 changes: 2 additions & 4 deletions dialogue.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ package tcap
import (
"fmt"
"io"

"github.com/pkg/errors"
)

// Dialogue OID: Dialogue-As-ID and Unidialogue-As-Id.
Expand Down Expand Up @@ -51,11 +49,11 @@ func NewDialogue(oid, ver uint8, pdu *DialoguePDU, payload []byte) *Dialogue {
return d
}

// MarshalBinary returns the byte sequence generated from a Dialogue instance.
// MarshalBinary returns the byte sequence generated from a Dialogue.
func (d *Dialogue) MarshalBinary() ([]byte, error) {
b := make([]byte, d.MarshalLen())
if err := d.MarshalTo(b); err != nil {
return nil, errors.Wrap(err, "failed to serialize Dialogue:")
return nil, fmt.Errorf("failed to marshal Dialogue: %w", err)
}
return b, nil
}
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ go 1.21
require (
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07
github.com/pascaldekloe/goe v0.1.1
github.com/pkg/errors v0.9.1
github.com/wmnsk/go-m3ua v0.1.8
github.com/wmnsk/go-sccp v0.0.1
)

require github.com/google/go-cmp v0.5.4 // indirect
require (
github.com/google/go-cmp v0.5.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
)

0 comments on commit a29c6c0

Please sign in to comment.