Skip to content

Release v1.0.0

Choose a tag to compare

@DevNewbie1826 DevNewbie1826 released this 09 Aug 14:24
· 6 commits to main since this release

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 커넥션이
    올바르게 재사용되도록 수정했습니다.