From 4559d58ced7f6576df2d2f932e8faeabe712c860 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 3 Oct 2018 09:20:29 +0000 Subject: [PATCH] database/sql: improve unimplemented LastInsertId error message The old one was rather confusing - it makes it sound like the user has done something wrong. Change-Id: Ibc7411f4f1d5f6c66fbcaac64bb05b0743354418 GitHub-Last-Rev: 09290accddb23848ee80d641e4f2bcf6ef686e01 GitHub-Pull-Request: golang/go#27979 Reviewed-on: https://go-review.googlesource.com/c/139102 Reviewed-by: Brad Fitzpatrick Reviewed-by: Daniel Theophanes Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/database/sql/driver/driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/sql/driver/driver.go b/src/database/sql/driver/driver.go index 1e54b4cf2cf..70b3ddc4703 100644 --- a/src/database/sql/driver/driver.go +++ b/src/database/sql/driver/driver.go @@ -469,7 +469,7 @@ type RowsAffected int64 var _ Result = RowsAffected(0) func (RowsAffected) LastInsertId() (int64, error) { - return 0, errors.New("no LastInsertId available") + return 0, errors.New("LastInsertId is not supported by this driver") } func (v RowsAffected) RowsAffected() (int64, error) {