Skip to content

Commit

Permalink
fix: use int64 for large values in structs for compatibility with 32b…
Browse files Browse the repository at this point in the history
…it devices (#250)

Co-authored-by: Lorenzo Zolfanelli <[email protected]>
  • Loading branch information
zolfariot and Lorenzo Zolfanelli authored Apr 27, 2024
1 parent c297d3c commit 84b4b68
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions pkg/restic/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,26 @@ type BackupProgressEntry struct {
Item string `json:"item"`

// Summary fields
FilesNew int `json:"files_new"`
FilesChanged int `json:"files_changed"`
FilesUnmodified int `json:"files_unmodified"`
DirsNew int `json:"dirs_new"`
DirsChanged int `json:"dirs_changed"`
DirsUnmodified int `json:"dirs_unmodified"`
DataBlobs int `json:"data_blobs"`
TreeBlobs int `json:"tree_blobs"`
DataAdded int `json:"data_added"`
TotalFilesProcessed int `json:"total_files_processed"`
TotalBytesProcessed int `json:"total_bytes_processed"`
FilesNew int64 `json:"files_new"`
FilesChanged int64 `json:"files_changed"`
FilesUnmodified int64 `json:"files_unmodified"`
DirsNew int64 `json:"dirs_new"`
DirsChanged int64 `json:"dirs_changed"`
DirsUnmodified int64 `json:"dirs_unmodified"`
DataBlobs int64 `json:"data_blobs"`
TreeBlobs int64 `json:"tree_blobs"`
DataAdded int64 `json:"data_added"`
TotalFilesProcessed int64 `json:"total_files_processed"`
TotalBytesProcessed int64 `json:"total_bytes_processed"`
TotalDuration float64 `json:"total_duration"`
SnapshotId string `json:"snapshot_id"`

// Status fields
PercentDone float64 `json:"percent_done"`
TotalFiles int `json:"total_files"`
FilesDone int `json:"files_done"`
TotalBytes int `json:"total_bytes"`
BytesDone int `json:"bytes_done"`
TotalFiles int64 `json:"total_files"`
FilesDone int64 `json:"files_done"`
TotalBytes int64 `json:"total_bytes"`
BytesDone int64 `json:"bytes_done"`
CurrentFiles []string `json:"current_files"`
}

Expand Down Expand Up @@ -146,10 +146,10 @@ type LsEntry struct {
Name string `json:"name"`
Type string `json:"type"`
Path string `json:"path"`
Uid int `json:"uid"`
Gid int `json:"gid"`
Size int `json:"size"`
Mode int `json:"mode"`
Uid int64 `json:"uid"`
Gid int64 `json:"gid"`
Size int64 `json:"size"`
Mode int64 `json:"mode"`
Mtime string `json:"mtime"`
Atime string `json:"atime"`
Ctime string `json:"ctime"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/restic/restic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestResticBackup(t *testing.T) {
name string
opts []GenericOption
paths []string
files int // expected files at the end of the backup
files int64 // expected files at the end of the backup
wantErr bool
}{
{
Expand Down

0 comments on commit 84b4b68

Please sign in to comment.