common

package
v0.0.0-...-dc5dc8e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFind = errors.New("not found")

Functions

func BasicLitValue

func BasicLitValue(basic interface{}) string

func CheckCallExprParam

func CheckCallExprParam(call *dst.CallExpr, p string) ([]string, bool)

func CheckSelectorExpr

func CheckSelectorExpr(stmt interface{}, expr string) bool

CheckSelectorExpr check stmt has SelectorExpr

func GetCallExprByVarName

func GetCallExprByVarName(stmt interface{}, varName string) (*dst.CallExpr, error)

GetCallExprByVarName get CallExpr from stmt by var name

func GetFormTag

func GetFormTag(str string) string

func GetFuncParamByType

func GetFuncParamByType(decl *dst.FuncDecl, argType string) []string

GetFuncParamByType get param name of function by type func Test(a, b string) : string is type , a and b is name

func GetFuncParamList

func GetFuncParamList(decl *dst.FuncDecl) (ps []string)

GetFuncParamList get param name of function func Test(a, b string) -> ["a","b"]

func GetFuncParams

func GetFuncParams(decl *dst.FuncDecl) map[string]string

GetFuncParams get params of function, return map[name]type func Test(a, b string) -> {"a":"string","b":"string")

func GetFuncVars

func GetFuncVars(decl *dst.FuncDecl) map[string]string

func GetJsonTag

func GetJsonTag(str string) string

func GetTagBindingRequired

func GetTagBindingRequired(str string) bool

func GetVars

func GetVars(stmt interface{}) map[string]string

GetVars get vars from statement return map[name]type

func SnakeCase

func SnakeCase(s string) string

func ToStr

func ToStr(stmt interface{}) string

ToStr convert to string

Types

This section is empty.

Jump to

Keyboard shortcuts

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