google / uuid

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
BSD 3-Clause "New" or "Revised" License
5.26k stars 362 forks source link

feat: add error types for better validation #166

Closed plusiv closed 1 month ago

plusiv commented 1 month ago

Description:

This PR improves error handling by adding specific error types and ensuring compatibility with errors.Is for better validation. The changes include:

plusiv commented 1 month ago

Hi @bormanp , I really appreciate your review and valid suggestions. I've removed some changes that were added unintentionally by my code formatter in my code editor. Additionally I've sightly modified the approach with ErrInvalidLength and ErrInvalidURNPrefix error types to keep more backward compatibility.