From 61ed9c948707e5607b1d13171a0dfe268f0621c6 Mon Sep 17 00:00:00 2001 From: jwierzbo Date: Tue, 22 Mar 2022 22:10:10 +0100 Subject: [PATCH] TG-235 Fix cursor.warnings field type --- CHANGELOG.md | 1 + cursor_impl.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c4abec8..3ce59e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [master](https://github.com/arangodb/go-driver/tree/master) (N/A) - Add support for `exclusive` field for transaction options - Fix cursor executionTime statistics getter +- Fix cursor warnings field type ## [1.3.0](https://github.com/arangodb/go-driver/tree/v1.3.0) (2022-03-17) - Disallow unknown fields feature diff --git a/cursor_impl.go b/cursor_impl.go index 45963d35..91026969 100644 --- a/cursor_impl.go +++ b/cursor_impl.go @@ -92,7 +92,12 @@ type cursorExtra struct { Stats cursorStats `json:"stats,omitempty"` Profile cursorProfile `json:"profile,omitempty"` Plan *cursorPlan `json:"plan,omitempty"` - Warnings []string `json:"warnings,omitempty"` + Warnings []warn `json:"warnings,omitempty"` +} + +type warn struct { + Code int `json:"code"` + Message string `json:"message"` } func (c cursorExtra) GetStatistics() QueryStatistics {