Skip to content

Commit c187edb

Browse files
committed
refactor: fix lint error
1 parent 307621d commit c187edb

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

cmd/sigo/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func run(definition pdef, logs logs) {
146146
}
147147

148148
sink := infra.NewJSONLineSink(os.Stdout)
149-
149+
150150
var debugger sigo.Debugger
151151

152152
if logs.info != "" {
@@ -156,7 +156,6 @@ func run(definition pdef, logs logs) {
156156
}
157157

158158
var cpuProfiler interface{ Stop() }
159-
160159
if logs.profiling {
161160
cpuProfiler = profile.Start(profile.ProfilePath("."))
162161
}

pkg/sigo/driver.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func Anonymize(source RecordSource, factory GeneralizerFactory,
2929
generalizer := factory.New(k, l, dim, source.QuasiIdentifer())
3030
count := 0
3131
records := []Record{}
32+
3233
log.Info().Msg("Reading source")
3334

3435
for source.Next() {
@@ -43,6 +44,7 @@ func Anonymize(source RecordSource, factory GeneralizerFactory,
4344

4445
validator := NewFloat64DataValidator(records, source.QuasiIdentifer())
4546
err := validator.Validation()
47+
4648
if err != nil {
4749
return err
4850
}

pkg/sigo/driver_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ func TestDataValidatorShouldReturnErrorWithNullValue(t *testing.T) {
167167

168168
func TestDataValidatorShouldReturnErrorWithList(t *testing.T) {
169169
t.Parallel()
170-
170+
//nolint: go-golangci-lint
171171
sourceText := `{"fruit":[0,1],"taille":[1,2],"poids":[1,2],"meurtre":0,"natation":[0,1],"course":[0,1],"voltige":[0,1],"animal":"souris"}
172-
{"fruit":[0,1],"taille":[1,2],"poids":[1,2],"meurtre":0,"natation":[0,1],"course":[0,1],"voltige":[0,1],"animal":"saumon"}
173172
{"fruit":[0,1],"taille":[1,2],"poids":[1,2],"meurtre":1,"natation":[0,1],"course":[0,1],"voltige":[0,1],"animal":"chouette"}
174173
{"fruit":[0,1],"taille":[1,2],"poids":null,"meurtre":0,"natation":[0,1],"course":[0,1],"voltige":[0,1],"animal":"canard"}
175174
{"fruit":[0,1],"taille":[3,3],"poids":[3,4],"meurtre":1,"natation":[0,1],"course":[0,1],"voltige":[0,1],"animal":"loup"}

pkg/sigo/validator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func NewFloat64DataValidator(records []Record, quasiIdentifers []string) Float64
3131
return Float64DataValidator{records: records, quasiIdentifers: quasiIdentifers}
3232
}
3333

34-
// nolint: cyclop
3534
func (v Float64DataValidator) Validation() error {
3635
for _, record := range v.records {
3736
row := record.Row()
@@ -44,8 +43,10 @@ func (v Float64DataValidator) Validation() error {
4443
return err
4544
}
4645

46+
//nolint: gocritic
4747
switch t := row[key].(type) {
4848
case bool:
49+
//nolint: goerr113
4950
err := fmt.Errorf("unsupported type: %T", t)
5051

5152
return err

0 commit comments

Comments
 (0)