Skip to content

Commit 09da321

Browse files
committed
Base structure
0 parents  commit 09da321

20 files changed

+4708
-0
lines changed

.github/workflows/ci.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on: [push]
2+
name: CI
3+
jobs:
4+
test:
5+
env:
6+
GOPATH: ${{ github.workspace }}
7+
8+
defaults:
9+
run:
10+
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
11+
12+
strategy:
13+
matrix:
14+
go-version: [1.18.x]
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Install Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
- name: Checkout Code
24+
uses: actions/checkout@v2
25+
with:
26+
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
27+
- name: Execute Tests
28+
run: |
29+
go mod download
30+
go mod verify
31+
make test

.github/workflows/golangci-lint.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: golangci-lint
2+
on: [push]
3+
permissions:
4+
contents: read
5+
jobs:
6+
golangci:
7+
name: lint
8+
strategy:
9+
matrix:
10+
go-version: [1.18.x]
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Install Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: ${{ matrix.go-version }}
17+
- name: Checkout Code
18+
uses: actions/checkout@v2
19+
- name: golangci-lint
20+
uses: golangci/golangci-lint-action@v2
21+
with:
22+
version: v1.50.1
23+
24+
# Optional: if set to true then the action will use pre-installed Go.
25+
skip-go-installation: true

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Binaries
2+
dist/
3+
4+
# Editors/IDEs
5+
*.swp
6+
*.swo
7+
*.vim
8+
.vscode/
9+
~
10+
11+
# Helm
12+
Chart.lock
13+
*.tgz
14+
15+
# App Specific
16+
config/config.toml
17+
*.log

.golangci.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
run:
2+
timeout: 5m
3+
modules-download-mode: readonly
4+
5+
linters-settings:
6+
gofmt:
7+
simplify: true
8+
govet:
9+
check-shadowing: false # set this to true from time to time to check for possible issues
10+
disable-all: true
11+
enable:
12+
- asmdecl # report mismatches between assembly files and Go declarations
13+
- assign # check for useless assignments
14+
- atomic # check for common mistakes using the sync/atomic package
15+
- bools # check for common mistakes involving boolean operators
16+
- buildtag # check that +build tags are well-formed and correctly located
17+
- cgocall # detect some violations of the cgo pointer passing rules
18+
- composites # check for unkeyed composite literals
19+
- copylocks # check for locks erroneously passed by value
20+
- errorsas # report passing non-pointer or non-error values to errors.As
21+
- httpresponse # check for mistakes using HTTP responses
22+
- loopclosure # check references to loop variables from within nested functions
23+
- lostcancel # check cancel func returned by context.WithCancel is called
24+
- nilfunc # check for useless comparisons between functions and nil
25+
- printf # check consistency of Printf format strings and arguments
26+
- shift # check for shifts that equal or exceed the width of the integer
27+
- stdmethods # check signature of methods of well-known interfaces
28+
- structtag # check that struct field tags conform to reflect.StructTag.Get
29+
- tests # check for common mistaken usages of tests and examples
30+
- unmarshal # report passing non-pointer or non-interface values to unmarshal
31+
- unreachable # check for unreachable code
32+
- unsafeptr # check for invalid conversions of uintptr to unsafe.Pointer
33+
- unusedresult # check for unused results of calls to some functions
34+
35+
linters:
36+
disable-all: true
37+
enable:
38+
- gofmt # Checks whether code was gofmt-ed
39+
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint
40+
- gosimple # Linter for Go source code that specializes in simplifying a code
41+
- govet # Examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
42+
- ineffassign # Detects when assignments to existing variables are not used
43+
- unconvert # Removes unnecessary type conversions
44+
- unused # Checks Go code for unused constants, variables, functions and types
45+
- exportloopref # Checks for pointers to enclosing loop variables
46+
- errcheck # Detects unchecked errors.
47+
48+
issues:
49+
exclude-rules:
50+
- linters:
51+
- unused
52+
text: "getConfiguration"

0 commit comments

Comments
 (0)