Skip to content

Commit

Permalink
Ensure 8-byte alignment of progressbar counters (gopasspw#1855)
Browse files Browse the repository at this point in the history
Fixes gopasspw#1854

RELEASE_NOTES=[BUGFIX] Fix progress bar on 32 bit archs

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
  • Loading branch information
dominikschulz authored Mar 20, 2021
1 parent 3003e6e commit a259c18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/termio/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ var (

// ProgressBar is a gopass progress bar
type ProgressBar struct {
hidden bool
// keep both int64 fields at the top to ensure correct
// 8-byte alignment on 32 bit systems. See https://golang.org/pkg/sync/atomic/#pkg-note-BUG
// and https://github.com/golang/go/issues/36606
total int64
current int64
hidden bool
mutex chan struct{}
lastUpd time.Time
}
Expand Down

0 comments on commit a259c18

Please sign in to comment.