mirror of
https://github.com/PretendoNetwork/wiiu-chat-secure.git
synced 2026-03-21 17:44:55 -05:00
Delete unneccessary item, update gitignore to omit macOS Finder config nonsense
This commit is contained in:
parent
241997ef9b
commit
b5fe4ebf16
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -27,4 +27,7 @@ go.work.sum
|
|||
build
|
||||
log
|
||||
*.pem
|
||||
*.key
|
||||
*.key
|
||||
|
||||
# macOS nonsense
|
||||
.DS_Store
|
||||
|
|
@ -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)
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user