Skip to content

Commit b66546c

Browse files
committed
gomod, adding github workflows
1 parent fe436af commit b66546c

File tree

4 files changed

+72
-3
lines changed

4 files changed

+72
-3
lines changed

.github/workflows/build.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and Lint
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.21.3'
19+
20+
- name: Build
21+
run: go build -v ./...
22+
23+
- name: golangci-lint
24+
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v3
25+
with:
26+
args: --timeout=5m
27+
version: v1.56.2

.golangci.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
run:
2+
go: "1.22"
3+
timeout: 5m
4+
linters:
5+
enable:
6+
- thelper
7+
- gofumpt
8+
- tparallel
9+
- unconvert
10+
- unparam
11+
- wastedassign
12+
- revive
13+
- forbidigo
14+
- tagliatelle
15+
- misspell
16+
- depguard
17+
- testifylint
18+
- gocritic
19+
linters-settings:
20+
staticcheck:
21+
checks:
22+
- all
23+
- "-SA1019"
24+
forbidigo:
25+
forbid:
26+
- 'ioutil\.*'
27+
tagliatelle:
28+
case:
29+
use-field-name: false
30+
rules:
31+
yaml: snake
32+
json: snake
33+
depguard:
34+
rules:
35+
main:
36+
deny:
37+
- pkg: "github.com/pkg/errors"
38+
desc: "use stdlib instead"
39+
gocritic:
40+
enabled-checks:
41+
- exitAfterDefer
42+
testifylint:
43+
enable-all: true
44+
disable:
45+
- error-is-as # false positive

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ go 1.21.3
55
require (
66
github.com/briandowns/spinner v1.23.0
77
github.com/google/generative-ai-go v0.10.0
8-
github.com/joho/godotenv v1.5.1
98
github.com/spf13/cobra v1.8.0
109
google.golang.org/api v0.149.0
1110
)

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56
6262
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
6363
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
6464
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
65-
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
66-
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
6765
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
6866
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
6967
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=

0 commit comments

Comments
 (0)