struct-validation

command
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 4 Imported by: 0

README

Basic Struct Validation

This example demonstrates how to validate Go structs directly with JSON Schema, without converting them to map[string]interface{}.

Running the Example

go run examples/struct-validation/main.go

Structure Overview

type User struct {
    Name     string   `json:"name"`
    Age      int      `json:"age"`
    Email    string   `json:"email"`
    Tags     []string `json:"tags,omitempty"`    // Optional field
    IsActive bool     `json:"is_active"`
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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