clean and change type
This commit is contained in:
@@ -41,12 +41,13 @@ func listCartFiles(dir string) ([]CartFileInfo, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
name := e.Name()
|
name := e.Name()
|
||||||
var id int64
|
var idStr string
|
||||||
|
var id uint64
|
||||||
var parseErr error
|
var parseErr error
|
||||||
parts := strings.Split(name, ".")
|
parts := strings.Split(name, ".")
|
||||||
if len(parts) > 1 && parts[1] == "events" {
|
if len(parts) > 1 && parts[1] == "events" {
|
||||||
idStr := parts[0]
|
idStr = parts[0]
|
||||||
id, parseErr = strconv.ParseInt(idStr, 10, 64)
|
id, parseErr = strconv.ParseUint(idStr, 10, 64)
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -59,7 +60,7 @@ func listCartFiles(dir string) ([]CartFileInfo, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
out = append(out, CartFileInfo{
|
out = append(out, CartFileInfo{
|
||||||
ID: uint64(id),
|
ID: idStr,
|
||||||
CartId: cart.CartId(id),
|
CartId: cart.CartId(id),
|
||||||
Size: info.Size(),
|
Size: info.Size(),
|
||||||
Modified: info.ModTime(),
|
Modified: info.ModTime(),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CartFileInfo struct {
|
type CartFileInfo struct {
|
||||||
ID uint64 `json:"id"`
|
ID string `json:"id"`
|
||||||
CartId cart.CartId `json:"cartId"`
|
CartId cart.CartId `json:"cartId"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
Modified time.Time `json:"modified"`
|
Modified time.Time `json:"modified"`
|
||||||
|
|||||||
BIN
data/1.prot
BIN
data/1.prot
Binary file not shown.
BIN
data/4.prot
BIN
data/4.prot
Binary file not shown.
BIN
data/5.prot
BIN
data/5.prot
Binary file not shown.
BIN
data/state.gob
BIN
data/state.gob
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user