Files
codeql/ql/test/query-tests/Security/CWE-089/StringBreakGood.go
2020-02-03 09:01:40 +00:00

16 lines
313 B
Go

package main
import (
"encoding/json"
sq "github.com/Masterminds/squirrel"
)
func saveGood(id string, version interface{}) {
versionJSON, _ := json.Marshal(version)
sq.StatementBuilder.
Insert("resources").
Columns("resource_id", "version_md5").
Values(id, sq.Expr("md5(?)", versionJSON)).
Exec()
}