No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
structs.go
structs_test.go

README.md

structs

how to use

import (
    "fmt"

    "github.com/yudppp/structs"
)
type User struct {
    Name string `example:"ichiro" default:"suzuki"`
}

func main() {
    user := structs.NewExample(User{}).(User)
    fmt.Println(user.Name) # -> ichiro

    user = structs.NewDefault(User{}).(User)
    fmt.Println(user.Name) # -> suzuki
}