Fast and intuitive type conversion library for Go with robust handling of strings, numerics, durations, times, and booleans.
Conv is a Go package that provides fast and intuitive conversions across various Go types with a simple API. It solves the problem of manual type conversion and parsing by offering a unified interface for converting between strings, numbers, durations, times, and booleans while handling edge cases gracefully.
Go developers who need robust type conversion in their applications, particularly those dealing with user input, configuration parsing, or data transformation between different formats.
Developers choose Conv over manual conversion or multiple parsing libraries because it provides a consistent, safe API that handles many edge cases automatically, avoids panics, and offers better performance by bypassing reflection for common conversions.
Fast conversions across various Go types with a simple API.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Bypasses reflection for common conversions like string-to-any-type, ensuring fast performance while using reflection only when necessary, as stated in the README's emphasis on intuitive behavior and speed.
Provides overflow/underflow protection and follows human-readable rules, such as truncating floats for integer conversions and assigning zero for negative unsigned ints, detailed in the Numerics section.
Supports all standard library parsing for bools, durations, and times with multiple formats, making it versatile for handling diverse input sources, as shown in the Bool, Duration, and Time examples.
Avoids panics under normal conditions, returns zero values on errors with descriptive messages, and all functions are safe for concurrent use by goroutines, explicitly mentioned in the Intro and Panics sections.
Uses reflection for less common conversions, which can introduce performance penalties and bypass compile-time type safety, a trade-off admitted in the README's approach to flexibility.
Primarily focuses on built-in Go types; custom or complex structs may lack direct conversion paths without additional implementation, as inferred from the emphasis on standard types in examples.
The README includes a notice about compilation errors and recommends using a v1 import path for future-proofing, indicating possible instability or breaking changes in updates.