util

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFilePath

func CreateFilePath(path string) error

func CutPath

func CutPath(path string, count int) (string, error)

func CutPathLast

func CutPathLast(path string, count int) (string, error)

func FileInfo

func FileInfo(f string) os.FileInfo

func FistIsLower

func FistIsLower(str string) bool

func FistToLower

func FistToLower(str string) string

func FixPathSeparator added in v0.1.9

func FixPathSeparator(path string) string

func GetAllPath added in v0.1.9

func GetAllPath(path string) ([]string, error)

func GetFilePath added in v0.1.9

func GetFilePath(filepath string, fileName string) ([]string, error)

func GetPackages

func GetPackages(dir string) (map[string]*ast.Package, error)

func GetTagName added in v1.2.2

func GetTagName(tag string) string

func GoFmt added in v0.1.9

func GoFmt(path string)

func IsExist

func IsExist(f string) bool

func IsFile

func IsFile(f string) bool

func LastName

func LastName(path string) string

func MapToAssciiSortJson

func MapToAssciiSortJson(m map[string]interface{}) string

func MapToSplice

func MapToSplice[T comparable, V any](m map[T]V) []T

func PrintJson

func PrintJson(js interface{})

func ProjectPath

func ProjectPath() (string, error)

func ReadAll added in v1.1.6

func ReadAll(filePth string) ([]byte, error)

func ToCamelCase

func ToCamelCase(s string) string

*

  • 蛇形转驼峰
  • @description xx_yy to XxYx xx_y_y to XxYY
  • @date 2020/7/30
  • @param s要转换的字符串
  • @return string *

func ToCamelFirstLowerCase

func ToCamelFirstLowerCase(s string) string

*

  • 蛇形转驼峰
  • @description xx_yy to XxYx xx_y_y to XxYY
  • @date 2020/7/30
  • @param s要转换的字符串
  • @return string *

func ToJsonString

func ToJsonString(js interface{}) string

func ToSnakeCase

func ToSnakeCase(s string) string

*

  • 驼峰转蛇形 snake string
  • @description XxYy to xx_yy , XxYY to xx_y_y
  • @param s 需要转换的字符串
  • @return string *

func WriteByteFile

func WriteByteFile(filePath string, data []byte) error

Types

type Empty

type Empty struct{}

Directories

Path Synopsis
middleware
gin

Jump to

Keyboard shortcuts

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