chore: change size of file to int64

This commit is contained in:
Noah Hsu 2022-06-23 15:57:36 +08:00
parent c3040fdfc3
commit fd5c3e831d
3 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ func (m *Monitor) Complete() error {
Name: fmt.Sprintf("transfer %s to %s", file.Path, m.dstDirPath),
Func: func(tsk *task.Task[uint64]) error {
defer wg.Done()
size, _ := strconv.ParseUint(file.Length, 10, 64)
size, _ := strconv.ParseInt(file.Length, 10, 64)
mimetype := mime.TypeByExtension(path.Ext(file.Path))
if mimetype == "" {
mimetype = "application/octet-stream"

View File

@ -6,7 +6,7 @@ import (
)
type Obj interface {
GetSize() uint64
GetSize() int64
GetName() string
ModTime() time.Time
IsDir() bool

View File

@ -5,7 +5,7 @@ import "time"
type Object struct {
ID string
Name string
Size uint64
Size int64
Modified time.Time
IsFolder bool
}
@ -14,7 +14,7 @@ func (f Object) GetName() string {
return f.Name
}
func (f Object) GetSize() uint64 {
func (f Object) GetSize() int64 {
return f.Size
}