From 486b6661325905ae959a60e68524b6a40bf526b5 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 16 Sep 2016 09:49:02 +0100 Subject: [PATCH] Simplify encoding of basic structs --- util/pack/sql-all.go | 2 +- util/pack/sql-asc.go | 2 +- util/pack/sql-desc.go | 2 +- util/pack/sql-empty.go | 2 +- util/pack/sql-null.go | 2 +- util/pack/sql-void.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/util/pack/sql-all.go b/util/pack/sql-all.go index 83a5b8d6..e91d4425 100644 --- a/util/pack/sql-all.go +++ b/util/pack/sql-all.go @@ -21,5 +21,5 @@ func (x extSqlAll) ReadExt(dst interface{}, src []byte) { } func (x extSqlAll) WriteExt(src interface{}) (dst []byte) { - return []byte("*") + return []byte{0x00} } diff --git a/util/pack/sql-asc.go b/util/pack/sql-asc.go index 84a05c22..600a23f3 100644 --- a/util/pack/sql-asc.go +++ b/util/pack/sql-asc.go @@ -21,5 +21,5 @@ func (x extSqlAsc) ReadExt(dst interface{}, src []byte) { } func (x extSqlAsc) WriteExt(src interface{}) (dst []byte) { - return []byte("ASC") + return []byte{0x00} } diff --git a/util/pack/sql-desc.go b/util/pack/sql-desc.go index dd97024e..50e23b6d 100644 --- a/util/pack/sql-desc.go +++ b/util/pack/sql-desc.go @@ -21,5 +21,5 @@ func (x extSqlDesc) ReadExt(dst interface{}, src []byte) { } func (x extSqlDesc) WriteExt(src interface{}) (dst []byte) { - return []byte("DESC") + return []byte{0x00} } diff --git a/util/pack/sql-empty.go b/util/pack/sql-empty.go index 6d15688b..9d043d56 100644 --- a/util/pack/sql-empty.go +++ b/util/pack/sql-empty.go @@ -21,5 +21,5 @@ func (x extSqlEmpty) ReadExt(dst interface{}, src []byte) { } func (x extSqlEmpty) WriteExt(src interface{}) (dst []byte) { - return []byte("EMPTY") + return []byte{0x00} } diff --git a/util/pack/sql-null.go b/util/pack/sql-null.go index 759edad6..c4da7f91 100644 --- a/util/pack/sql-null.go +++ b/util/pack/sql-null.go @@ -21,5 +21,5 @@ func (x extSqlNull) ReadExt(dst interface{}, src []byte) { } func (x extSqlNull) WriteExt(src interface{}) (dst []byte) { - return []byte("NULL") + return []byte{0x00} } diff --git a/util/pack/sql-void.go b/util/pack/sql-void.go index d688be2f..5322deda 100644 --- a/util/pack/sql-void.go +++ b/util/pack/sql-void.go @@ -21,5 +21,5 @@ func (x extSqlVoid) ReadExt(dst interface{}, src []byte) { } func (x extSqlVoid) WriteExt(src interface{}) (dst []byte) { - return []byte("VOID") + return []byte{0x00} }