Example #1
0
// date
func encodeTime(v time.Time) (b []byte, err error) {
	var tmpV []byte
	b = append(b, 'd')
	if tmpV, err = util.PackInt64(v.UnixNano() / 1000000); err != nil {
		b = nil
		return
	}
	b = append(b, tmpV...)
	return
}
Example #2
0
// long
func encodeInt64(v int64) (b []byte, err error) {
	var tmpV []byte
	if tmpV, err = util.PackInt64(v); err != nil {
		b = nil
		return
	}
	b = append(b, 'L')
	b = append(b, tmpV...)
	return

}