diff options
| author | Jonathan Amsterdam <jba@google.com> | 2022-03-04 13:48:07 -0500 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2022-03-07 15:51:22 +0000 |
| commit | 2beb68e7d8664b09d87cabe67943dc13b1131207 (patch) | |
| tree | 048de29f816f1cbd73bac714abbdd2038dc9c49c /internal/postgres/insert_module_test.go | |
| parent | 65d33554b34b666d37b22bed7de136b562d5dba8 (diff) | |
| download | go-x-pkgsite-2beb68e7d8664b09d87cabe67943dc13b1131207.tar.xz | |
internal/database: use generics for Collect functions
Reimplement some reflection-based collection functions to
use generics.
In some cases we still need reflection, but at least we
can provide a type-safe wrapper with generics.
Change-Id: Id95949a7a22ee687166ecdfc1191150d79568889
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/389657
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@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 5e9d8efc..f4ac477b 100644 --- a/internal/postgres/insert_module_test.go +++ b/internal/postgres/insert_module_test.go @@ -693,7 +693,7 @@ func TestReconcileSearch(t *testing.T) { t.Fatalf("got version %q, synopsis %q, want %q for both", gotVersion, gotSynopsis, wantVersion) } - gotImports, err := testDB.db.CollectStrings(ctx, ` + gotImports, err := database.Collect1[string](ctx, testDB.db, ` SELECT to_path FROM imports_unique WHERE from_path = $1 |
