-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 897bc1d
Showing
46 changed files
with
6,749 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: ['v*.*.*'] | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gtc.log | ||
gtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
run: | ||
go: '1.19' | ||
timeout: 30m | ||
skip-dirs: | ||
- .cache | ||
- gocui | ||
skip-files: | ||
- ".*pb\\.go" | ||
tests: false | ||
|
||
issues: | ||
max-same-issues: 200 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# 必须 | ||
- errcheck | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- bodyclose | ||
- durationcheck | ||
- exportloopref | ||
- gomodguard | ||
- depguard | ||
- gosec | ||
|
||
# 建议 | ||
- gosimple | ||
- decorder | ||
- dogsled | ||
- errchkjson | ||
- errorlint | ||
- goprintffuncname | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nestif | ||
- nilerr # 后期建议放入,所有err均需要有处理 | ||
- nilnil | ||
- noctx | ||
- unconvert | ||
linters-settings: | ||
gosec: | ||
excludes: | ||
- G401 | ||
- G505 | ||
- G501 | ||
- G402 | ||
- G204 | ||
- G101 | ||
- G107 | ||
- G114 | ||
|
||
gosimple: | ||
go: "1.19" | ||
checks: ["all", "-SA1019", "-S1039", "-S1025", "-S1008"] | ||
staticcheck: | ||
go: "1.19" | ||
checks: ["all", "-SA5008", "-SA9003", "-SA1029", "-SA4006"] | ||
errcheck: | ||
check-type-assertions: true | ||
check-blank: false | ||
revie: | ||
enable-all-rules: true | ||
ignore-generated-header: true | ||
rules: | ||
- name: var-naming | ||
disabled: true | ||
govet: | ||
disable-all: true | ||
enable: | ||
- asmdecl | ||
- assign | ||
- atomic | ||
- atomicalign | ||
- bools | ||
- buildtag | ||
- cgocall | ||
- composites | ||
- copylocks | ||
- deepequalerrors | ||
- errorsas | ||
- findcall | ||
- framepointer | ||
- httpresponse | ||
- ifaceassert | ||
- loopclosure | ||
- lostcancel | ||
- nilfunc | ||
- nilness | ||
- printf | ||
- reflectvaluecompare | ||
# - shadow | ||
- shift | ||
- sigchanyzer | ||
- sortslice | ||
- stdmethods | ||
- stringintconv | ||
- structtag | ||
- testinggoroutine | ||
- tests | ||
- unmarshal | ||
- unreachable | ||
- unsafeptr | ||
- unusedresult | ||
# - unusedwrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
project_name: gtc | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
- go generate ./... | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w -X main.Version={{ .Version }} | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
|
||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
format: tar.gz | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
snapshot: | ||
name_template: '{{ incpatch .Version }}' | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^ci:' | ||
|
||
dockers: | ||
- image_templates: | ||
- 'neosu/{{ .ProjectName }}:{{ .Version }}' | ||
- 'neosu/{{ .ProjectName }}:latest' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM alpine | ||
|
||
WORKDIR /app | ||
COPY gtc /app/gtc | ||
|
||
CMD ["/app/gtc"] |
Oops, something went wrong.