common-errors.go: exported all error functions.
builtin-string.go: renamed all functions from somthingStr() to strSomething()
This commit is contained in:
+4
-4
@@ -70,7 +70,7 @@ func makeGeneratingFraction(s string) (f *FractionType, err error) {
|
||||
}
|
||||
for _, c := range dec[0:lsd] {
|
||||
if c < '0' || c > '9' {
|
||||
return nil, errExpectedGot("fract", "digit", c)
|
||||
return nil, ErrExpectedGot("fract", "digit", c)
|
||||
}
|
||||
num = num*10 + int64(c-'0')
|
||||
den = den * 10
|
||||
@@ -81,7 +81,7 @@ func makeGeneratingFraction(s string) (f *FractionType, err error) {
|
||||
mul := int64(1)
|
||||
for _, c := range subParts[0] {
|
||||
if c < '0' || c > '9' {
|
||||
return nil, errExpectedGot("fract", "digit", c)
|
||||
return nil, ErrExpectedGot("fract", "digit", c)
|
||||
}
|
||||
num = num*10 + int64(c-'0')
|
||||
sub = sub*10 + int64(c-'0')
|
||||
@@ -94,7 +94,7 @@ func makeGeneratingFraction(s string) (f *FractionType, err error) {
|
||||
p := subParts[1][0 : len(subParts[1])-1]
|
||||
for _, c := range p {
|
||||
if c < '0' || c > '9' {
|
||||
return nil, errExpectedGot("fract", "digit", c)
|
||||
return nil, ErrExpectedGot("fract", "digit", c)
|
||||
}
|
||||
num = num*10 + int64(c-'0')
|
||||
den = den*10 + 9
|
||||
@@ -212,7 +212,7 @@ func anyToFract(v any) (f *FractionType, err error) {
|
||||
}
|
||||
}
|
||||
if f == nil {
|
||||
err = errExpectedGot("fract", TypeFraction, v)
|
||||
err = ErrExpectedGot("fract", TypeFraction, v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user