diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8d28529ba..da80cb9cc 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -39,4 +39,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - args: --issues-exit-code=0 -E gofmt + args: -E gofmt diff --git a/client_tools.go b/client_tools.go index de10a366b..8c0a30772 100644 --- a/client_tools.go +++ b/client_tools.go @@ -10,6 +10,7 @@ type IntKey struct { I int } +//nolint: errcheck func (k IntKey) EncodeMsgpack(enc *msgpack.Encoder) error { enc.EncodeSliceLen(1) enc.EncodeInt(k.I) @@ -22,6 +23,7 @@ type UintKey struct { I uint } +//nolint: errcheck func (k UintKey) EncodeMsgpack(enc *msgpack.Encoder) error { enc.EncodeSliceLen(1) enc.EncodeUint(k.I) @@ -34,6 +36,7 @@ type StringKey struct { S string } +//nolint: errcheck func (k StringKey) EncodeMsgpack(enc *msgpack.Encoder) error { enc.EncodeSliceLen(1) enc.EncodeString(k.S) @@ -46,6 +49,7 @@ type IntIntKey struct { I1, I2 int } +//nolint: errcheck func (k IntIntKey) EncodeMsgpack(enc *msgpack.Encoder) error { enc.EncodeSliceLen(2) enc.EncodeInt(k.I1) @@ -60,6 +64,7 @@ type Op struct { Arg interface{} } +//nolint: errcheck func (o Op) EncodeMsgpack(enc *msgpack.Encoder) error { enc.EncodeSliceLen(3) enc.EncodeString(o.Op) @@ -75,6 +80,7 @@ type OpSplice struct { Replace string } +//nolint: errcheck func (o OpSplice) EncodeMsgpack(enc *msgpack.Encoder) error { enc.EncodeSliceLen(5) enc.EncodeString(o.Op) diff --git a/connection.go b/connection.go index d8e381364..976e8e0b2 100644 --- a/connection.go +++ b/connection.go @@ -147,7 +147,7 @@ type connShard struct { bufmut sync.Mutex buf smallWBuf enc *msgpack.Encoder - _pad [16]uint64 + _pad [16]uint64 //nolint: structcheck,unused } // Greeting is a message sent by Tarantool on connect. @@ -228,6 +228,7 @@ type Opts struct { // - If opts.Reconnect is non-zero, then error will be returned only if authorization // fails. But if Tarantool is not reachable, then it will make an attempt to reconnect later // and will not finish to make attempts on authorization failures. +//nolint: errcheck func Connect(addr string, opts Opts) (conn *Connection, err error) { conn = &Connection{ addr: addr, @@ -495,7 +496,7 @@ func (conn *Connection) createConnection(reconnect bool) (err error) { conn.notify(ReconnectFailed) reconnects++ conn.mutex.Unlock() - time.Sleep(now.Add(conn.opts.Reconnect).Sub(time.Now())) + time.Sleep(time.Until(now.Add(conn.opts.Reconnect))) conn.mutex.Lock() } if conn.state == connClosed { @@ -538,6 +539,7 @@ func (conn *Connection) closeConnection(neterr error, forever bool) (err error) return } +//nolint: errcheck func (conn *Connection) reconnect(neterr error, c net.Conn) { conn.mutex.Lock() defer conn.mutex.Unlock() @@ -567,6 +569,7 @@ func (conn *Connection) unlockShards() { } } +//nolint: errcheck func (conn *Connection) pinger() { to := conn.opts.Timeout if to == 0 { @@ -688,7 +691,7 @@ func (conn *Connection) newFuture(requestCode int32) (fut *Future) { *pair.last = fut pair.last = &fut.next if conn.opts.Timeout > 0 { - fut.timeout = time.Now().Sub(epoch) + conn.opts.Timeout + fut.timeout = time.Until(epoch) + conn.opts.Timeout } shard.rmut.Unlock() if conn.rlimit != nil && conn.opts.RLimitAction == RLimitWait { @@ -796,9 +799,9 @@ func (conn *Connection) timeouts() { return case <-t.C: } - minNext := time.Now().Sub(epoch) + timeout + minNext := time.Until(epoch) + timeout for i := range conn.shard { - nowepoch = time.Now().Sub(epoch) + nowepoch = time.Until(epoch) shard := &conn.shard[i] for pos := range shard.requests { shard.rmut.Lock() @@ -825,7 +828,7 @@ func (conn *Connection) timeouts() { shard.rmut.Unlock() } } - nowepoch = time.Now().Sub(epoch) + nowepoch = time.Until(epoch) if nowepoch+time.Microsecond < minNext { t.Reset(minNext - nowepoch) } else { diff --git a/deadline_io.go b/deadline_io.go index 3bda73ac8..155fc6bd2 100644 --- a/deadline_io.go +++ b/deadline_io.go @@ -10,6 +10,7 @@ type DeadlineIO struct { c net.Conn } +//nolint: errcheck func (d *DeadlineIO) Write(b []byte) (n int, err error) { if d.to > 0 { d.c.SetWriteDeadline(time.Now().Add(d.to)) @@ -18,6 +19,7 @@ func (d *DeadlineIO) Write(b []byte) (n int, err error) { return } +//nolint: errcheck func (d *DeadlineIO) Read(b []byte) (n int, err error) { if d.to > 0 { d.c.SetReadDeadline(time.Now().Add(d.to)) diff --git a/example_custom_unpacking_test.go b/example_custom_unpacking_test.go index 772c9faf3..a8574f6e1 100644 --- a/example_custom_unpacking_test.go +++ b/example_custom_unpacking_test.go @@ -16,13 +16,14 @@ type Tuple2 struct { // Same effect in a "magic" way, but slower. type Tuple3 struct { - _msgpack struct{} `msgpack:",asArray"` + _msgpack struct{} `msgpack:",asArray"` //nolint: structcheck,unused Cid uint Orig string Members []Member } +//nolint: errcheck func (c *Tuple2) EncodeMsgpack(e *msgpack.Encoder) error { if err := e.EncodeSliceLen(3); err != nil { return err @@ -37,6 +38,7 @@ func (c *Tuple2) EncodeMsgpack(e *msgpack.Encoder) error { return nil } +//nolint: errcheck func (c *Tuple2) DecodeMsgpack(d *msgpack.Decoder) error { var err error var l int diff --git a/example_test.go b/example_test.go index 1e8c883ab..9d73be70f 100644 --- a/example_test.go +++ b/example_test.go @@ -10,7 +10,7 @@ import ( type Tuple struct { // Instruct msgpack to pack this struct as array, so no custom packer // is needed. - _msgpack struct{} `msgpack:",asArray"` + _msgpack struct{} `msgpack:",asArray"` //nolint: structcheck,unused Id uint Msg string Name string @@ -24,6 +24,7 @@ func example_connect() *tarantool.Connection { return conn } +//nolint: errcheck func ExampleConnection_Select() { conn := example_connect() defer conn.Close() @@ -70,6 +71,7 @@ func ExampleConnection_SelectTyped() { // response is [{{} 1111 hello world}] } +//nolint func ExampleConnection_SelectAsync() { conn := example_connect() defer conn.Close() @@ -118,6 +120,7 @@ func ExampleConnection_Ping() { // Ping Error } +//nolint: errcheck func ExampleConnection_Insert() { conn := example_connect() defer conn.Close() @@ -151,6 +154,7 @@ func ExampleConnection_Insert() { } +//nolint: errcheck func ExampleConnection_Delete() { conn := example_connect() defer conn.Close() @@ -184,6 +188,7 @@ func ExampleConnection_Delete() { // Data [[36 test one]] } +//nolint: errcheck func ExampleConnection_Replace() { conn := example_connect() defer conn.Close() @@ -233,6 +238,7 @@ func ExampleConnection_Replace() { // Data [[13 test twelve]] } +//nolint: errcheck func ExampleConnection_Update() { conn := example_connect() defer conn.Close() diff --git a/queue/example_msgpack_test.go b/queue/example_msgpack_test.go index ecfb60a94..79f6d2c62 100644 --- a/queue/example_msgpack_test.go +++ b/queue/example_msgpack_test.go @@ -46,6 +46,7 @@ func (c *dummyData) EncodeMsgpack(e *msgpack.Encoder) error { // - If you use the connection timeout and call Take, we return an error if we // cannot take the task out of the queue within the time corresponding to the // connection timeout. +//nolint: errcheck,ineffassign func Example_simpleQueueCustomMsgPack() { opts := tarantool.Opts{ Reconnect: time.Second, diff --git a/queue/example_test.go b/queue/example_test.go index cb0f62f1a..a8a436790 100644 --- a/queue/example_test.go +++ b/queue/example_test.go @@ -16,6 +16,7 @@ import ( "github.com/tarantool/go-tarantool/queue" ) +//nolint // Example demonstrates an operations like Put and Take with queue. func Example_simpleQueue() { cfg := queue.Cfg{ diff --git a/queue/queue.go b/queue/queue.go index ce0eeb49f..28a1dd400 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -339,6 +339,7 @@ type queueData struct { result interface{} } +//nolint func (qd *queueData) DecodeMsgpack(d *msgpack.Decoder) error { var err error var l int diff --git a/queue/queue_test.go b/queue/queue_test.go index db531eb4c..dcd54d8bd 100644 --- a/queue/queue_test.go +++ b/queue/queue_test.go @@ -794,16 +794,22 @@ func TestUtube_Put(t *testing.T) { t.Fatalf("Failed put task to queue: %s", err.Error()) } + errChan := make(chan struct{}) go func() { t1, err := q.TakeTimeout(2 * time.Second) if err != nil { - t.Fatalf("Failed to take task from utube: %s", err.Error()) + t.Errorf("Failed to take task from utube: %s", err.Error()) + errChan <- struct{}{} + return } time.Sleep(2 * time.Second) if err := t1.Ack(); err != nil { - t.Fatalf("Failed to ack task: %s", err.Error()) + t.Errorf("Failed to ack task: %s", err.Error()) + errChan <- struct{}{} + return } + close(errChan) }() time.Sleep(100 * time.Millisecond) @@ -817,6 +823,9 @@ func TestUtube_Put(t *testing.T) { t.Fatalf("Failed to ack task: %s", err.Error()) } end := time.Now() + if _, ok := <-errChan; ok { + t.Fatalf("One of take failed") + } if math.Abs(float64(end.Sub(start)-2*time.Second)) > float64(200*time.Millisecond) { t.Fatalf("Blocking time is less than expected: actual = %.2fs, expected = 1s", end.Sub(start).Seconds()) } diff --git a/request.go b/request.go index ff8a7e8a5..3ec9a1921 100644 --- a/request.go +++ b/request.go @@ -19,11 +19,13 @@ type Future struct { } // Ping sends empty request to Tarantool to check connection. +//nolint: errcheck func (conn *Connection) Ping() (resp *Response, err error) { future := conn.newFuture(PingRequest) return future.send(conn, func(enc *msgpack.Encoder) error { enc.EncodeMapLen(0); return nil }).Get() } +//nolint: errcheck func (req *Future) fillSearch(enc *msgpack.Encoder, spaceNo, indexNo uint32, key interface{}) error { enc.EncodeUint64(KeySpaceNo) enc.EncodeUint64(uint64(spaceNo)) @@ -33,6 +35,7 @@ func (req *Future) fillSearch(enc *msgpack.Encoder, spaceNo, indexNo uint32, key return enc.Encode(key) } +//nolint: errcheck func (req *Future) fillIterator(enc *msgpack.Encoder, offset, limit, iterator uint32) { enc.EncodeUint64(KeyIterator) enc.EncodeUint64(uint64(iterator)) @@ -42,6 +45,7 @@ func (req *Future) fillIterator(enc *msgpack.Encoder, offset, limit, iterator ui enc.EncodeUint64(uint64(limit)) } +//nolint: errcheck func (req *Future) fillInsert(enc *msgpack.Encoder, spaceNo uint32, tuple interface{}) error { enc.EncodeUint64(KeySpaceNo) enc.EncodeUint64(uint64(spaceNo)) @@ -213,6 +217,7 @@ func (conn *Connection) EvalTyped(expr string, args interface{}, result interfac } // SelectAsync sends select request to Tarantool and returns Future. +//nolint: errcheck func (conn *Connection) SelectAsync(space, index interface{}, offset, limit, iterator uint32, key interface{}) *Future { future := conn.newFuture(SelectRequest) spaceNo, indexNo, err := conn.Schema.resolveSpaceIndex(space, index) @@ -228,6 +233,7 @@ func (conn *Connection) SelectAsync(space, index interface{}, offset, limit, ite // InsertAsync sends insert action to Tarantool and returns Future. // Tarantool will reject Insert when tuple with same primary key exists. +//nolint: errcheck func (conn *Connection) InsertAsync(space interface{}, tuple interface{}) *Future { future := conn.newFuture(InsertRequest) spaceNo, _, err := conn.Schema.resolveSpaceIndex(space, nil) @@ -242,6 +248,7 @@ func (conn *Connection) InsertAsync(space interface{}, tuple interface{}) *Futur // ReplaceAsync sends "insert or replace" action to Tarantool and returns Future. // If tuple with same primary key exists, it will be replaced. +//nolint: errcheck func (conn *Connection) ReplaceAsync(space interface{}, tuple interface{}) *Future { future := conn.newFuture(ReplaceRequest) spaceNo, _, err := conn.Schema.resolveSpaceIndex(space, nil) @@ -256,6 +263,7 @@ func (conn *Connection) ReplaceAsync(space interface{}, tuple interface{}) *Futu // DeleteAsync sends deletion action to Tarantool and returns Future. // Future's result will contain array with deleted tuple. +//nolint: errcheck func (conn *Connection) DeleteAsync(space, index interface{}, key interface{}) *Future { future := conn.newFuture(DeleteRequest) spaceNo, indexNo, err := conn.Schema.resolveSpaceIndex(space, index) @@ -270,6 +278,7 @@ func (conn *Connection) DeleteAsync(space, index interface{}, key interface{}) * // Update sends deletion of a tuple by key and returns Future. // Future's result will contain array with updated tuple. +//nolint: errcheck func (conn *Connection) UpdateAsync(space, index interface{}, key, ops interface{}) *Future { future := conn.newFuture(UpdateRequest) spaceNo, indexNo, err := conn.Schema.resolveSpaceIndex(space, index) @@ -288,6 +297,7 @@ func (conn *Connection) UpdateAsync(space, index interface{}, key, ops interface // UpsertAsync sends "update or insert" action to Tarantool and returns Future. // Future's sesult will not contain any tuple. +//nolint: errcheck func (conn *Connection) UpsertAsync(space interface{}, tuple interface{}, ops interface{}) *Future { future := conn.newFuture(UpsertRequest) spaceNo, _, err := conn.Schema.resolveSpaceIndex(space, nil) @@ -309,6 +319,7 @@ func (conn *Connection) UpsertAsync(space interface{}, tuple interface{}, ops in // CallAsync sends a call to registered Tarantool function and returns Future. // It uses request code for Tarantool 1.6, so future's result is always array of arrays +//nolint: errcheck func (conn *Connection) CallAsync(functionName string, args interface{}) *Future { future := conn.newFuture(CallRequest) return future.send(conn, func(enc *msgpack.Encoder) error { @@ -323,6 +334,7 @@ func (conn *Connection) CallAsync(functionName string, args interface{}) *Future // Call17Async sends a call to registered Tarantool function and returns Future. // It uses request code for Tarantool 1.7, so future's result will not be converted // (though, keep in mind, result is always array) +//nolint: errcheck func (conn *Connection) Call17Async(functionName string, args interface{}) *Future { future := conn.newFuture(Call17Request) return future.send(conn, func(enc *msgpack.Encoder) error { @@ -335,6 +347,7 @@ func (conn *Connection) Call17Async(functionName string, args interface{}) *Futu } // EvalAsync sends a Lua expression for evaluation and returns Future. +//nolint: errcheck func (conn *Connection) EvalAsync(expr string, args interface{}) *Future { future := conn.newFuture(EvalRequest) return future.send(conn, func(enc *msgpack.Encoder) error { @@ -350,6 +363,7 @@ func (conn *Connection) EvalAsync(expr string, args interface{}) *Future { // private // +//nolint: errcheck func (fut *Future) pack(h *smallWBuf, enc *msgpack.Encoder, body func(*msgpack.Encoder) error) (err error) { rid := fut.requestId hl := h.Len() diff --git a/response.go b/response.go index 2e0783659..14acce069 100644 --- a/response.go +++ b/response.go @@ -15,10 +15,12 @@ type Response struct { buf smallBuf } +//nolint: unused func (resp *Response) fill(b []byte) { resp.buf.b = b } +//nolint: errcheck func (resp *Response) smallInt(d *msgpack.Decoder) (i int, err error) { b, err := resp.buf.ReadByte() if err != nil { @@ -31,6 +33,7 @@ func (resp *Response) smallInt(d *msgpack.Decoder) (i int, err error) { return d.DecodeInt() } +//nolint: errcheck func (resp *Response) decodeHeader(d *msgpack.Decoder) (err error) { var l int d.Reset(&resp.buf) diff --git a/schema.go b/schema.go index 91c0faedd..ab937f2f1 100644 --- a/schema.go +++ b/schema.go @@ -50,6 +50,7 @@ type IndexField struct { Type string } +//nolint: varcheck,deadcode const ( maxSchemas = 10000 spaceSpId = 280 diff --git a/tarantool_test.go b/tarantool_test.go index 5f5078a8b..db8d0ccf5 100644 --- a/tarantool_test.go +++ b/tarantool_test.go @@ -20,6 +20,7 @@ type Member struct { Val uint } +//nolint: errcheck func (m *Member) EncodeMsgpack(e *msgpack.Encoder) error { if err := e.EncodeSliceLen(2); err != nil { return err @@ -365,8 +366,7 @@ func TestClient(t *testing.T) { return } if conn == nil { - t.Errorf("conn is nil after Connect") - return + t.Fatalf("conn is nil after Connect") } defer conn.Close() @@ -376,7 +376,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Ping: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Ping") + t.Fatalf("Response is nil after Ping") } // Insert @@ -385,7 +385,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Insert: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Insert") + t.Fatalf("Response is nil after Insert") } if len(resp.Data) != 1 { t.Errorf("Response Body len != 1") @@ -418,7 +418,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Delete: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Delete") + t.Fatalf("Response is nil after Delete") } if len(resp.Data) != 1 { t.Errorf("Response Body len != 1") @@ -441,7 +441,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Delete: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Delete") + t.Fatalf("Response is nil after Delete") } if len(resp.Data) != 0 { t.Errorf("Response Data len != 0") @@ -460,7 +460,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Replace (duplicate): %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Replace (duplicate)") + t.Fatalf("Response is nil after Replace (duplicate)") } if len(resp.Data) != 1 { t.Errorf("Response Data len != 1") @@ -485,7 +485,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Update: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Update") + t.Fatalf("Response is nil after Update") } if len(resp.Data) != 1 { t.Errorf("Response Data len != 1") @@ -528,13 +528,16 @@ func TestClient(t *testing.T) { if err != nil { t.Errorf("Failed to Replace: %s", err.Error()) } + if resp.Code != 0 { + t.Errorf("Failed to replace") + } } resp, err = conn.Select(spaceNo, indexNo, 0, 1, IterEq, []interface{}{uint(10)}) if err != nil { t.Errorf("Failed to Select: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Select") + t.Fatalf("Response is nil after Select") } if len(resp.Data) != 1 { t.Errorf("Response Data len != 1") @@ -556,7 +559,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Select: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Select") + t.Fatalf("Response is nil after Select") } if len(resp.Data) != 0 { t.Errorf("Response Data len != 0") @@ -626,7 +629,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Call: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Call") + t.Fatalf("Response is nil after Call") } if len(resp.Data) < 1 { t.Errorf("Response.Data is empty after Eval") @@ -634,11 +637,17 @@ func TestClient(t *testing.T) { // Call vs Call17 resp, err = conn.Call("simple_incr", []interface{}{1}) + if err != nil { + t.Errorf("Failed to use Call") + } if resp.Data[0].([]interface{})[0].(uint64) != 2 { t.Errorf("result is not {{1}} : %v", resp.Data) } resp, err = conn.Call17("simple_incr", []interface{}{1}) + if err != nil { + t.Errorf("Failed to use Call17") + } if resp.Data[0].(uint64) != 2 { t.Errorf("result is not {{1}} : %v", resp.Data) } @@ -649,7 +658,7 @@ func TestClient(t *testing.T) { t.Errorf("Failed to Eval: %s", err.Error()) } if resp == nil { - t.Errorf("Response is nil after Eval") + t.Fatalf("Response is nil after Eval") } if len(resp.Data) < 1 { t.Errorf("Response.Data is empty after Eval") @@ -660,6 +669,7 @@ func TestClient(t *testing.T) { } } +//nolint: ineffassign,staticcheck func TestSchema(t *testing.T) { var err error var conn *Connection @@ -670,8 +680,7 @@ func TestSchema(t *testing.T) { return } if conn == nil { - t.Errorf("conn is nil after Connect") - return + t.Fatalf("conn is nil after Connect") } defer conn.Close() @@ -807,7 +816,7 @@ func TestSchema(t *testing.T) { ifield1 := index3.Fields[0] ifield2 := index3.Fields[1] if ifield1 == nil || ifield2 == nil { - t.Errorf("index field is nil") + t.Fatalf("index field is nil") } if ifield1.Id != 1 || ifield2.Id != 2 { t.Errorf("index field has incorrect Id") @@ -854,8 +863,7 @@ func TestClientNamed(t *testing.T) { return } if conn == nil { - t.Errorf("conn is nil after Connect") - return + t.Fatalf("conn is nil after Connect") } defer conn.Close() @@ -864,6 +872,9 @@ func TestClientNamed(t *testing.T) { if err != nil { t.Errorf("Failed to Insert: %s", err.Error()) } + if resp.Code != 0 { + t.Errorf("Failed to Insert: wrong code returned %d", resp.Code) + } // Delete resp, err = conn.Delete(spaceName, indexName, []interface{}{uint(1001)}) @@ -916,6 +927,9 @@ func TestClientNamed(t *testing.T) { if err != nil { t.Errorf("Failed to Replace: %s", err.Error()) } + if resp.Code != 0 { + t.Errorf("Failed to Replace: wrong code returned %d", resp.Code) + } } resp, err = conn.Select(spaceName, indexName, 0, 1, IterEq, []interface{}{uint(1010)}) if err != nil { @@ -946,8 +960,7 @@ func TestComplexStructs(t *testing.T) { return } if conn == nil { - t.Errorf("conn is nil after Connect") - return + t.Fatalf("conn is nil after Connect") } defer conn.Close() diff --git a/test_helpers/main.go b/test_helpers/main.go index ad45e00d9..677d89e04 100644 --- a/test_helpers/main.go +++ b/test_helpers/main.go @@ -144,8 +144,6 @@ func IsTarantoolVersionLess(majorMin uint64, minorMin uint64, patchMin uint64) ( } else { return patch < patchMin, nil } - - return false, nil } // StartTarantool starts a tarantool instance for tests diff --git a/uuid/uuid_test.go b/uuid/uuid_test.go index b8987b0bc..5921a4de7 100644 --- a/uuid/uuid_test.go +++ b/uuid/uuid_test.go @@ -96,7 +96,7 @@ func TestSelect(t *testing.T) { t.Errorf("UUID select failed: %s", errSel.Error()) } if resp == nil { - t.Errorf("Response is nil after Select") + t.Fatalf("Response is nil after Select") } tupleValueIsId(t, resp.Data, id) @@ -131,7 +131,7 @@ func TestReplace(t *testing.T) { t.Errorf("UUID replace failed: %s", errRep) } if respRep == nil { - t.Errorf("Response is nil after Replace") + t.Fatalf("Response is nil after Replace") } tupleValueIsId(t, respRep.Data, id) @@ -140,7 +140,7 @@ func TestReplace(t *testing.T) { t.Errorf("UUID select failed: %s", errSel) } if respSel == nil { - t.Errorf("Response is nil after Select") + t.Fatalf("Response is nil after Select") } tupleValueIsId(t, respSel.Data, id) }