Skip to content

Commit a45d07a

Browse files
committed
minor changes
2 parents cfb7be8 + b9f8ec1 commit a45d07a

Some content is hidden

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

54 files changed

+3610
-1558
lines changed

β€Ž.github/workflows/gitleaks.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: gitleaks
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515
with:
1616
fetch-depth: 0 # fetch all history so multiple commits can be scanned
1717
- uses: gitleaks/gitleaks-action@v2

β€Ž.github/workflows/go.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
build-and-test:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818

1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: '1.23.3'
22+
go-version-file: 'go.mod'
2323
cache: true
2424

2525
- name: Verify dependencies

β€Ž.github/workflows/golangci-lint.ymlβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: true
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
2121
- uses: actions/setup-go@v5
2222
with:
23-
go-version: v1.22
23+
go-version-file: 'go.mod'
2424
- name: golangci-lint
25-
uses: golangci/golangci-lint-action@v6
25+
uses: golangci/golangci-lint-action@v8
2626
with:
27-
version: v1.60
27+
version: v2.3.1

β€Ž.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
22
.vscode
3+
.DS_Store

β€Ž.golangci.v1.ymlβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
run:
2+
timeout: 5m
3+
4+
linters:
5+
disable-all: true
6+
enable:
7+
- govet
8+
- staticcheck
9+
- errcheck
10+
- goimports
11+
- gofmt
12+
- nlreturn
13+
- gosec
14+
issues:
15+
exclude-rules:
16+
# Exclude some linters from running on tests files.
17+
- path: _test\.go
18+
linters:
19+
- nlreturn

β€Ž.golangci.ymlβ€Ž

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
1-
run:
2-
timeout: 5m
3-
1+
version: "2"
42
linters:
5-
disable-all: true
3+
default: none
64
enable:
7-
- govet
8-
- staticcheck
95
- errcheck
10-
- goimports
11-
- gofmt
12-
- nlreturn
136
- gosec
14-
issues:
15-
exclude-rules:
16-
# Exclude some linters from running on tests files.
17-
- path: _test\.go
18-
linters:
7+
- govet
8+
- nlreturn
9+
- staticcheck
10+
exclusions:
11+
generated: strict
12+
presets:
13+
- comments
14+
- common-false-positives
15+
- legacy
16+
- std-error-handling
17+
rules:
18+
- linters:
1919
- nlreturn
20+
path: _test\.go
21+
paths:
22+
- third_party$
23+
- builtin$
24+
- examples$
25+
formatters:
26+
enable:
27+
- gofmt
28+
- goimports
29+
exclusions:
30+
generated: strict
31+
paths:
32+
- third_party$
33+
- builtin$
34+
- examples$

β€ŽMakefileβ€Ž

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
test:
33
bash ./scripts/test.sh
44

5+
# Run golangci-lint
56
lint:
6-
@which golangci-lint > /dev/null || (echo "Error: golangci-lint is not installed" && exit 1)
7-
golangci-lint run --config=.golangci.yml
7+
@command -v golangci-lint > /dev/null || (echo "Error: golangci-lint is not installed" && exit 1)
8+
@version=$$(golangci-lint version | grep -oE 'version v?[0-9]+\.[0-9]+\.[0-9]+' | awk '{print $$2}' | sed 's/^v//'); \
9+
config=".golangci.yml"; \
10+
if echo "$$version" | grep -q '^1\.'; then \
11+
config=".golangci.v1.yml"; \
12+
fi; \
13+
golangci-lint run --config=$$config

β€ŽREADME.mdβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A common utilities library for Go.
1212

1313
## Prerequisites
1414

15-
- **Go**: The project is written in Golang. Ensure you have Go installed (preferably Go 1.23.3 or later). You can download it [here](https://go.dev/doc/install).
15+
- **Go**: The project is written in Golang. Ensure you have Go installed (preferably Go 1.24 or later). You can download it [here](https://go.dev/doc/install).
1616
- **Git**: Required for cloning the repository.
1717

1818
## Installation
@@ -68,6 +68,7 @@ cd utils
6868
| **timeutils** | Time and date manipulation utilities | [README](time/README.md) | [EXAMPLES](time/EXAMPLES.md) |
6969
| **url** | URL parsing and manipulation utilities | [README](url/README.md) | [EXAMPLES](url/EXAMPLES.md) |
7070
| **conversion** | Conversion of data types, time, and temperatues | [README](conversion/README.md) | [EXAMPLES](conversion/EXAMPLES.md)
71+
| **ratelimiter** | Token-bucket rate limiter (allow/wait, adjustable capacity & refill rate) | [README](ratelimiter/README.md) | [EXAMPLES](ratelimiter/EXAMPLES.md) |
7172

7273
## Comparison
7374

@@ -96,6 +97,7 @@ cd utils
9697
| URL Utilities | βœ… Yes | ❌ No | βœ… Yes |
9798
| Dependency-Free | βœ… Yes | ❌ No | ❌ No |
9899
| Small API Surface | βœ… Yes | ❌ No | βœ… Yes |
100+
| Rate Limiter Utilities | βœ… Yes | ❌ No | ❌ No |
99101

100102

101103
## Contributions

0 commit comments

Comments
Β (0)