Skip to content

Commit

Permalink
Add just lint recipe and fix some linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cluttrdev committed Oct 29, 2023
1 parent c4109e3 commit 9f0f202
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
3 changes: 0 additions & 3 deletions cmd/deduplicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
"io"
"strings"

"github.com/peterbourgon/ff/v3/ffcli"
Expand All @@ -16,10 +15,8 @@ import (

type DeduplicateConfig struct {
rootConfig *RootConfig
out io.Writer

database string
table string
final bool
by columnList
except columnList
Expand Down
4 changes: 3 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ func startServer(ctx context.Context, cfg config.Server, ctl *controller.Control
ReadinessCheck: func() error { return ctl.CheckReadiness(ctx) },
})

go srv.Serve(ctx)
if err := srv.Serve(ctx); err != nil {
log.Printf("error during server shutdown: %v\n", err)
}
}
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ default:
fmt:
go fmt ./...

lint:
golangci-lint run ./...

# vet code
vet:
go vet ./...
Expand Down
3 changes: 0 additions & 3 deletions pkg/models/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ func jobSpanAttributes(job *Job) map[string]string {
func sectionSpanAttributes(section *Section) map[string]string {
attr := map[string]string{}

if section != nil {
}

return attr
}

Expand Down
8 changes: 2 additions & 6 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ func (s *Server) Serve(ctx context.Context) error {
}
}()

select {
case <-ctx.Done():
srv.Shutdown(ctx)
}

return nil
<-ctx.Done()
return srv.Shutdown(ctx)
}
2 changes: 1 addition & 1 deletion pkg/tasks/deduplicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func DeduplicateTable(ctx context.Context, opt DeduplicateTableOptions, ch *clic

func PrepareDeduplicateQuery(opt DeduplicateTableOptions) (string, map[string]string) {
var (
query = ""
query string
params = map[string]string{}
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (w *worker) Done() <-chan struct{} {
return w.done
}

func newWorker(run func(context.Context)) Worker {
func NewWorker(run func(context.Context)) Worker {
return &worker{
done: make(chan struct{}),
run: run,
Expand Down

0 comments on commit 9f0f202

Please sign in to comment.