Documentation ¶
Index ¶
- Constants
- func Checkerr(err error, msg string)
- func Checkerr2(err error, msg string) (shouldExit bool)
- func CopyDir(dst, src string) error
- func CopyFile(dst, src string) error
- func CurDir() string
- func DiffFile(left, right string) (diff string, same bool, err error)
- func EscapeSpecificChar(str string) string
- func EscapeString(driverName, str string) string
- func EscapeValuesString(driverName, str string) string
- func FetchRow(db *sql.DB, sqlstr string, args ...interface{}) (*map[string]string, error)
- func FileExists(filename string) bool
- func FileOpen(file_name string) ([]byte, error)
- func FileToUrlPath(file string) string
- func ForceCreateFile(filename string) *os.File
- func ForeachFile(path string, pattern string, onFindFile func(fileName string) error) error
- func GetFileInfo(filename string) (name, ext string, en bool)
- func GetFilelist(path string, pattern string) []string
- func GetStringValue(i interface{}) (result string)
- func GetlastModified(file string) time.Time
- func HasChineseChar(str string) bool
- func IsFileSame(left, right string) bool
- func Krand(size int, kind int) []byte
- func NoneError(err error)
- func PathExists(path string) bool
- func ReadExcelsheet2Slice(sheet *xlsx.Sheet, dataStartRow int) (records []map[string]interface{}, err error)
- func ReadFileContext(path string) string
- func ReadJson2Slice(filename string) (records []map[string]interface{}, err error)
- func ReadXml(obj interface{}, filename string) error
- func RemoveFile(file string)
- func SHA1EncodeFileName(filename string) string
- func SaveFile(file string, content string)
- func SaveJson(filename string, obj interface{}) error
- func SaveUtf8BomFile(file string, content string)
- func SaveXml(filename string, obj interface{}) error
- func SetLastModified(file string, time time.Time)
- func ShowError(err error) bool
- func UNCPath(s string) string
- func UrlToLocalFile(Url string) string
- func WriteFile(file string, data []byte)
Constants ¶
View Source
const ( KC_RAND_KIND_NUM = 0 // 纯数字 KC_RAND_KIND_LOWER = 1 // 小写字母 KC_RAND_KIND_UPPER = 2 // 大写字母 KC_RAND_KIND_ALL = 3 // 数字、大小写字母 )
View Source
const ( EXT_HTML = ".html" EXT_XML = ".xml" EXT_JSON = ".json" EXT_ZIP = ".zip" EXT_IDOC = ".idoc" EXT_ZED = ".zed" EXT_PDF = ".pdf" )
Variables ¶
This section is empty.
Functions ¶
func EscapeSpecificChar ¶
func EscapeString ¶
func EscapeValuesString ¶
func FileExists ¶
func FileToUrlPath ¶
func ForceCreateFile ¶
func ForeachFile ¶
func GetFileInfo ¶
func GetFilelist ¶
golang 文件处理公共函数库 https://www.cnblogs.com/chengbiwei/p/9672896.html
func GetStringValue ¶
func GetStringValue(i interface{}) (result string)
使用Value.Kind()类型判断,并获取真实值进行打印
func GetlastModified ¶
func HasChineseChar ¶
func IsFileSame ¶
func PathExists ¶
func ReadExcelsheet2Slice ¶
func ReadFileContext ¶
func ReadJson2Slice ¶
func RemoveFile ¶
func RemoveFile(file string)
func SHA1EncodeFileName ¶
func SaveUtf8BomFile ¶
func SetLastModified ¶
func UNCPath ¶
UNCPath converts an absolute Windows path to a UNC long path. https://blog.klauspost.com/long-windows-paths-unc-paths-in-go/ \\?\UNC\server\share\dir\file.txt
func UrlToLocalFile ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.