slfeng_go_lib

package
v0.0.0-...-8a714c5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const INT_SIZE int = int(unsafe.Sizeof(0))

Variables

This section is empty.

Functions

func ConvertFilePathByOS

func ConvertFilePathByOS(path string) string

根据操作系统调整文件路径的 \ 和 /

func Fib

func Fib(n int) int

测试函数

func FileSize

func FileSize(fileName string) int64

计算文件长度

func GbkToUtf8

func GbkToUtf8(s []byte) ([]byte, error)

func GetBinDirectory

func GetBinDirectory() string

获取程序所在目录

func LoadObjFromJsonFile

func LoadObjFromJsonFile(filename string, obj interface{}) (err error)

从json文件中反序列化读出对象

func LoadObjFromXmlFile

func LoadObjFromXmlFile(filename string, obj interface{}) (err error)

从xml文件中反序列号读出对象

func PrintBuf

func PrintBuf(buffer []byte, dataLen int)

将数据缓存输出到控制台,便于调试

func SaveObjToJsonFile

func SaveObjToJsonFile(filename string, obj interface{}) (err error)

将对象序列号写入json文件

func SaveObjToXmlFile

func SaveObjToXmlFile(filename string, obj interface{}) (err error)

将对象序列化写入xml文件

func Utf8ToGbk

func Utf8ToGbk(s []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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