Skip to content

Commit

Permalink
fix: prevent panic during golang atomic operation when running on arm…
Browse files Browse the repository at this point in the history
…32 bit cpu (#105)
  • Loading branch information
reubenmiller authored Feb 14, 2022
1 parent d49bdb5 commit f353191
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/iterator/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

// FuncIterator is generic iterator which executes a function on every iteration
type FuncIterator struct {
next func(int64) (string, error)
currentIndex int64 // access atomically (must be defined at the top)
endIndex int64
currentIndex int64
next func(int64) (string, error)
}

// GetNext will count through the values and return them one by one
Expand Down
4 changes: 2 additions & 2 deletions pkg/iterator/repeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

// RepeatIterator is an empty iterator that always returns no value
type RepeatIterator struct {
value string
currentIndex int64 // access atomically (must be defined at the top)
endIndex int64
currentIndex int64
value string
}

// GetNext will count through the values and return them one by one
Expand Down
2 changes: 1 addition & 1 deletion pkg/iterator/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

// SliceIterator is iterates over a given array
type SliceIterator struct {
currentIndex int64 // access atomically (must be defined at the top)
values []string
currentIndex int64
}

// GetNext will count through the values and return them one by one
Expand Down

0 comments on commit f353191

Please sign in to comment.