utils

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

README

utils

some go-utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertExcelToCSV

func ConvertExcelToCSV(filePath string) error

ConvertExcelToCSV converts the Excel file to the CSV format file.

func ConvertExcelToTSV

func ConvertExcelToTSV(filePath string) error

ConvertExcelToTSV converts the Excel file to the TSV format file.

func CopyByReader

func CopyByReader(src io.Reader, dst io.Writer, buffer ...[]byte) error

CopyByReader copies the src Reader to the dst Writer.

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies the src file to the dst file.

func ListFiles

func ListFiles(dir, contentType string, fileExteinsion ...string) []string

ListFiles returns a slice containing file paths for a given content type and file extension.

func RemoveNullByte

func RemoveNullByte(data []byte) *bytes.Reader

RemoveNullByte removes the ASCII 0 in the data.

func ReplaceDelimiter

func ReplaceDelimiter(filePath string, old, new string) error

ReplaceDelimiter replaces the old delimiter with the new delimiter in the filePath.

func ReplaceDosToUnix

func ReplaceDosToUnix(filePath string) error

ReplaceDosToUnix replaces the Windows end of line(eol) with the Unix eol in the filePath.

func SkipFirstRow

func SkipFirstRow(f *os.File) error

SkipFirstRow skips the first row in f.

func UnZip

func UnZip(zip, dst string) error

UnZip unzips the file and save it to dst path.

func Zip

func Zip(src, zip string) error

Zip creates a zip file, src could be a single file or a directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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