Skip to content

Commit ea56ede

Browse files
committed
error: rename NewErrorf to Errorf
1 parent 004d8ca commit ea56ede

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ func (e *Error) Error() string {
4747
return e.Message
4848
}
4949

50-
// NewErrorf builds a Error struct for the suppied message and code.
50+
// Errorf builds a Error struct for the suppied message and code.
5151
// If args is not empty, message and args will be passed to Sprintf.
52-
func NewErrorf(code ErrorCode, format string, args ...interface{}) *Error {
52+
func Errorf(code ErrorCode, format string, args ...interface{}) *Error {
5353
return &Error{
5454
Code: code,
5555
Message: fmt.Sprintf(format, args...),

jsonrpc2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func NewConn(ctx context.Context, s Stream, options ...Options) *Conn {
8282
// the default handler reports a method error
8383
conn.handle = func(ctx context.Context, c *Conn, r *Request) {
8484
if r.IsNotify() {
85-
c.Reply(ctx, r, nil, NewErrorf(MethodNotFound, "method %q not found", r.Method))
85+
c.Reply(ctx, r, nil, Errorf(MethodNotFound, "method %q not found", r.Method))
8686
}
8787
}
8888
}

0 commit comments

Comments
 (0)