diff options
| author | Jonathan Amsterdam <jba@google.com> | 2020-05-20 07:11:36 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2020-05-20 16:00:14 +0000 |
| commit | a7ed1b9d8827818fcdbb6f0e2aba01e0a6f12d93 (patch) | |
| tree | e0fe0002b24f0037876526b3855e7a5fbd009fbf /internal/database/database.go | |
| parent | ed005bec92f8136550a1236d39edcbe4bcec7f90 (diff) | |
| download | go-x-pkgsite-a7ed1b9d8827818fcdbb6f0e2aba01e0a6f12d93.tar.xz | |
many: use nil instead of empty slice
It's more idiomatic in Go to use nil rather than an empty slice, in
situations where either works.
Change-Id: I1f85ba39772b873b7b35ca35837fecddd3c33ba0
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/750950
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Diffstat (limited to 'internal/database/database.go')
| -rw-r--r-- | internal/database/database.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/database/database.go b/internal/database/database.go index 9a27ebce..e9bab6b8 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -235,7 +235,7 @@ func buildInsertQuery(table string, columns, returningColumns []string, values [ // When the end of a set is reached, write it to the query // builder and reset placeholders. fmt.Fprintf(&b, "(%s)", strings.Join(placeholders, ", ")) - placeholders = []string{} + placeholders = nil // Do not add a comma delimiter after the last set of values. if i == len(values) { |
