Skip to content

Commit

Permalink
fix(1315): update golangci-lint version for memory usage (#1316)
Browse files Browse the repository at this point in the history
* fix(1315): update golangci-lint version for memory usage

* fix lint errors

* update golangci-lint version in makefile

* remove unused fields with lint error
  • Loading branch information
supereagle authored and caicloud-bot committed Oct 31, 2019
1 parent 6a6acf9 commit 064d160
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ go_import_path: github.com/caicloud/cyclone
before_install:
- go get github.com/mattn/goveralls
- go get github.com/go-playground/overalls
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.20.1

install:
- go build -o cyclone-server github.com/caicloud/cyclone/cmd/server
Expand All @@ -25,7 +25,7 @@ install:

script:
- overalls -project=github.com/caicloud/cyclone -covermode=count -debug -ignore=Godeps,vendor,tests,.git,scripts,node_modules,docs,tools,build,hack,manifests,release,web,pkg/k8s,pkg/apis
- GOGC=5 golangci-lint run
- golangci-lint run

after_success:
- $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=overalls.coverprofile
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ lint: $(GOLANGCI_LINT)
build: build-local

$(GOLANGCI_LINT):
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.16.0
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.20.1

test:
@go test $$(go list ./... | grep -v /vendor | grep -v /test) -coverprofile=coverage.out
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/biz/integration/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ToSecret(tenant string, in *api.Integration) (*core_v1.Secret, error) {
if in.Spec.Type == api.Cluster && in.Spec.Cluster != nil {
if in.Spec.Cluster.IsWorkerCluster {
objectMeta.Labels = meta.AddSchedulableClusterLabel(objectMeta.Labels)
} else if _, ok := objectMeta.Labels[meta.LabelIntegrationSchedulableCluster]; ok {
} else {
delete(objectMeta.Labels, meta.LabelIntegrationSchedulableCluster)
}
}
Expand Down
22 changes: 10 additions & 12 deletions pkg/server/biz/scm/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,18 +331,16 @@ type MergeCommentEvent struct {
} `json:"project"`
//Repository *Repository `json:"repository"`
ObjectAttributes struct {
ID int `json:"id"`
Note string `json:"note"`
NoteableType string `json:"noteable_type"`
AuthorID int `json:"author_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ProjectID int `json:"project_id"`
Attachment string `json:"attachment"`
LineCode string `json:"line_code"`
CommitID string `json:"commit_id"`
NoteableID int `json:"noteable_id"`
System bool `json:"system"`
ID int `json:"id"`
Note string `json:"note"`
AuthorID int `json:"author_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ProjectID int `json:"project_id"`
Attachment string `json:"attachment"`
LineCode string `json:"line_code"`
CommitID string `json:"commit_id"`
System bool `json:"system"`
//StDiff *Diff `json:"st_diff"`
URL string `json:"url"`
} `json:"object_attributes"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/cerr/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var (

// ErrorCreateIntegrationFailed defines error that failed to create integration.
ErrorCreateIntegrationFailed = nerror.InternalServerError.Build(ReasonCreateIntegrationFailed,
"create integration ${name} failed: ${error}, please check your auth infomation")
"create integration ${name} failed: ${error}, please check your auth information")

// ErrorCreateWebhookPermissionDenied defines error that failed creating webhook as permission denied.
ErrorCreateWebhookPermissionDenied = nerror.InternalServerError.Build(ReasonCreateWebhookPermissionDenied,
Expand Down

0 comments on commit 064d160

Please sign in to comment.