Merge pull request #564 from go-jet/sec-fix
Fix false positive security scan issues.
This commit is contained in:
commit
6c2abe9dd1
3 changed files with 9 additions and 6 deletions
|
|
@ -16,9 +16,10 @@ const mysqlMaxConns = 10
|
||||||
|
|
||||||
// DBConnection contains MySQL connection details
|
// DBConnection contains MySQL connection details
|
||||||
type DBConnection struct {
|
type DBConnection struct {
|
||||||
Host string
|
Host string
|
||||||
Port int
|
Port int
|
||||||
User string
|
User string
|
||||||
|
// #nosec G117 -- password is used only for the local development
|
||||||
Password string
|
Password string
|
||||||
Params string
|
Params string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,10 @@ import (
|
||||||
|
|
||||||
// DBConnection contains postgres connection details
|
// DBConnection contains postgres connection details
|
||||||
type DBConnection struct {
|
type DBConnection struct {
|
||||||
Host string
|
Host string
|
||||||
Port int
|
Port int
|
||||||
User string
|
User string
|
||||||
|
// #nosec G117 -- password is used only for the local development
|
||||||
Password string
|
Password string
|
||||||
SslMode string
|
SslMode string
|
||||||
Params string
|
Params string
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ func INTERVAL(quantityAndUnit ...quantityAndUnit) IntervalExpression {
|
||||||
|
|
||||||
for i := 0; i < len(quantityAndUnit); i += 2 {
|
for i := 0; i < len(quantityAndUnit); i += 2 {
|
||||||
quantity := strconv.FormatFloat(quantityAndUnit[i], 'f', -1, 64)
|
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])
|
unitString := unitToString(quantityAndUnit[i+1])
|
||||||
fields = append(fields, quantity+" "+unitString)
|
fields = append(fields, quantity+" "+unitString)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue