Skip to content

yudppp/structs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages