From 0ad77d50cbbdfb7dc28d9bb775931124e1bda8ae Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Tue, 16 Jan 2024 01:34:07 +0700 Subject: [PATCH] chore(lint): run golangci-lint --fix (#105) --- internal/config/client/client.go | 3 ++- internal/datautils/map.go | 7 ++++--- internal/logger/stderr.go | 3 ++- internal/taskqueue/rabbitmq/rabbitmq.go | 5 +++-- internal/validator/default.go | 1 + internal/validator/validator.go | 1 + pkg/client/admin.go | 7 ++++--- pkg/client/client.go | 7 ++++--- pkg/client/dispatcher.go | 5 +++-- pkg/client/event.go | 5 +++-- pkg/integrations/shared/webhookutils/decoder.go | 1 + pkg/integrations/shared/webhookutils/decoder_validator.go | 3 ++- pkg/integrations/shared/webhookutils/errors.go | 3 ++- pkg/integrations/shared/webhookutils/url_param.go | 1 + pkg/integrations/shared/webhookutils/writer.go | 3 ++- pkg/integrations/slack/slack.go | 3 ++- pkg/worker/worker.go | 3 ++- 17 files changed, 39 insertions(+), 22 deletions(-) diff --git a/internal/config/client/client.go b/internal/config/client/client.go index 74393480a..3cac8bb24 100644 --- a/internal/config/client/client.go +++ b/internal/config/client/client.go @@ -3,8 +3,9 @@ package client import ( "crypto/tls" - "github.com/hatchet-dev/hatchet/internal/config/shared" "github.com/spf13/viper" + + "github.com/hatchet-dev/hatchet/internal/config/shared" ) type ClientConfigFile struct { diff --git a/internal/datautils/map.go b/internal/datautils/map.go index 5f464ad85..d2bce8c96 100644 --- a/internal/datautils/map.go +++ b/internal/datautils/map.go @@ -5,12 +5,13 @@ import ( "fmt" "strconv" - "github.com/hatchet-dev/hatchet/internal/logger" - "github.com/hatchet-dev/hatchet/internal/validator" - "github.com/hatchet-dev/hatchet/pkg/errors" "github.com/mitchellh/mapstructure" "github.com/rs/zerolog" "github.com/steebchen/prisma-client-go/runtime/types" + + "github.com/hatchet-dev/hatchet/internal/logger" + "github.com/hatchet-dev/hatchet/internal/validator" + "github.com/hatchet-dev/hatchet/pkg/errors" ) func ToJSONMap(data interface{}) (map[string]interface{}, error) { diff --git a/internal/logger/stderr.go b/internal/logger/stderr.go index 4344d7aa9..984c9add9 100644 --- a/internal/logger/stderr.go +++ b/internal/logger/stderr.go @@ -5,8 +5,9 @@ import ( "os" "time" - "github.com/hatchet-dev/hatchet/internal/config/shared" "github.com/rs/zerolog" + + "github.com/hatchet-dev/hatchet/internal/config/shared" ) func NewDefaultLogger(service string) zerolog.Logger { diff --git a/internal/taskqueue/rabbitmq/rabbitmq.go b/internal/taskqueue/rabbitmq/rabbitmq.go index 8324f6329..59dd30d99 100644 --- a/internal/taskqueue/rabbitmq/rabbitmq.go +++ b/internal/taskqueue/rabbitmq/rabbitmq.go @@ -8,10 +8,11 @@ import ( "os" "time" - "github.com/hatchet-dev/hatchet/internal/logger" - "github.com/hatchet-dev/hatchet/internal/taskqueue" amqp "github.com/rabbitmq/amqp091-go" "github.com/rs/zerolog" + + "github.com/hatchet-dev/hatchet/internal/logger" + "github.com/hatchet-dev/hatchet/internal/taskqueue" ) // session composes an amqp.Connection with an amqp.Channel diff --git a/internal/validator/default.go b/internal/validator/default.go index 474cf8355..b1fb26291 100644 --- a/internal/validator/default.go +++ b/internal/validator/default.go @@ -6,6 +6,7 @@ import ( v10Validator "github.com/go-playground/validator/v10" "github.com/hashicorp/go-multierror" + "github.com/hatchet-dev/hatchet/api/v1/server/oas/gen" "github.com/hatchet-dev/hatchet/pkg/errors" ) diff --git a/internal/validator/validator.go b/internal/validator/validator.go index 095a62710..f69944d48 100644 --- a/internal/validator/validator.go +++ b/internal/validator/validator.go @@ -7,6 +7,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/go-playground/validator/v10" "github.com/google/uuid" + "github.com/hatchet-dev/hatchet/pkg/client/types" ) diff --git a/pkg/client/admin.go b/pkg/client/admin.go index 84ccd0d4e..d9c77f44e 100644 --- a/pkg/client/admin.go +++ b/pkg/client/admin.go @@ -7,14 +7,15 @@ import ( "time" "github.com/Masterminds/semver/v3" - admincontracts "github.com/hatchet-dev/hatchet/internal/services/admin/contracts" - "github.com/hatchet-dev/hatchet/internal/validator" - "github.com/hatchet-dev/hatchet/pkg/client/types" "github.com/rs/zerolog" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" + + admincontracts "github.com/hatchet-dev/hatchet/internal/services/admin/contracts" + "github.com/hatchet-dev/hatchet/internal/validator" + "github.com/hatchet-dev/hatchet/pkg/client/types" ) type AdminClient interface { diff --git a/pkg/client/client.go b/pkg/client/client.go index 30c51057a..61ec11345 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -4,13 +4,14 @@ import ( "crypto/tls" "fmt" + "github.com/rs/zerolog" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "github.com/hatchet-dev/hatchet/internal/logger" "github.com/hatchet-dev/hatchet/internal/validator" "github.com/hatchet-dev/hatchet/pkg/client/loader" "github.com/hatchet-dev/hatchet/pkg/client/types" - "github.com/rs/zerolog" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" ) type Client interface { diff --git a/pkg/client/dispatcher.go b/pkg/client/dispatcher.go index 188b6cf98..64c06063b 100644 --- a/pkg/client/dispatcher.go +++ b/pkg/client/dispatcher.go @@ -9,13 +9,14 @@ import ( "strconv" "time" - dispatchercontracts "github.com/hatchet-dev/hatchet/internal/services/dispatcher/contracts" - "github.com/hatchet-dev/hatchet/internal/validator" "github.com/rs/zerolog" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" + + dispatchercontracts "github.com/hatchet-dev/hatchet/internal/services/dispatcher/contracts" + "github.com/hatchet-dev/hatchet/internal/validator" ) type DispatcherClient interface { diff --git a/pkg/client/event.go b/pkg/client/event.go index 4a6f38505..d476c0ddb 100644 --- a/pkg/client/event.go +++ b/pkg/client/event.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" - eventcontracts "github.com/hatchet-dev/hatchet/internal/services/ingestor/contracts" - "github.com/hatchet-dev/hatchet/internal/validator" "github.com/rs/zerolog" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/timestamppb" + + eventcontracts "github.com/hatchet-dev/hatchet/internal/services/ingestor/contracts" + "github.com/hatchet-dev/hatchet/internal/validator" ) type EventClient interface { diff --git a/pkg/integrations/shared/webhookutils/decoder.go b/pkg/integrations/shared/webhookutils/decoder.go index 012c06e12..159659185 100644 --- a/pkg/integrations/shared/webhookutils/decoder.go +++ b/pkg/integrations/shared/webhookutils/decoder.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gorilla/schema" + hatcheterrors "github.com/hatchet-dev/hatchet/pkg/errors" ) diff --git a/pkg/integrations/shared/webhookutils/decoder_validator.go b/pkg/integrations/shared/webhookutils/decoder_validator.go index 315e88d69..33a9ee2fb 100644 --- a/pkg/integrations/shared/webhookutils/decoder_validator.go +++ b/pkg/integrations/shared/webhookutils/decoder_validator.go @@ -4,9 +4,10 @@ import ( "fmt" "net/http" + "github.com/rs/zerolog" + "github.com/hatchet-dev/hatchet/internal/validator" "github.com/hatchet-dev/hatchet/pkg/errors" - "github.com/rs/zerolog" ) type RequestDecoderValidator interface { diff --git a/pkg/integrations/shared/webhookutils/errors.go b/pkg/integrations/shared/webhookutils/errors.go index f55fcce1f..6e80c717e 100644 --- a/pkg/integrations/shared/webhookutils/errors.go +++ b/pkg/integrations/shared/webhookutils/errors.go @@ -5,8 +5,9 @@ import ( "errors" "net/http" - hatcheterrors "github.com/hatchet-dev/hatchet/pkg/errors" "github.com/rs/zerolog" + + hatcheterrors "github.com/hatchet-dev/hatchet/pkg/errors" ) type ErrorOpts struct { diff --git a/pkg/integrations/shared/webhookutils/url_param.go b/pkg/integrations/shared/webhookutils/url_param.go index 24ae010df..c8e138132 100644 --- a/pkg/integrations/shared/webhookutils/url_param.go +++ b/pkg/integrations/shared/webhookutils/url_param.go @@ -6,6 +6,7 @@ import ( "strconv" "github.com/go-chi/chi" + "github.com/hatchet-dev/hatchet/pkg/errors" ) diff --git a/pkg/integrations/shared/webhookutils/writer.go b/pkg/integrations/shared/webhookutils/writer.go index f4b1b7937..a87a232ec 100644 --- a/pkg/integrations/shared/webhookutils/writer.go +++ b/pkg/integrations/shared/webhookutils/writer.go @@ -6,8 +6,9 @@ import ( "net/http" "syscall" - hatcheterrors "github.com/hatchet-dev/hatchet/pkg/errors" "github.com/rs/zerolog" + + hatcheterrors "github.com/hatchet-dev/hatchet/pkg/errors" ) type ResultWriter interface { diff --git a/pkg/integrations/slack/slack.go b/pkg/integrations/slack/slack.go index d3391a2d1..330e3cd2d 100644 --- a/pkg/integrations/slack/slack.go +++ b/pkg/integrations/slack/slack.go @@ -4,8 +4,9 @@ import ( "context" "fmt" - "github.com/hatchet-dev/hatchet/pkg/integrations" "github.com/slack-go/slack" + + "github.com/hatchet-dev/hatchet/pkg/integrations" ) type SlackIntegration struct { diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go index d9c3acc85..d36d2a752 100644 --- a/pkg/worker/worker.go +++ b/pkg/worker/worker.go @@ -9,12 +9,13 @@ import ( "sync" "time" + "github.com/rs/zerolog" + "github.com/hatchet-dev/hatchet/internal/logger" "github.com/hatchet-dev/hatchet/pkg/client" "github.com/hatchet-dev/hatchet/pkg/client/types" "github.com/hatchet-dev/hatchet/pkg/errors" "github.com/hatchet-dev/hatchet/pkg/integrations" - "github.com/rs/zerolog" ) type actionFunc func(args ...any) []any