structs

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 2 Imported by: 0

README

Structs

PkgGoDev Go Report Card

Simple set of helper functions to work with structs.

Install

go get -u github.com/osamai/go-structs

Documentation

Overview

Package structs is set of helper functions to work with structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldNames

func FieldNames(s interface{}, tag string) []string

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

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL