mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
For symmetry inline readline function in redis client.
This commit is contained in:
parent
744208ba00
commit
b6bfe468b7
@ -70,10 +70,6 @@ func (client *RedisClient) writeHSpatial(p1, p2 int64) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *RedisClient) readLine() (data []byte, err error) {
|
|
||||||
return client.reader.ReadBytes('\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
func isError(line []byte) error {
|
func isError(line []byte) error {
|
||||||
if len(line) > 0 && line[0] == '-' {
|
if len(line) > 0 && line[0] == '-' {
|
||||||
return fmt.Errorf("error: %s", line[1:])
|
return fmt.Errorf("error: %s", line[1:])
|
||||||
@ -83,7 +79,7 @@ func isError(line []byte) error {
|
|||||||
|
|
||||||
func (client *RedisClient) readBulkString(data *[]byte) (size int, err error) {
|
func (client *RedisClient) readBulkString(data *[]byte) (size int, err error) {
|
||||||
var line []byte
|
var line []byte
|
||||||
if line, err = client.readLine(); err != nil {
|
if line, err = client.reader.ReadBytes('\n'); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err = isError(line); err != nil {
|
if err = isError(line); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user