bumping test coverage, adding more tests.

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2023-06-16 05:25:26 -04:00
committed by quobix
parent 4b2c0a9b17
commit db27267e09
5 changed files with 75 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ package low
import (
"crypto/sha256"
"fmt"
"reflect"
"strconv"
"strings"
@@ -685,5 +686,9 @@ func GenerateHashString(v any) string {
return fmt.Sprintf(HASH, h.Hash())
}
}
// if we get here, we're a primitive, check if we're a pointer and de-point
if reflect.TypeOf(v).Kind() == reflect.Ptr {
v = reflect.ValueOf(v).Elem().Interface()
}
return fmt.Sprintf(HASH, sha256.Sum256([]byte(fmt.Sprint(v))))
}