Releases: DevNewbie1826/bind
Releases · DevNewbie1826/bind
Release list
Release v1.1.0
English Version
🎉 bind v1.1.0 Release
This release focuses on improving documentation, enhancing code quality, and officially applying the MIT license. These are important updates
to improve user experience and project reliability.
🚀 What's Changed
- Code Style Standardization: All Go source files (.go) have been formatted with gofmt -s to improve code style consistency and readability.
📝 Documentation
- Project Badges Added: Added Go Report Card (https://goreportcard.com/report/github.com/DevNewbie1826/bind) and GoDoc (pkg.go.dev)
(https://pkg.go.dev/github.com/DevNewbie1826/bind) badges to README.md for at-a-glance project quality and documentation status. - Inspiration Credit: The README.md now credits go-chi/render (https://github.com/go-chi/render) as a source of inspiration.
- Example Code Fix: Corrected a missing io package import in the custom decoder example within README.md.
📄 License
- MIT License Applied: Officially applied the MIT License by adding a LICENSE file to the project and stating the license in the README.md. This
ensures proper license detection by external tools like pkg.go.dev.
한국어 버전
🎉 bind v1.1.0 릴리즈
이번 릴리즈는 문서 개선, 코드 품질 향상, 그리고 공식적인 MIT 라이선스 적용에 중점을 두었습니다. 사용자 경험과 프로젝트의 신뢰도를 높이기 위한
중요한 업데이트입니다.
🚀 주요 변경사항
- 코드 스타일 표준화: 모든 Go 소스 파일(.go)을 gofmt -s로 포맷하여 코드 스타일을 일관성 있게 개선하고 가독성을 높였습니다.
📝 문서
- 프로젝트 배지 추가: README.md에 Go Report Card (https://goreportcard.com/report/github.com/DevNewbie1826/bind)와 GoDoc (pkg.go.dev)
(https://pkg.go.dev/github.com/DevNewbie1826/bind) 배지를 추가하여 프로젝트의 품질과 문서 상태를 한눈에 파악할 수 있도록 했습니다. - 영감 출처 명시: README.md에 이 프로젝트가 go-chi/render (https://github.com/go-chi/render)에서 영감을 받았음을 명시했습니다.
- 예제 코드 수정: README.md의 커스텀 디코더 예제에서 누락되었던 io 패키지 임포트를 수정했습니다.
📄 라이선스
- MIT 라이선스 적용: 프로젝트에 LICENSE 파일을 추가하고 README.md에 라이선스 정보를 명시하여, 누구나 자유롭게 사용할 수 있도록 MIT 라이선스를
공식적으로 적용했습니다. 이를 통해 pkg.go.dev와 같은 외부 도구에서 라이선스를 정확하게 인식할 수 있습니다.
Release v1.0.0
This is a significant feature and stability release, introducing file uploads, major performance
improvements, and enhanced security.
✨ New Features
- File Upload Support: Natively binds single (*multipart.FileHeader) and multiple
([]*multipart.FileHeader) files from multipart/form-data requests. - Detailed Error Paths: Errors are now wrapped in bind.BindError which includes the full field
path (e.g., Parent.Child.Field), making debugging significantly easier. - Configurable Multipart Memory: Added bind.SetMaxMultipartMemory() to allow global configuration
of the maximum memory used for parsing multipart forms. - Recursion Depth Limit: A recursion limit has been introduced to prevent stack overflows from
malicious or deeply nested request bodies.
🚀 Performance & Stability
- Reflection Caching: Struct analysis results are now cached using sync.Map, dramatically reducing
reflection overhead on hot paths. - Concurrency Safety: The internal decoder registry is now fully thread-safe using sync.RWMutex.
- Increased Test Coverage: Test coverage has been significantly increased to 86.8%, covering many
edge cases and ensuring higher reliability.
🐛 Bug Fixes
- Nil Error Panic: Fixed a panic that occurred when ErrorToJSON or ErrorToMap was called with a
nil error. - HTTP Resource Leaks: Ensured that the request body is always fully read and closed across all
decoders to allow for HTTP connection reuse.
✨ 새로운 기능
- 파일 업로드 지원: multipart/form-data 요청으로부터 단일(*multipart.FileHeader) 및
다중([]*multipart.FileHeader) 파일을 자동으로 바인딩합니다. - 상세한 오류 경로 추적: 이제 오류 발생 시 전체 필드 경로(예: Parent.Child.Field)가 포함된
bind.BindError를 반환하여 디버깅이 훨씬 쉬워졌습니다. - 멀티파트 메모리 설정: bind.SetMaxMultipartMemory() 함수를 추가하여 멀티파트 폼 파싱에 사용되는
최대 메모리를 전역적으로 설정할 수 있습니다. - 재귀 깊이 제한: 악의적이거나 깊이가 매우 깊은 요청으로 인한 스택 오버플로우를 방지하기 위해
재귀 호출 제한 기능이 도입되었습니다.
🚀 성능 및 안정성
- 리플렉션 캐싱: 구조체 분석 결과를 sync.Map에 캐싱하여, 자주 호출되는 코드 경로의 리플렉션
오버헤드를 크게 줄였습니다. - 동시성 안전성: 내부 디코더 레지스트리를 sync.RWMutex를 사용하여 완전히
스레드-세이프(thread-safe)하게 만들었습니다. - 테스트 커버리지 향상: 테스트 커버리지를 86.8%까지 크게 향상시켜 다양한 엣지 케이스를 검증하고
신뢰도를 높였습니다.
🐛 버그 수정
- Nil 에러 패닉 방지: ErrorToJSON 또는 ErrorToMap 함수에 nil 에러가 전달되었을 때 발생하던 패닉을
수정했습니다. - HTTP 리소스 누수 방지: 모든 디코더에서 요청 본문을 완전히 읽고 닫도록 보장하여 HTTP 커넥션이
올바르게 재사용되도록 수정했습니다.