Discover Packages
github.com/osamai/go-structs
package
module
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Jan 13, 2021
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Structs
Simple set of helper functions to work with structs.
Install
go get -u github.com/osamai/go-structs
Expand ▾
Collapse ▴
Documentation
¶
Package structs is set of helper functions to work with structs.
FieldNames gets field names of tag in struct.
if tag is empty string (""), field name is used.
Panics if s is not a struct.
func ToMap(s interface{}, tag string ) map[string ]interface{}
ToMap converts a struct to a map.
tag is defined in struct's tags, used as map key if not empty
otherwise field name is used.
Panics if s is not a struct.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.