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

View File

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

View File

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