examples/

directory
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2025 License: MIT

README ΒΆ

Examples

Practical examples demonstrating JSON Schema validation and unmarshaling with the new separated workflow.

Available Examples

🎯 Basic

Simple validation example showing valid and invalid data handling.

πŸ—οΈ Struct Validation

Direct struct validation without JSON marshaling for optimal performance.

πŸ”„ Multiple Input Types

Handle different data types (JSON bytes, maps, structs) with type-specific methods.

πŸ“¦ Unmarshaling

Validation + unmarshaling workflow with default value application.

⚠️ Error Handling

Comprehensive error handling patterns and validation failure management.

🌍 Internationalization

Multilingual error messages using Chinese (zh-Hans) and English locales.

Running Examples

# Run any example
cd <example-directory>
go run main.go

# Or run from project root
go run examples/<example-name>/main.go

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL