package tool import ( "os" strconv "strconv" "github.com/gookit/goutil/fsutil" "github.com/huandu/xstrings" "github.com/spf13/cast" funk "github.com/thoas/go-funk" ) var ( ErrorCheck = Asset IsDir = fsutil.IsDir PWD = os.Getwd TempDir = os.TempDir ToString = cast.ToString Map = funk.Map Reverse = xstrings.Reverse WordCount = xstrings.WordCount ) func Float64ToStr(val float64) string { return strconv.FormatFloat(val, 'f', -1, 64) } func StrToFloat64(val string) (float64, error) { return strconv.ParseFloat(val, 64) } func Asset(err error) { if err != nil { panic(err) } } // Exist check if the file with the given path exits. func Exist(path string) bool { fi, err := os.Lstat(path) return fi != nil || (err != nil && !os.IsNotExist(err)) } // https://github.com/fatih/gomodifytags // https://github.com/favadi/protoc-go-inject-tag // https://github.com/0xAX/go-algorithms // https://github.com/emirpasic/gods // https://github.com/gookit/goutil // https://github.com/gookit/color // https://github.com/creasty/defaults // https://github.com/fatih/structtag // https://github.com/fatih/gomodifytags // https://github.com/Ompluscator/dynamic-struct // https://github.com/jhump/protoreflect // https://github.com/bufbuild/buf // go get -u github.com/zekroTJA/timedmap // https://github.com/m-zajac/json2go // https://github.com/mitchellh/mapstructure // https://github.com/ulule/deepcopier --replace copier // https://github.com/mohae/deepcopy --replace copier // https://github.com/antlabs/deepcopy --replace copier // go get github.com/fatih/structs // https://github.com/airplayx/gormat // https://github.com/golangci/awesome-go-linters // https://github.com/jedib0t/go-pretty // https://github.com/google/wire // https://github.com/google/gofuzz // https://github.com/karrick/godirwalk // https://github.com/davecgh/go-spew // https://github.com/golang/groupcache // https://github.com/bluele/gcache // https://github.com/goburrow/cache