Skip to content

Commit

Permalink
fix: update lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-brito committed Mar 18, 2024
1 parent 6b732a7 commit 078cbde
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generate:
go generate ./...
lint:
golangci-lint run
golangci-lint run --fix
test:
go test -race -cover ./...
release:
Expand Down
2 changes: 1 addition & 1 deletion exchange/binance.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func WithMetadataFetcher(fetcher MetadataFetchers) BinanceOption {

// WithTestNet activate Bianance testnet
func WithTestNet() BinanceOption {
return func(b *Binance) {
return func(_ *Binance) {
binance.UseTestnet = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion ninjabot.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func WithStorage(storage storage.Storage) Option {

// WithLogLevel sets the log level. eg: log.DebugLevel, log.InfoLevel, log.WarnLevel, log.ErrorLevel, log.FatalLevel
func WithLogLevel(level log.Level) Option {
return func(bot *NinjaBot) {
return func(_ *NinjaBot) {
log.SetLevel(level)
}
}
Expand Down
5 changes: 3 additions & 2 deletions order/feed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package order
import (
"testing"

"github.com/rodrigo-brito/ninjabot/model"
"github.com/stretchr/testify/require"

"github.com/rodrigo-brito/ninjabot/model"
)

func TestFeed_NewOrderFeed(t *testing.T) {
Expand All @@ -16,7 +17,7 @@ func TestFeed_Subscribe(t *testing.T) {
feed, pair := NewOrderFeed(), "blaus"
called := make(chan bool, 1)

feed.Subscribe(pair, func(order model.Order) {
feed.Subscribe(pair, func(_ model.Order) {
called <- true
}, false)

Expand Down
2 changes: 1 addition & 1 deletion plot/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (c *Chart) Start() error {
http.FileServer(http.FS(staticFiles)),
)

http.HandleFunc("/assets/chart.js", func(w http.ResponseWriter, req *http.Request) {
http.HandleFunc("/assets/chart.js", func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-type", "application/javascript")
fmt.Fprint(w, c.scriptContent)
})
Expand Down
5 changes: 3 additions & 2 deletions storage/buntdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"strconv"
"sync/atomic"

"github.com/rodrigo-brito/ninjabot/model"
"github.com/tidwall/buntdb"

"github.com/rodrigo-brito/ninjabot/model"
)

type Bunt struct {
Expand Down Expand Up @@ -73,7 +74,7 @@ func (b Bunt) UpdateOrder(order *model.Order) error {
func (b Bunt) Orders(filters ...OrderFilter) ([]*model.Order, error) {
orders := make([]*model.Order, 0)
err := b.db.View(func(tx *buntdb.Tx) error {
err := tx.Ascend("update_index", func(key, value string) bool {
err := tx.Ascend("update_index", func(_, value string) bool {
var order model.Order
err := json.Unmarshal([]byte(value), &order)
if err != nil {
Expand Down

0 comments on commit 078cbde

Please sign in to comment.