Documentation ¶
Index ¶
- Constants
- func FileNumInDir(dir string) int
- func FileWalk(dir string, onlyDir bool, fn func(absPath string, fileInfo os.FileInfo) bool)
- func GetCurrentAbPathByCaller() string
- func GetRootDir() string
- func GetValueFromType(e ast.Expr) string
- func HandleError(e error)
- func HandleErrorWithMsg(e error, msg ...string)
- func IfF(condition bool, resultF func())
- func ImportName(i string) string
- func Info(msg string, fields ...zap.Field)
- func Panic(msg string, fields ...zap.Field)
- func PathJoin(paths ...string) string
- func PrintDetail(objectName string, i interface{})
- func Record(fields ...zap.Field)
- func StringsEqual(s, t []string) bool
- func Timer(name string, fn func())
- func Times(t int, f func(int))
- func ToMap[T comparable](a []T) map[T]struct{}
- func TypeString(i interface{}) string
- func Warn(msg string, fields ...zap.Field)
- type ConfigChecker
- type EmptyStruct
Constants ¶
View Source
const FileSep = string(os.PathSeparator)
Variables ¶
This section is empty.
Functions ¶
func FileNumInDir ¶
func GetCurrentAbPathByCaller ¶
func GetCurrentAbPathByCaller() string
func GetRootDir ¶
func GetRootDir() string
func GetValueFromType ¶
GetValueFromType Get value from the `*ast.Ident`/`*ast.SelectorExpr`/`*ast.StarExpr` TODO handle the map / slice / func
func HandleErrorWithMsg ¶
func ImportName ¶
ImportName get the import name from the import spec value
func PrintDetail ¶
func PrintDetail(objectName string, i interface{})
func StringsEqual ¶
func ToMap ¶
func ToMap[T comparable](a []T) map[T]struct{}
ToMap More functions like it, visit: https://github.com/samber/lo
func TypeString ¶
func TypeString(i interface{}) string
Types ¶
type ConfigChecker ¶
type ConfigChecker struct { }
func (ConfigChecker) CheckInterface ¶
func (c ConfigChecker) CheckInterface(interfaceName string, method string, returnDefaultValues string)
CheckInterface check the method and the return default values accord the method, if the interface name isn't empty
func (ConfigChecker) CheckModuleName ¶
func (c ConfigChecker) CheckModuleName(module string)
CheckModuleName the module shouldn't be empty
func (ConfigChecker) CheckProjectDir ¶
func (c ConfigChecker) CheckProjectDir(dir string)
CheckProjectDir check whether the dir param is existed and valid
func (ConfigChecker) CheckWritePaths ¶
func (c ConfigChecker) CheckWritePaths(paths []string)
CheckWritePaths the path should be "xxxx,xxxx"
type EmptyStruct ¶
type EmptyStruct = struct{}
Click to show internal directories.
Click to hide internal directories.