# go-sftag **Repository Path**: azhai/go-sftag ## Basic Information - **Project Name**: go-sftag - **Description**: Yet another StructTag, with some features liked cache and alias. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-13 - **Last Updated**: 2021-10-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # go-sftag Yet another StructTag, with some features liked cache and alias. # Usage ```go package main import ( "fmt" "github.com/azhai/go-sftag" ) // 连接配置 type ConnParams struct { Host string `json:"host" yaml:"host" toml:"host"` Port int `json:"port,omitempty" yaml:"port,omitempty" toml:"port"` Username string `yaml/json:"username,omitempty" toml:"username"` Password string `toml/yaml/json:"password"` Database string `toml/yaml/json:"database"` Options map[string]interface{} `yaml/json:"options,omitempty" toml:"options"` } func main() { tags := sftag.GetStructTags(ConnParams{}) tag := sftag.NewSfTag() tag.Parse(tags["Options"]) fmt.Println(tag.Get("yaml")) fmt.Println(tag.String()) } ```