helper

package
v0.0.0-...-a372403 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStTag

func AddStTag(node *ast.StructType, tag string, nameConverter func(str string) string) error

AddStTag filedに対してtagを追加する

type point struct {
 	x, y int
}

このように複数のfieldが並んでるタイプには未対応 たぶんこの2つに対してtagをつけれないと思うから

func CombineTag

func CombineTag(tags []StTag) string

CombineTag 元々存在したtagの最後の文字[`]を取り除き、新たに作ったtagの最初の文字[`]を取り除いたものと結合する

func CreateTag

func CreateTag(tag, value string) string

CreateTag structのタグをつ作る

func TakeOutStruct

func TakeOutStruct(f *ast.File, stname string, fn func(spec *ast.TypeSpec) error) error

TakeOutStruct 受け取ったast.Nodeの中から指定した名前のtypeを探し引数fnの関数に渡す

func ToLowerCamel

func ToLowerCamel(str string) string

ToLowerCamel 新たなstringのスライスを作り、引数strの1文字目をlowerして入れる。2文字目移行もスライスにいれて最後にjoinする 他にいい方法があったら知りたい

Types

type StTag

type StTag struct {
	// contains filtered or unexported fields
}

StTag structのtagの値を保持した構造体

func ParseTag

func ParseTag(tag string) []StTag

ParseTag structのtagをparseしてStTag構造体の配列で返す

Jump to

Keyboard shortcuts

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