mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 08:40: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
|
||||
}
|
||||
|
||||
func (client *RedisClient) readLine() (data []byte, err error) {
|
||||
return client.reader.ReadBytes('\n')
|
||||
}
|
||||
|
||||
func isError(line []byte) error {
|
||||
if len(line) > 0 && line[0] == '-' {
|
||||
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) {
|
||||
var line []byte
|
||||
if line, err = client.readLine(); err != nil {
|
||||
if line, err = client.reader.ReadBytes('\n'); err != nil {
|
||||
return
|
||||
}
|
||||
if err = isError(line); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user