Skip to content

Commit 353473d

Browse files
committed
separate sensitive column validation into own function
1 parent 5a282db commit 353473d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

plugin/testing_validation.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ func ValidateNoEmptyColumns(t *testing.T, tables schema.Tables, messages message
1414
if len(emptyColumns) > 0 {
1515
t.Fatalf("found empty column(s): %v in %s", emptyColumns, table.Name)
1616
}
17+
}
18+
}
19+
20+
func ValidateSensitivColumns(t *testing.T, tables schema.Tables) {
21+
for _, table := range tables.FlattenTables() {
1722
nonMatchingColumns, nonMatchingJSONColumns := schema.FindNotMatchingSensitiveColumns(table)
1823
if len(nonMatchingColumns) > 0 {
1924
t.Fatalf("found non-matching sensitive column(s): %v in %s", nonMatchingColumns, table.Name)

schema/validators.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func FindNotMatchingSensitiveColumns(table *Table) (nonMatchingColumns []string,
4646
if len(table.SensitiveColumns) == 0 {
4747
return []string{}, []string{}
4848
}
49-
5049
nonMatchingColumns = make([]string, 0)
5150
nonMatchingJSONColumns = make([]string, 0)
5251
tableColumns := table.Columns.Names()

0 commit comments

Comments
 (0)