engine: util: Clean up error messages
This commit is contained in:
@@ -37,7 +37,7 @@ import (
|
|||||||
// both of the same value, then this errors.
|
// both of the same value, then this errors.
|
||||||
func StrPtrCmp(x, y *string) error {
|
func StrPtrCmp(x, y *string) error {
|
||||||
if (x == nil) != (y == nil) { // xor
|
if (x == nil) != (y == nil) { // xor
|
||||||
return fmt.Errorf("the Content differs")
|
return fmt.Errorf("the ptr differs")
|
||||||
}
|
}
|
||||||
if x != nil && y != nil {
|
if x != nil && y != nil {
|
||||||
if *x != *y { // compare the strings
|
if *x != *y { // compare the strings
|
||||||
@@ -51,11 +51,11 @@ func StrPtrCmp(x, y *string) error {
|
|||||||
// do not contain identical strings in the same order, then this errors.
|
// do not contain identical strings in the same order, then this errors.
|
||||||
func StrListCmp(x, y []string) error {
|
func StrListCmp(x, y []string) error {
|
||||||
if len(x) != len(y) {
|
if len(x) != len(y) {
|
||||||
return fmt.Errorf("length differs")
|
return fmt.Errorf("the length differs")
|
||||||
}
|
}
|
||||||
for i := range x {
|
for i := range x {
|
||||||
if x[i] != y[i] {
|
if x[i] != y[i] {
|
||||||
return fmt.Errorf("the elements at position %d differed", i)
|
return fmt.Errorf("the elements at position %d differ", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user