Skip to content

Commit d2b3d82

Browse files
committed
clairctl: Scan the pointer to the pointer of the bool
I believe that even though ok is a *bool type, we still need to pass it's address to Scan() otherwise it's akin to ok := bool; Scan(&ok), which I believe only supports binary values and not nullable bools. Signed-off-by: crozzy <[email protected]>
1 parent a02a0f2 commit d2b3d82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/clairctl/admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func adminPre470(c *cli.Context) error {
120120
const mkindex = `CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_manifest_index_manifest_id ON manifest_index(manifest_id);`
121121
const reindex = `REINDEX INDEX CONCURRENTLY idx_manifest_index_manifest_id;`
122122
var ok *bool
123-
if err := conn.QueryRow(ctx, checkindex).Scan(ok); err != nil {
123+
if err := conn.QueryRow(ctx, checkindex).Scan(&ok); err != nil {
124124
if !errors.Is(err, pgx.ErrNoRows) {
125125
zlog.Info(ctx).
126126
AnErr("index_check", err).

0 commit comments

Comments
 (0)