Skip to content

Commit 12d1f39

Browse files
committed
Initial commit
0 parents  commit 12d1f39

File tree

97 files changed

+13088
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+13088
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
insert_final_newline = true
8+
max_line_length = 160
9+
tab_width = 4
10+
trim_trailing_whitespace = true
11+
12+
[Makefile]
13+
indent_style = space
14+
15+
[*.feature]
16+
indent_style = space

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gomod"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"

.github/workflows/golangci-lint.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
jobs:
11+
golangci:
12+
name: golangci-lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: golangci-lint
17+
uses: golangci/[email protected]
18+
with:
19+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
20+
version: v1.43.0
21+
22+
# Optional: working directory, useful for monorepos
23+
# working-directory: somedir
24+
25+
# Optional: golangci-lint command line arguments.
26+
# args: --issues-exit-code=0
27+
28+
# Optional: show only new issues if it's a pull request. The default value is `false`.
29+
# only-new-issues: true
30+
31+
# Optional: if set to true then the action will use pre-installed Go.
32+
# skip-go-installation: true
33+
34+
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
35+
# skip-pkg-cache: true
36+
37+
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
38+
# skip-build-cache: true

.github/workflows/unit-test.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
env:
10+
GO111MODULE: "on"
11+
GO_LATEST_VERSION: "1.17.x"
12+
13+
jobs:
14+
unit-test:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ ubuntu-latest, macos-latest, windows-latest ]
19+
go-version: [ 1.16.x, 1.17.x ]
20+
arch: ["386", amd64]
21+
exclude:
22+
- os: macos-latest
23+
arch: "386"
24+
runs-on: ${{ matrix.os }}
25+
steps:
26+
- name: Install Go
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: ${{ matrix.go-version }}
30+
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
- name: Go cache
35+
uses: actions/cache@v2
36+
with:
37+
# In order:
38+
# * Module download cache
39+
# * Build cache (Linux)
40+
path: |
41+
~/go/pkg/mod
42+
~/.cache/go-build
43+
key: ${{ runner.os }}-go-${{ matrix.go-version }}-cache-${{ hashFiles('**/go.sum') }}
44+
restore-keys: |
45+
${{ runner.os }}-go-${{ matrix.go-version }}-cache
46+
47+
- name: Test
48+
id: test
49+
env:
50+
GOARCH: ${{ matrix.arch }}
51+
run: |
52+
make test
53+
54+
- name: Upload code coverage (unit)
55+
if: matrix.go-version == env.GO_LATEST_VERSION
56+
uses: codecov/codecov-action@v2
57+
with:
58+
files: ./unit.coverprofile
59+
flags: unittests-${{ runner.os }}-${{ runner.arch }}
60+
61+
# - name: Upload code coverage (features)
62+
# if: matrix.go-version == env.GO_LATEST_VERSION
63+
# uses: codecov/codecov-action@v1
64+
# with:
65+
# file: ./features.coverprofile
66+
# flags: featurestests-${{ runner.os }}

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
/vendor
16+
17+
*.coverprofile

.golangci.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
2+
run:
3+
tests: true
4+
5+
linters-settings:
6+
errcheck:
7+
check-type-assertions: true
8+
check-blank: true
9+
gocyclo:
10+
min-complexity: 20
11+
dupl:
12+
threshold: 100
13+
misspell:
14+
locale: US
15+
unused:
16+
check-exported: false
17+
unparam:
18+
check-exported: true
19+
20+
linters:
21+
enable-all: true
22+
disable:
23+
- contextcheck
24+
- exhaustivestruct
25+
- forbidigo
26+
- forcetypeassert
27+
- gci
28+
- gochecknoglobals
29+
- golint
30+
- gomnd
31+
- goerr113
32+
- ifshort
33+
- interfacer
34+
- ireturn
35+
- lll
36+
- maligned
37+
- paralleltest
38+
- scopelint
39+
- tagliatelle
40+
- testpackage
41+
- wrapcheck
42+
- varnamelen
43+
44+
issues:
45+
exclude-use-default: false
46+
exclude-rules:
47+
- linters:
48+
- dupl
49+
- funlen
50+
- goconst
51+
- goerr113
52+
- gomnd
53+
- noctx
54+
- rowserrcheck
55+
path: "_test.go"

0 commit comments

Comments
 (0)