Skip to content

Commit eeddb98

Browse files
committed
all: initial commit
0 parents  commit eeddb98

File tree

24 files changed

+2000
-0
lines changed

24 files changed

+2000
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: joshuasing

.github/workflows/go.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright (c) 2025 Joshua Sing <joshua@joshuasing.dev>
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
# GitHub Actions workflow to build and test.
22+
name: "Go"
23+
24+
on:
25+
push:
26+
branches: [ "main" ]
27+
pull_request:
28+
branches: [ "main" ]
29+
30+
env:
31+
GO_VERSION: "1.24.x"
32+
33+
jobs:
34+
vulncheck:
35+
name: "Vulnerability Check"
36+
runs-on: "ubuntu-latest"
37+
permissions:
38+
contents: read
39+
steps:
40+
- name: "Checkout repository"
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42+
43+
- name: "Setup Go ${{ env.GO_VERSION }}"
44+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
45+
with:
46+
go-version: "${{ env.GO_VERSION }}"
47+
cache: true
48+
check-latest: true
49+
50+
- name: "Install govulncheck"
51+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
52+
53+
- name: "Run govulncheck"
54+
run: govulncheck ./...
55+
56+
build:
57+
name: "Build (${{ matrix.os }})"
58+
runs-on: "${{ matrix.os }}"
59+
permissions:
60+
contents: read
61+
strategy:
62+
matrix:
63+
os: ["ubuntu-latest"]
64+
steps:
65+
- name: "Checkout repository"
66+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67+
68+
- name: "Setup Go ${{ env.GO_VERSION }}"
69+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
70+
with:
71+
go-version: "${{ env.GO_VERSION }}"
72+
cache: true
73+
check-latest: true
74+
75+
- name: "Download dependencies"
76+
run: go mod download
77+
78+
- name: "Verify dependencies"
79+
run: go mod verify
80+
81+
- name: "Build"
82+
run: go build ./...
83+
84+
- name: "Test"
85+
run: go test ./...
86+
87+
lint:
88+
name: "Lint"
89+
runs-on: "ubuntu-latest"
90+
permissions:
91+
contents: read
92+
steps:
93+
- name: "Checkout repository"
94+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95+
with:
96+
fetch-depth: 0
97+
98+
- name: "Setup Go ${{ env.GO_VERSION }}"
99+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
100+
with:
101+
go-version: "${{ env.GO_VERSION }}"
102+
cache: true
103+
check-latest: true
104+
105+
- name: "Run golangci-lint"
106+
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Project
2+
_bench/
3+
bin/
4+
dist/
5+
6+
# Common editors
7+
.idea/
8+
*.iml
9+
.vscode/

.golangci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
linters:
2+
enable:
3+
- "bodyclose"
4+
- "copyloopvar"
5+
- "errcheck"
6+
- "gci"
7+
- "gofumpt"
8+
- "goheader"
9+
- "gosec"
10+
- "gosimple"
11+
- "govet"
12+
- "ineffassign"
13+
- "nilerr"
14+
- "predeclared"
15+
- "revive"
16+
- "staticcheck"
17+
- "tparallel"
18+
- "unconvert"
19+
- "unused"
20+
- "unparam"
21+
- "whitespace"
22+
23+
linters-settings:
24+
# Enforces import order in Go source files
25+
gci:
26+
sections:
27+
- "standard"
28+
- "default"
29+
- "localmodule"
30+
custom-order: true

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Joshua Sing <joshua@joshuasing.dev>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) 2025 Joshua Sing <joshua@joshuasing.dev>
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
.PHONY: all
22+
all: lint build test
23+
24+
.PHONY: deps
25+
deps:
26+
go mod download
27+
go mod verify
28+
29+
.PHONY: lint
30+
lint: tidy
31+
golangci-lint run --fix ./...
32+
33+
.PHONY: lint-deps
34+
lint-deps:
35+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
36+
37+
.PHONY: tidy
38+
tidy:
39+
go mod tidy
40+
41+
.PHONY: build
42+
build:
43+
go build ./...
44+
go build -trimpath -ldflags '-s -w' -o ./bin/golicenser ./cmd/golicenser
45+
46+
.PHONY: test
47+
test:
48+
go test ./...
49+
50+
.PHONY: test-race
51+
test-race:
52+
go test -race ./...

0 commit comments

Comments
 (0)