Skip to content

Commit

Permalink
go lint check.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrews Arokiam <[email protected]>
  • Loading branch information
andyi2it committed Dec 13, 2023
1 parent c1c5efe commit bfa98a2
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: GO Lint Check

on:
push:
branches: [master, release*]
pull_request:
branches: []
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Check out code
uses: actions/checkout@v2

- id: golangci_configuration
uses: andstor/file-existence-action@v1
with:
files: .golangci.yaml # file must be required for linter configuration

- name: Go Lint
if: steps.golangci_configuration.outputs.files_exists == 'true'
uses: golangci/golangci-lint-action@v3
with:
# only-new-issues: true
version: v1.55.2
args: --go=1.21
23 changes: 23 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
run:
timeout: 5m

linters:
disable-all: true
enable:
- asciicheck
- errorlint
- gosec
- importas
- prealloc
- unconvert
- stylecheck
- unparam
- errcheck

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
uniq-by-line: false
path-prefix: ""
sort-results: true
4 changes: 2 additions & 2 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ var (

const (
// reportingPeriod is the interval of time between reporting stats by queue proxy.
reportingPeriod = 1 * time.Second
reportingPeriod = 1 * time.Second

// Duration the /wait-for-drain handler should wait before returning.
// This is to give networking a little bit more time to remove the pod
// from its configuration and propagate that to all loadbalancers and nodes.
drainSleepDuration = 30 * time.Second
drainSleepDuration = 30 * time.Second
)

type config struct {
Expand Down

0 comments on commit bfa98a2

Please sign in to comment.