Skip to content

Commit d8c38c9

Browse files
committed
More fixes
1 parent 8e0e95f commit d8c38c9

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

connection_helper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (c *Connection) readHandshakeSuccess() error {
6767
return nil
6868
}
6969

70-
func (c *Connection) writeQueryg(token int64, q []byte) error {
70+
func (c *Connection) writeQuery(token int64, q []byte) error {
7171
pos := 0
7272
dataLen := 8 + 4 + len(q)
7373

encoding/decoder.go

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ func valueDecoder(dv, sv reflect.Value) decoderFunc {
6969
return invalidValueDecoder
7070
}
7171

72+
if dv.IsValid() {
73+
dv = indirect(dv, false)
74+
dv.Set(reflect.Zero(dv.Type()))
75+
}
76+
7277
return typeDecoder(dv.Type(), sv.Type())
7378
}
7479

types/geometry.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package types
22

3-
import "fmt"
3+
import (
4+
"fmt"
5+
)
46

57
type Geometry struct {
68
Type string
@@ -23,6 +25,15 @@ func (g Geometry) MarshalRQL() (interface{}, error) {
2325
}
2426

2527
func (g *Geometry) UnmarshalRQL(data interface{}) error {
28+
if data, ok := data.(Geometry); ok {
29+
g.Type = data.Type
30+
g.Point = data.Point
31+
g.Line = data.Line
32+
g.Lines = data.Lines
33+
34+
return nil
35+
}
36+
2637
m, ok := data.(map[string]interface{})
2738
if !ok {
2839
return fmt.Errorf("pseudo-type GEOMETRY object is not valid")

wercker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ build:
3131
name: Test
3232
code: |-
3333
go get -u gopkg.in/check.v1
34-
go test ./...
34+
go test ./... -short
3535
- script:
3636
name: Store cache
3737
code: |-

0 commit comments

Comments
 (0)