Skip to content

Commit

Permalink
delete duplicate import and use ST1019 in golangci-lint (#17211)
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
  • Loading branch information
Abirdcfly committed Jul 25, 2022
1 parent e9855a8 commit 2fece8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ linters-settings:
locale: US,UK
goimports:
local-prefixes: github.com/goharbor/harbor
stylecheck:
checks: [
"ST1019", # Importing the same package multiple times.
]

linters:
disable-all: true
Expand Down Expand Up @@ -40,7 +44,7 @@ linters:
# - rowserrcheck
# - staticcheck
- structcheck
# - stylecheck
- stylecheck
# - unconvert
# - unparam
- unused
Expand Down
3 changes: 1 addition & 2 deletions src/controller/event/handler/webhook/artifact/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/goharbor/harbor/src/lib/orm"
"github.com/goharbor/harbor/src/pkg"
"github.com/goharbor/harbor/src/pkg/notification"
"github.com/goharbor/harbor/src/pkg/notifier/model"
notifyModel "github.com/goharbor/harbor/src/pkg/notifier/model"
proModels "github.com/goharbor/harbor/src/pkg/project/models"
)
Expand Down Expand Up @@ -91,7 +90,7 @@ func (a *Handler) handle(ctx context.Context, event *event.ArtifactEvent) error
return nil
}

func (a *Handler) constructArtifactPayload(event *event.ArtifactEvent, project *proModels.Project) (*model.Payload, error) {
func (a *Handler) constructArtifactPayload(event *event.ArtifactEvent, project *proModels.Project) (*notifyModel.Payload, error) {
repoName := event.Repository
if repoName == "" {
return nil, fmt.Errorf("invalid %s event with empty repo name", event.EventType)
Expand Down
3 changes: 1 addition & 2 deletions src/controller/event/handler/webhook/quota/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/goharbor/harbor/src/lib/log"
"github.com/goharbor/harbor/src/lib/orm"
"github.com/goharbor/harbor/src/pkg/notification"
"github.com/goharbor/harbor/src/pkg/notifier/model"
notifyModel "github.com/goharbor/harbor/src/pkg/notifier/model"
proModels "github.com/goharbor/harbor/src/pkg/project/models"
)
Expand Down Expand Up @@ -82,7 +81,7 @@ func (qp *Handler) IsStateful() bool {
return false
}

func constructQuotaPayload(event *event.QuotaEvent) (*model.Payload, error) {
func constructQuotaPayload(event *event.QuotaEvent) (*notifyModel.Payload, error) {
repoName := event.RepoName
if repoName == "" {
return nil, fmt.Errorf("invalid %s event with empty repo name", event.EventType)
Expand Down

0 comments on commit 2fece8c

Please sign in to comment.