Skip to content

Commit

Permalink
fix: update tests/slo/...
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulYakow committed May 2, 2024
1 parent de0e649 commit 4f9373a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/slo/database/sql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ func main() {

wg.Wait()
default:
panic(fmt.Errorf("unknown mode: %v", cfg.Mode))
panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113
}
}
2 changes: 1 addition & 1 deletion tests/slo/gorm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ func main() {

wg.Wait()
default:
panic(fmt.Errorf("unknown mode: %v", cfg.Mode))
panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113
}
}
2 changes: 1 addition & 1 deletion tests/slo/native/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ func main() {

wg.Wait()
default:
panic(fmt.Errorf("unknown mode: %v", cfg.Mode))
panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113
}
}
2 changes: 1 addition & 1 deletion tests/slo/native/table/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ func main() {

wg.Wait()
default:
panic(fmt.Errorf("unknown mode: %v", cfg.Mode))
panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113
}
}
2 changes: 1 addition & 1 deletion tests/slo/native/table/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (s *Storage) Read(ctx context.Context, entryID generator.RowID) (_ generato
}

if !res.NextRow() {
return fmt.Errorf("entry not found, id = %v", entryID)
return fmt.Errorf("entry not found, id = %v", entryID) //nolint:goerr113
}

err = res.ScanNamed(
Expand Down
2 changes: 1 addition & 1 deletion tests/slo/xorm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ func main() {

wg.Wait()
default:
panic(fmt.Errorf("unknown mode: %v", cfg.Mode))
panic(fmt.Errorf("unknown mode: %v", cfg.Mode)) //nolint:goerr113
}
}
4 changes: 3 additions & 1 deletion tests/slo/xorm/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
writeTx = table.SerializableReadWriteTxControl(
table.CommitTx(),
)

errEntryNotFound = errors.New("get entry: entry not found")
)

type mapper struct {
Expand Down Expand Up @@ -133,7 +135,7 @@ func (s *Storage) Read(ctx context.Context, id generator.RowID) (row generator.R
return fmt.Errorf("get entry error: %w", err)
}
if !has {
return errors.New("get entry: entry not found")
return errEntryNotFound
}

return nil
Expand Down

0 comments on commit 4f9373a

Please sign in to comment.