Fixed error when setting max file size on 32-Bit systems
This commit is contained in:
@ -763,7 +763,7 @@ func (err ErrTaskAttachmentDoesNotExist) HTTPError() web.HTTPError {
|
||||
|
||||
// ErrTaskAttachmentIsTooLarge represents an error where the user tries to relate a task with itself
|
||||
type ErrTaskAttachmentIsTooLarge struct {
|
||||
Size int64
|
||||
Size uint64
|
||||
}
|
||||
|
||||
// IsErrTaskAttachmentIsTooLarge checks if an error is ErrTaskAttachmentIsTooLarge.
|
||||
|
@ -47,7 +47,7 @@ func (TaskAttachment) TableName() string {
|
||||
|
||||
// NewAttachment creates a new task attachment
|
||||
// Note: I'm not sure if only accepting an io.ReadCloser and not an afero.File or os.File instead is a good way of doing things.
|
||||
func (ta *TaskAttachment) NewAttachment(f io.ReadCloser, realname string, realsize int64, a web.Auth) error {
|
||||
func (ta *TaskAttachment) NewAttachment(f io.ReadCloser, realname string, realsize uint64, a web.Auth) error {
|
||||
|
||||
// Store the file
|
||||
file, err := files.Create(f, realname, realsize, a)
|
||||
|
@ -111,7 +111,7 @@ func TestTaskAttachment_NewAttachment(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, testuser.ID, ta.File.CreatedByID)
|
||||
assert.Equal(t, "testfile", ta.File.Name)
|
||||
assert.Equal(t, int64(100), ta.File.Size)
|
||||
assert.Equal(t, uint64(100), ta.File.Size)
|
||||
|
||||
// Extra test for max size test
|
||||
}
|
||||
|
Reference in New Issue
Block a user