package
module
Version:
v1.3.5
Opens a new window with list of versions in this module.
Published: May 19, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 7
Opens a new window with list of known importers.
README
¶
Tag - Struct Tag Parser And Decoder

Installation
To install the package, run:
go get github.com/go-zoox/tag
Features
- Type Validation
-
omitempty, such as tag:"app_name,omitempty"
-
required, such as tag:"app_name,required"
-
default, such as tag:"app_name,default=my_app"
-
enum, such as tag:"app_name,enum=my_app|my_app2"
-
regexp, such as tag:"app_name,regexp=/^[a-zA-Z0-9_]+$/
-
min, such as tag:"app_name,min=1
- if type is
string, means the length of string
- if type is
int64, means the minimum value of int
-
max, such as tag:"app_name,max=10
- if type is
string, means the length of string
- if type is
int64, means the maximum value of int
- Auto Type Transform
Getting Started
// see test cases in tag_test.go
License
GoZoox is released under the MIT License.
Documentation
¶
Version is the version of tag.
Tag is a struct tag parser and decoder
func (t *Tag) Decode(ptr interface{}) error
Decode decodes the given struct pointer from data source.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.