mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
delete duplicate import and use ST1019 in golangci-lint (#17211)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
This commit is contained in:
parent
e9855a88dd
commit
2fece8c9ea
@ -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
|
||||
@ -40,7 +44,7 @@ linters:
|
||||
# - rowserrcheck
|
||||
# - staticcheck
|
||||
- structcheck
|
||||
# - stylecheck
|
||||
- stylecheck
|
||||
# - unconvert
|
||||
# - unparam
|
||||
- unused
|
||||
|
@ -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"
|
||||
)
|
||||
@ -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)
|
||||
|
@ -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"
|
||||
)
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user