utils

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormatForFile = "%"
)

Variables

This section is empty.

Functions

func CheckFileExists

func CheckFileExists(fileName, description, usage string)

CheckFileExists checks whether file exists.

func GenerateCombinations

func GenerateCombinations(source []string, m int, emit func([]string))

生成 combinations

Usage:

utils.GenerateCombinations([]string{"茎", "叶", "花", "果"}, 2, func(c []string) {
    log.Println(c)
})

Results: [茎 叶] [茎 花] [茎 果] [叶 花] [叶 果] [花 果]

func GenerateCurrentWorkingDirFilePath added in v1.6.0

func GenerateCurrentWorkingDirFilePath(fileName string) string

func GetCurrentWorkingDir added in v1.6.0

func GetCurrentWorkingDir() string

Get current working directory

func GetDemoHTMLFilePath added in v1.6.0

func GetDemoHTMLFilePath() string

func GetFormattedTimeInfo added in v1.6.0

func GetFormattedTimeInfo() string

func GetNumberOfField

func GetNumberOfField(i interface{}) int

func GetXlsxFiles added in v1.6.0

func GetXlsxFiles() []string

func IsFileExists added in v1.6.0

func IsFileExists(fileName string) bool

IsFileExists returns true if file exists.

func ParseLatinName

func ParseLatinName(latinNameString string) entities.LatinName

从字符串中解析拉丁名,以及属名及种名

func ReadContent added in v1.6.0

func ReadContent(filename string) string

ReadContent reads a file and return file content as a string.

func ReadLines added in v1.6.0

func ReadLines(fileName string) []string

ReadLines reads a file and return all the lines.

func RemoveDuplicates

func RemoveDuplicates(slice []string) []string

移除重复元素

func WriteContent added in v1.6.0

func WriteContent(filename, content string)

WriteContent write string content to a file.

Types

type LogWriter

type LogWriter struct {
}

func (LogWriter) Write

func (writer LogWriter) Write(bytes []byte) (int, error)

type ValidationResult added in v1.3.0

type ValidationResult struct {
	Result      bool
	FailureInfo []string
	WarningInfo []string
}

数据校验结果

func DataValidation added in v1.3.0

func DataValidation(offlineDataMatrix, snDataMatrix entities.DataMatrix) (validationResult ValidationResult)

Jump to

Keyboard shortcuts

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