Delete unneccessary item, update gitignore to omit macOS Finder config nonsense

This commit is contained in:
SuperMarioDaBom 2025-02-21 09:59:16 -08:00
parent 241997ef9b
commit b5fe4ebf16
2 changed files with 4 additions and 40 deletions

5
.gitignore vendored
View File

@ -27,4 +27,7 @@ go.work.sum
build
log
*.pem
*.key
*.key
# macOS nonsense
.DS_Store

View File

@ -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)
}