Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync from main repo #3

Merged
merged 37 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0d9dbbb
chore(security): upgrade Protobuf for CVE-2024-24786 (#3893)
Fotkurz Mar 18, 2024
2b1da2b
fix(context): make context Value method adhere to Go standards (#3897)
FarmerChillax Mar 21, 2024
78f4687
build(codecov): Added a codecov configuration (#3891)
flc1125 Mar 21, 2024
8790d08
fix(uri): query binding bug (#3236)
illiafox Mar 21, 2024
d4e4136
Revert "fix(uri): query binding bug (#3236)" (#3899)
appleboy Mar 22, 2024
fd1faad
feat(binding): support override default binding implement (#3514)
ssfyn Mar 23, 2024
7a865dc
feat(bind): ShouldBindBodyWith shortcut and change doc (#3871)
RedCrazyGhost Mar 23, 2024
c964ad3
chore(optimize): the ShouldBindUri method of the Context struct (#3911)
1911860538 Apr 1, 2024
56dc72c
ci(Makefile): vet command add .PHONY (#3915)
imalasong Apr 2, 2024
8acbe65
ci(release): refactor changelog regex patterns and exclusions (#3914)
appleboy Apr 2, 2024
c6f90df
chore: update various Go dependencies to latest versions (#3901)
appleboy Apr 2, 2024
0397e5e
chore: update changelog categories and improve documentation (#3917)
appleboy Apr 7, 2024
f80ade7
chore(deps): bump golangci/golangci-lint-action from 4 to 5 (#3941)
dependabot[bot] Apr 29, 2024
b4f66e9
chore(deps): bump github.com/bytedance/sonic from 1.11.3 to 1.11.6 (#…
dependabot[bot] Apr 29, 2024
a182195
feat(binding): Support custom BindUnmarshaler for binding. (#3933)
dkkb May 7, 2024
638aa19
chore: update external dependencies to latest versions (#3950)
appleboy May 7, 2024
39089af
chore: refactor configuration files for better readability (#3951)
appleboy May 7, 2024
75ccf94
feat: update version constant to v1.10.0 (#3952)
appleboy May 7, 2024
490accf
docs: update documentation and release notes for Gin v1.10.0 (#3953)
appleboy May 7, 2024
e60113d
docs(engine): fix comments for the `With` (#3955)
flc1125 May 7, 2024
8dd0889
refactor(binding): use strings.Cut to replace strings.Index (#3522)
lgbgbl May 7, 2024
f5f5da8
docs(gin): update link to dont-trust-all-proxies section (#3938) (#3945)
codespearhead May 7, 2024
7d14792
fix(gin): data race warning for gin mode (#1580)
kplachkov May 8, 2024
b1c1e7b
ci: update Go version requirements and remove test files (#3957)
appleboy May 8, 2024
8791c96
feat(fs): Export, test and document OnlyFilesFS (#3939)
joeig May 8, 2024
3ac729d
feat(gin): support http3 using quic-go/quic-go (#3210)
thinkerou May 9, 2024
7e29806
build: update Gin minimum Go version to 1.21 (#3960)
appleboy May 9, 2024
c677ccc
fix(go): invalid Go toolchain version (#3961)
thinkerou May 9, 2024
40131af
ci(Makefile): added help and descriptions to targets (#3964)
tr1sm0s1n May 13, 2024
6ca8ddb
feat(binding): add BindPlain (#3904)
guonaihong May 13, 2024
a569ed8
docs(readme): fix language and moved link (#3962)
truecrunchyfrog May 13, 2024
3f5b0af
refactor(slice): simplify SliceValidationError Error method (#3910)
1911860538 May 13, 2024
36b0ded
fix(context): check handler is nil (#3413)
hktalent May 13, 2024
4f339e6
fix(context): YAML judgment logic in Negotiate (#3966)
RedCrazyGhost May 14, 2024
e0d46de
fix(context): verify URL is Non-nil in initQueryCache() (#3969)
adrianosela May 19, 2024
24d6764
feat(form): add custom string slice for form tag unmarshal (#3970) (#…
bruceNu1l May 23, 2024
334160b
chore(tree): replace the self-defined 'min' to official one (#3975)
EndlessParadox1 May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/gin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
go-version: "^1"
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.58.1
args: --verbose
test:
needs: lint
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go: ["1.18", "1.19", "1.20", "1.21", "1.22"]
go: ["1.21", "1.22"]
test-tags:
["", "-tags nomsgpack", '-tags "sonic avx"', "-tags go_json", "-race"]
include:
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ issues:
- linters:
- revive
path: _test\.go
- path: gin.go
linters:
- gci
29 changes: 14 additions & 15 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
project_name: gin

builds:
-
# If true, skip the build.
- # If true, skip the build.
# Useful for library projects.
# Default is false
skip: true

changelog:
# Set it to true if you wish to skip the changelog generation.
# This may result in an empty release notes on GitHub/GitLab/Gitea.
skip: false
disable: false

# Changelog generation implementation to use.
#
Expand All @@ -21,7 +20,7 @@ changelog:
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature.
#
# Defaults to `git`.
use: git
use: github

# Sorts the changelog by the commit's messages.
# Could either be asc, desc or empty
Expand All @@ -38,20 +37,20 @@ changelog:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: 'Enhancements'
- title: "Enhancements"
regexp: "^.*chore[(\\w)]*:+.*$"
order: 2
- title: "Refactor"
regexp: "^.*refactor[(\\w)]*:+.*$"
order: 3
- title: "Build process updates"
regexp: ^.*?(build|ci)(\(.+\))??!?:.+$
order: 4
- title: "Documentation updates"
regexp: ^.*?docs?(\(.+\))??!?:.+$
order: 4
- title: Others
order: 999

filters:
# Commit messages matching the regexp listed here will be removed from
# the changelog
# Default is empty
exclude:
- '^docs'
- 'CICD'
- typo
76 changes: 75 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,82 @@
# Gin ChangeLog

## Gin v1.10.0

### Features

* feat(auth): add proxy-server authentication (#3877) (@EndlessParadox1)
* feat(bind): ShouldBindBodyWith shortcut and change doc (#3871) (@RedCrazyGhost)
* feat(binding): Support custom BindUnmarshaler for binding. (#3933) (@dkkb)
* feat(binding): support override default binding implement (#3514) (@ssfyn)
* feat(engine): Added `OptionFunc` and `With` (#3572) (@flc1125)
* feat(logger): ability to skip logs based on user-defined logic (#3593) (@palvaneh)

### Bug fixes

* Revert "fix(uri): query binding bug (#3236)" (#3899) (@appleboy)
* fix(binding): binding error while not upload file (#3819) (#3820) (@clearcodecn)
* fix(binding): dereference pointer to struct (#3199) (@echovl)
* fix(context): make context Value method adhere to Go standards (#3897) (@FarmerChillax)
* fix(engine): fix unit test (#3878) (@flc1125)
* fix(header): Allow header according to RFC 7231 (HTTP 405) (#3759) (@Crocmagnon)
* fix(route): Add fullPath in context copy (#3784) (@KarthikReddyPuli)
* fix(router): catch-all conflicting wildcard (#3812) (@FirePing32)
* fix(sec): upgrade golang.org/x/crypto to 0.17.0 (#3832) (@chncaption)
* fix(tree): correctly expand the capacity of params (#3502) (@georgijd-form3)
* fix(uri): query binding bug (#3236) (@illiafox)
* fix: Add pointer support for url query params (#3659) (#3666) (@omkar-foss)
* fix: protect Context.Keys map when call Copy method (#3873) (@kingcanfish)

### Enhancements

* chore(CI): update release args (#3595) (@qloog)
* chore(IP): add TrustedPlatform constant for Fly.io. (#3839) (@ab)
* chore(debug): add ability to override the debugPrint statement (#2337) (@josegonzalez)
* chore(deps): update dependencies to latest versions (#3835) (@appleboy)
* chore(header): Add support for RFC 9512: application/yaml (#3851) (@vincentbernat)
* chore(http): use white color for HTTP 1XX (#3741) (@viralparmarme)
* chore(optimize): the ShouldBindUri method of the Context struct (#3911) (@1911860538)
* chore(perf): Optimize the Copy method of the Context struct (#3859) (@1911860538)
* chore(refactor): modify interface check way (#3855) (@demoManito)
* chore(request): check reader if it's nil before reading (#3419) (@noahyao1024)
* chore(security): upgrade Protobuf for CVE-2024-24786 (#3893) (@Fotkurz)
* chore: refactor CI and update dependencies (#3848) (@appleboy)
* chore: refactor configuration files for better readability (#3951) (@appleboy)
* chore: update GitHub Actions configuration (#3792) (@appleboy)
* chore: update changelog categories and improve documentation (#3917) (@appleboy)
* chore: update dependencies to latest versions (#3694) (@appleboy)
* chore: update external dependencies to latest versions (#3950) (@appleboy)
* chore: update various Go dependencies to latest versions (#3901) (@appleboy)

### Build process updates

* build(codecov): Added a codecov configuration (#3891) (@flc1125)
* ci(Makefile): vet command add .PHONY (#3915) (@imalasong)
* ci(lint): update tooling and workflows for consistency (#3834) (@appleboy)
* ci(release): refactor changelog regex patterns and exclusions (#3914) (@appleboy)
* ci(testing): add go1.22 version (#3842) (@appleboy)

### Documentation updates

* docs(context): Added deprecation comments to BindWith (#3880) (@flc1125)
* docs(middleware): comments to function `BasicAuthForProxy` (#3881) (@EndlessParadox1)
* docs: Add document to constant `AuthProxyUserKey` and `BasicAuthForProxy`. (#3887) (@EndlessParadox1)
* docs: fix typo in comment (#3868) (@testwill)
* docs: fix typo in function documentation (#3872) (@TotomiEcio)
* docs: remove redundant comments (#3765) (@WeiTheShinobi)
* feat: update version constant to v1.10.0 (#3952) (@appleboy)

### Others

* Upgrade golang.org/x/net -> v0.13.0 (#3684) (@cpcf)
* test(git): gitignore add develop tools (#3370) (@demoManito)
* test(http): use constant instead of numeric literal (#3863) (@testwill)
* test(path): Optimize unit test execution results (#3883) (@flc1125)
* test(render): increased unit tests coverage (#3691) (@araujo88)

## Gin v1.9.1

### BUG FIXES
### BUG FIXES

* fix Request.Context() checks [#3512](https://github.com/gin-gonic/gin/pull/3512)

Expand Down
41 changes: 35 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TESTFOLDER := $(shell $(GO) list ./... | grep -E 'gin$$|binding$$|render$$' | gr
TESTTAGS ?= ""

.PHONY: test
# Run tests to verify code functionality.
test:
echo "mode: count" > coverage.out
for d in $(TESTFOLDER); do \
Expand All @@ -30,10 +31,12 @@ test:
done

.PHONY: fmt
# Ensure consistent code formatting.
fmt:
$(GOFMT) -w $(GOFILES)

.PHONY: fmt-check
# format (check only).
fmt-check:
@diff=$$($(GOFMT) -d $(GOFILES)); \
if [ -n "$$diff" ]; then \
Expand All @@ -42,31 +45,37 @@ fmt-check:
exit 1; \
fi;

.PHONY: vet
# Examine packages and report suspicious constructs if any.
vet:
$(GO) vet $(VETPACKAGES)

.PHONY: lint
# Inspect source code for stylistic errors or potential bugs.
lint:
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u golang.org/x/lint/golint; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;

.PHONY: misspell-check
misspell-check:
.PHONY: misspell
# Correct commonly misspelled English words in source code.
misspell:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
fi
misspell -error $(GOFILES)
misspell -w $(GOFILES)

.PHONY: misspell
misspell:
.PHONY: misspell-check
# misspell (check only).
misspell-check:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
fi
misspell -w $(GOFILES)
misspell -error $(GOFILES)

.PHONY: tools
# Install tools (golint and misspell).
tools:
@if [ $(GO_VERSION) -gt 15 ]; then \
$(GO) install golang.org/x/lint/golint@latest; \
Expand All @@ -75,3 +84,23 @@ tools:
$(GO) install golang.org/x/lint/golint; \
$(GO) install github.com/client9/misspell/cmd/misspell; \
fi

.PHONY: help
# Help.
help:
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-\0-9]+:/ { \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf " - \033[36m%-20s\033[0m %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help
Loading
Loading