Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigBalthazar committed Jan 12, 2025
1 parent 0fea0af commit f8dbf42
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/dezh-tech/panda/infrastructures/redis"
"github.com/dezh-tech/panda/pkg/logger"
"github.com/dezh-tech/panda/repositories"
domainService "github.com/dezh-tech/panda/services/domain"
domainService "github.com/dezh-tech/panda/services/domainservice"
)

type Daemon struct {
Expand Down
2 changes: 1 addition & 1 deletion deliveries/http/handlers/domain_handler/domain_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/dezh-tech/panda/pkg"
"github.com/dezh-tech/panda/pkg/validator"
domainService "github.com/dezh-tech/panda/services/domain"
domainService "github.com/dezh-tech/panda/services/domainservice"
"github.com/labstack/echo/v4"
)

Expand Down
2 changes: 1 addition & 1 deletion deliveries/http/handlers/domain_handler/domain_handler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package domainhandler

import domainService "github.com/dezh-tech/panda/services/domain"
import domainService "github.com/dezh-tech/panda/services/domainservice"

type Handler struct {
domainService domainService.DomainService
Expand Down
6 changes: 3 additions & 3 deletions deliveries/http/http_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package http

import (
domainhandler "github.com/dezh-tech/panda/deliveries/http/handlers/domain_handler"
_ "github.com/dezh-tech/panda/docs"
_ "github.com/dezh-tech/panda/docs" // revive:disable-line:blank-imports Justification: Required for Swagger documentation
"github.com/labstack/echo/v4"
echoSwagger "github.com/swaggo/echo-swagger"
)
Expand All @@ -22,11 +22,11 @@ import (
// @host localhost:8080
// @BasePath /

type HttpHandlers struct {
type Handlers struct {
user domainhandler.Handler
}

func (h *HttpHandlers) Start(r *echo.Echo) {
func (h *Handlers) Start(r *echo.Echo) {
h.user.SetRoutes(r)

r.GET("/swagger/*", echoSwagger.WrapHandler)
Expand Down
6 changes: 3 additions & 3 deletions deliveries/http/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import (
"fmt"

domainhandler "github.com/dezh-tech/panda/deliveries/http/handlers/domain_handler"
domainService "github.com/dezh-tech/panda/services/domain"
domainService "github.com/dezh-tech/panda/services/domainservice"
"github.com/labstack/echo/v4"
)

type Server struct {
Router *echo.Echo
config Config
handlers HttpHandlers
handlers Handlers
}

func New(config Config, userSvc domainService.DomainService) Server {
return Server{
Router: echo.New(),
config: config,

handlers: HttpHandlers{
handlers: Handlers{
user: domainhandler.New(userSvc),
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func registerTranslations() (error) {

// formatValidationErrors formats the validation errors for API responses.
func formatValidationErrors(errs validator.ValidationErrors) []*ValidationError {
var errors []*ValidationError
errors:= make([]*ValidationError,0)
for _, err := range errs {
errors = append(errors, &ValidationError{
Field: err.Field(),
Expand Down
2 changes: 1 addition & 1 deletion repositories/base_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *BaseRepository) InsertOne(ctx context.Context, document interface{}) (*
}

// FindByField finds a single document by a specific field and value.
func (r *BaseRepository) FindByField(ctx context.Context, field string, value interface{}, result interface{}) error {
func (r *BaseRepository) FindByField(ctx context.Context, field string, value, result interface{}) error {
collection := r.Client.Database(r.DBName).Collection(r.Collection)

ctx, cancel := context.WithTimeout(ctx, r.QueryTimeout)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package domainService
package domainservice

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package domainService
package domainservice

import "errors"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package domainService
package domainservice

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package domainService
package domainservice

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package domainService
package domainservice

type insertDomainValidation struct {

Check failure on line 3 in services/domainservice/domain_validator.go

View workflow job for this annotation

GitHub Actions / lint

type `insertDomainValidation` is unused (unused)
Domain string `validate:"required,url"`
Expand Down

0 comments on commit f8dbf42

Please sign in to comment.