标签:big end UNC panic span int str orm return
// int64 转字节数组 func IntToHex(num int64) []byte { buf := new(bytes.Buffer) err := binary.Write(buf, binary.BigEndian, num) if err != nil { log.Panic(err) } return buf.Bytes() }
// 时间戳 转为 []byte timeString := strconv.FormatInt(time.Now().Unix(), 2) timeBytes := []byte(timeString)
标签:big end UNC panic span int str orm return
原文地址:https://www.cnblogs.com/BluePegasus/p/12228854.html