From 27c67aee3d3cf41d4ff7afb292e08f4464ced39d Mon Sep 17 00:00:00 2001 From: go-jet Date: Mon, 16 Feb 2026 13:04:00 +0100 Subject: [PATCH] Fix false positive security scan issues. --- generator/mysql/mysql_generator.go | 7 ++++--- generator/postgres/postgres_generator.go | 7 ++++--- postgres/interval_literal.go | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/generator/mysql/mysql_generator.go b/generator/mysql/mysql_generator.go index fe2fa2a..2ecbf9f 100644 --- a/generator/mysql/mysql_generator.go +++ b/generator/mysql/mysql_generator.go @@ -16,9 +16,10 @@ const mysqlMaxConns = 10 // DBConnection contains MySQL connection details type DBConnection struct { - Host string - Port int - User string + Host string + Port int + User string + // #nosec G117 -- password is used only for the local development Password string Params string diff --git a/generator/postgres/postgres_generator.go b/generator/postgres/postgres_generator.go index 196840e..b806f98 100644 --- a/generator/postgres/postgres_generator.go +++ b/generator/postgres/postgres_generator.go @@ -15,9 +15,10 @@ import ( // DBConnection contains postgres connection details type DBConnection struct { - Host string - Port int - User string + Host string + Port int + User string + // #nosec G117 -- password is used only for the local development Password string SslMode string Params string diff --git a/postgres/interval_literal.go b/postgres/interval_literal.go index 3b320ca..7a88912 100644 --- a/postgres/interval_literal.go +++ b/postgres/interval_literal.go @@ -42,6 +42,7 @@ func INTERVAL(quantityAndUnit ...quantityAndUnit) IntervalExpression { for i := 0; i < len(quantityAndUnit); i += 2 { quantity := strconv.FormatFloat(quantityAndUnit[i], 'f', -1, 64) + // #nosec G602 -- false positive guarded by even-length check above and i+1 < n in loop unitString := unitToString(quantityAndUnit[i+1]) fields = append(fields, quantity+" "+unitString) }