diff options
| author | Jonathan Amsterdam <jba@google.com> | 2021-02-11 07:37:15 -0500 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2021-02-11 21:22:26 +0000 |
| commit | 9fde5edf4cfaa189516a95a50c8ce0d8646b43b9 (patch) | |
| tree | cd2756cb34fbcf56b05f8d6a877a11715a71dff4 /internal/postgres/insert_module_test.go | |
| parent | 5b19d6e1bc9ec5e2b3649188a26c139d7c03a7e8 (diff) | |
| download | go-x-pkgsite-9fde5edf4cfaa189516a95a50c8ce0d8646b43b9.tar.xz | |
internal/postgres: InsertModule returns isLatest
InsertModule reports whether it just inserted the latest version
of a module.
We'll use this information later to determine whether to invalidate
the cache.
Also, rewrite tests to use postgres.MustInsertModule.
For golang/go#44217
Change-Id: I8bed8aa8e86a347a4add85c2b16c549b7ad740f0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/291270
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
| -rw-r--r-- | internal/postgres/insert_module_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go index 7baf1baa..1f362c70 100644 --- a/internal/postgres/insert_module_test.go +++ b/internal/postgres/insert_module_test.go @@ -252,7 +252,7 @@ func TestInsertModuleErrors(t *testing.T) { for _, test := range testCases { t.Run(test.name, func(t *testing.T) { defer ResetTestDB(testDB, t) - if err := testDB.InsertModule(ctx, test.module); !errors.Is(err, test.wantWriteErr) { + if _, err := testDB.InsertModule(ctx, test.module); !errors.Is(err, test.wantWriteErr) { t.Errorf("error: %v, want write error: %v", err, test.wantWriteErr) } }) |
