Skip to content

Commit

Permalink
ci(master): add golint makefile (openyurtio#662)
Browse files Browse the repository at this point in the history
* ci(master): add golint makefile

* ci(master): add golint makefile
  • Loading branch information
cuisongliu authored Dec 8, 2021
1 parent 6143dbc commit bbe7526
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,18 @@ manifest:

# push generated manifest during 'make manifest'
push_manifest:
bash hack/make-rules/push-manifest.sh
bash hack/make-rules/push-manifest.sh

install-golint: ## check golint if not exist install golint tools
ifeq (, $(shell which golangci-lint))
@{ \
set -e ;\
o install github.com/golangci/golangci-lint/cmd/[email protected] ;\
}
GOLINT_BIN=$(GOBIN)/golangci-lint
else
GOLINT_BIN=$(shell which golangci-lint)
endif

lint: install-golint ## Run go lint against code.
$(GOLINT_BIN) run --disable-all -E deadcode -E gofmt -E goimports -E ineffassign -E misspell -E vet --timeout=15m
35 changes: 35 additions & 0 deletions pkg/util/iptables/iptables_unsupported_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Copyright 2021 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package iptables

import (
"testing"
)

func Test_grabIptablesFileLock(t *testing.T) {
err := grabIptablesFileLock(nil)
if err != nil {
t.Log(err.Error())
}
}

func Test_grabIptablesLocks(t *testing.T) {
err := grabIptablesFileLock(nil)
if err != nil {
t.Log(err.Error())
}
}

0 comments on commit bbe7526

Please sign in to comment.