diff --git a/.gitignore b/.gitignore index c42ec53..c33a953 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,7 @@ go.work.sum build log *.pem -*.key \ No newline at end of file +*.key + +# macOS nonsense +.DS_Store \ No newline at end of file diff --git a/types/pq_uint8_array.go b/types/pq_uint8_array.go deleted file mode 100644 index d296f69..0000000 --- a/types/pq_uint8_array.go +++ /dev/null @@ -1,39 +0,0 @@ -package types - -import ( - "fmt" - "strconv" - "strings" -) - -type PQUInt8Array struct { - Value []uint8 -} - -func (array *PQUInt8Array) Scan(src interface{}) error { - - switch src := src.(type) { - case []uint8: - // * Postgres stores uint8 slices as - // * a string in the format: - // * {1,2,3,4} - str := string(src) - str = strings.TrimSuffix(str, "}") - str = strings.TrimPrefix(str, "{") - strSlice := strings.Split(str, ",") - - for i := 0; i < len(strSlice); i++ { - number, err := strconv.Atoi(strSlice[i]) - - if err != nil { - return err - } - - array.Value = append(array.Value, uint8(number)) - } - - return nil - } - - return fmt.Errorf("Type %T does not have a path to convert to UInt8Array", src) -}