gosec: G404 - Use of weak rng

math/rand is good enough for uuids. disabling rule locally.
This commit is contained in:
Juan Abia 2021-12-02 15:09:46 +01:00 committed by Alexander Todorov
parent 4f91a2cc81
commit 8136209d17
10 changed files with 22 additions and 0 deletions

View file

@ -564,6 +564,8 @@ func TestBlueprintsChanges(t *testing.T) {
api, _ := createWeldrAPI(tempdir, rpmmd_mock.BaseFixture)
rand.Seed(time.Now().UnixNano())
// math/rand is good enough in this case
/* #nosec G404 */
id := strconv.Itoa(rand.Int())
ignoreFields := []string{"commit", "timestamp"}
@ -606,6 +608,8 @@ func TestBlueprintsUndo(t *testing.T) {
api, _ := createWeldrAPI(tempdir, rpmmd_mock.BaseFixture)
rand.Seed(time.Now().UnixNano())
// math/rand is good enough in this case
/* #nosec G404 */
id := strconv.Itoa(rand.Int())
ignoreFields := []string{"commit", "timestamp"}