Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
taniabogatsch committed Sep 17, 2024
1 parent 09a6124 commit 647811c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ var (
errAppenderClose = errors.New("could not close appender")
errAppenderFlush = errors.New("could not flush appender")

errEmptyName = errors.New("empty name")
errInvalidDecimalWidth = fmt.Errorf("the DECIMAL with must be between 1 and %d", MAX_DECIMAL_WIDTH)
errScaleGreaterThanWidth = errors.New("the DECIMAL scale must not be greater than its width")
errEmptyName = errors.New("empty name")
errInvalidDecimalWidth = fmt.Errorf("the DECIMAL with must be between 1 and %d", MAX_DECIMAL_WIDTH)
errInvalidDecimalScale = errors.New("the DECIMAL scale must be less than or equal to the width")

// Errors not covered in tests.
errConnect = errors.New("could not connect to database")
Expand Down
2 changes: 1 addition & 1 deletion type_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func NewDecimalInfo(width uint8, scale uint8) (TypeInfo, error) {
return nil, getError(errAPI, errInvalidDecimalWidth)
}
if scale > width {
return nil, getError(errAPI, errScaleGreaterThanWidth)
return nil, getError(errAPI, errInvalidDecimalScale)
}

return &typeInfo{
Expand Down
2 changes: 1 addition & 1 deletion type_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestErrTypeInfo(t *testing.T) {
_, err = NewDecimalInfo(42, 20)
testError(t, err, errAPI.Error(), errInvalidDecimalWidth.Error())
_, err = NewDecimalInfo(5, 6)
testError(t, err, errAPI.Error(), errScaleGreaterThanWidth.Error())
testError(t, err, errAPI.Error(), errInvalidDecimalScale.Error())

// Invalid ENUM.
_, err = NewEnumInfo("hello", "hello")
Expand Down

0 comments on commit 647811c

Please sign in to comment.