Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Mar 7, 2024
1 parent d06f545 commit 727d5d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416
github.com/prometheus/client_golang v1.18.0
github.com/stretchr/testify v1.8.4
github.com/tredeske/u v0.0.0-20240301202545-cc23fee03f7c
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.26.0
)
Expand Down
5 changes: 4 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2315,8 +2315,9 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E=
github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtTX406BpdQMqw=
github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ=
Expand Down Expand Up @@ -3462,6 +3463,8 @@ github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
github.com/trailofbits/go-mutexasserts v0.0.0-20200708152505-19999e7d3cef/go.mod h1:+SV/613m53DNAmlXPTWGZhIyt4E/qDvn9g/lOPRiy0A=
github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279/go.mod h1:GA3+Mq3kt3tYAfM0WZCu7ofy+GW9PuGysHfhr+6JX7s=
github.com/tredeske/u v0.0.0-20240301202545-cc23fee03f7c h1:x7NJo4wXqdtCdfEXLd42HunCXHy2b9/TeW7vM4W5G7Q=
github.com/tredeske/u v0.0.0-20240301202545-cc23fee03f7c/go.mod h1:/9Soq9m+Gmq7qhvNzdO/CjOFGol1MuZFvWY2iMHzsgw=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM=
github.com/twitchtv/twirp v7.1.0+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A=
Expand Down
6 changes: 3 additions & 3 deletions service/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/tredeske/u/ustrings"

"github.com/bnb-chain/bsc-mev-sentry/account"
"github.com/bnb-chain/bsc-mev-sentry/log"
"github.com/bnb-chain/bsc-mev-sentry/node"
"github.com/bnb-chain/bsc-mev-sentry/utils"
)

var (
Expand Down Expand Up @@ -198,11 +198,11 @@ func timeoutCancel(ctx *context.Context, timeout Duration) func() {
type Duration time.Duration

func (d Duration) MarshalText() ([]byte, error) {
return utils.UnsafeStringToBytes(time.Duration(d).String()), nil
return ustrings.UnsafeStringToBytes(time.Duration(d).String()), nil
}

func (d *Duration) UnmarshalText(text []byte) error {
dd, err := time.ParseDuration(utils.UnsafeBytesToString(text))
dd, err := time.ParseDuration(ustrings.UnsafeBytesToString(text))
*d = Duration(dd)
return err
}
23 changes: 0 additions & 23 deletions utils/string.go

This file was deleted.

0 comments on commit 727d5d8

Please sign in to comment.