Skip to content

Commit

Permalink
BREAKING CHANGE: netcore: errclass => errClass (#49)
Browse files Browse the repository at this point in the history
Other names nicely follow camel case, so use camel case also for the
errclass field, thus using errClass.
  • Loading branch information
bassosimone authored Nov 29, 2024
1 parent 7d623e9 commit 1ae0b6a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion errclass/errclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with names resembling standard Unix error names.
1. Preserve original error in `err` in the structured logs.
2. Add the classified error as the `errclass` field.
2. Add the classified error as the `errClass` field.
3. Use [errors.Is] and [errors.As] for classification.
Expand Down
6 changes: 3 additions & 3 deletions netcore/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (c *connWrapper) Close() (err error) {
c.ctx,
"closeDone",
slog.Any("err", err),
slog.String("errclass", errclass.New(err)),
slog.String("errClass", errclass.New(err)),
slog.String("localAddr", c.laddr),
slog.String("protocol", c.protocol),
slog.String("remoteAddr", c.raddr),
Expand Down Expand Up @@ -132,7 +132,7 @@ func (c *connWrapper) Read(buf []byte) (int, error) {
"readDone",
slog.Int("ioBytesCount", count),
slog.Any("err", err),
slog.String("errclass", errclass.New(err)),
slog.String("errClass", errclass.New(err)),
slog.String("localAddr", c.laddr),
slog.String("protocol", c.protocol),
slog.String("remoteAddr", c.raddr),
Expand Down Expand Up @@ -183,7 +183,7 @@ func (c *connWrapper) Write(data []byte) (n int, err error) {
"writeDone",
slog.Int("ioBytesCount", count),
slog.Any("err", err),
slog.String("errclass", errclass.New(err)),
slog.String("errClass", errclass.New(err)),
slog.String("localAddr", c.laddr),
slog.String("protocol", c.protocol),
slog.String("remoteAddr", c.raddr),
Expand Down
2 changes: 1 addition & 1 deletion netcore/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (nx *Network) emitConnectDone(ctx context.Context,
ctx,
"connectDone",
slog.Any("err", err),
slog.String("errclass", errclass.New(err)),
slog.String("errClass", errclass.New(err)),
slog.String("localAddr", connLocalAddr(conn).String()),
slog.String("protocol", network),
slog.String("remoteAddr", address),
Expand Down
2 changes: 1 addition & 1 deletion netcore/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (nx *Network) emitLookupHostDone(ctx context.Context,
slog.String("dnsLookupDomain", domain),
slog.Any("dnsResolvedAddrs", addrs),
slog.Any("err", err),
slog.String("errclass", errclass.New(err)),
slog.String("errClass", errclass.New(err)),
slog.Time("t0", t0),
slog.Time("t", nx.timeNow()),
)
Expand Down
2 changes: 1 addition & 1 deletion netcore/tlsdialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (td *tlsDialer) emitTLSHandshakeDone(ctx context.Context,
ctx,
"tlsHandshakeDone",
slog.Any("err", err),
slog.String("errclass", errclass.New(err)),
slog.String("errClass", errclass.New(err)),
slog.String("localAddr", localAddr),
slog.String("protocol", network),
slog.String("remoteAddr", remoteAddr),
Expand Down

0 comments on commit 1ae0b6a

Please sign in to comment.