Files
codeql/go/ql/test/query-tests/Security/CWE-798/AlertSuppressionExample.go
2026-06-11 07:15:54 +02:00

16 lines
293 B
Go

package main
import "testing"
func login(user, password string) bool {
return true
}
func TestLogin(t *testing.T) {
user := "testuser"
password := "horsebatterystaplecorrect" // $ Alert // lgtm[go/hardcoded-credentials]
if !login(user, password) {
t.Errorf("Login test failed.")
}
}