Skip to content

Commit 2fae9b0

Browse files
authored
chore(scripts/dbgen): only add arg validation for dbfake (#8578)
1 parent 98164f6 commit 2fae9b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/dbgen/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ func orderAndStubDatabaseFunctions(filePath, receiver, structName string, stub f
220220

221221
for _, fn := range funcs {
222222
var bodyStmts []dst.Stmt
223-
if len(fn.Func.Params.List) == 2 && fn.Func.Params.List[1].Names[0].Name == "arg" {
223+
224+
// Add input validation, only relevant for dbfake.
225+
if strings.Contains(filePath, "dbfake") && len(fn.Func.Params.List) == 2 && fn.Func.Params.List[1].Names[0].Name == "arg" {
224226
/*
225227
err := validateDatabaseType(arg)
226228
if err != nil {

0 commit comments

Comments
 (0)