Skip to content

Commit

Permalink
[operator] fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody committed Dec 8, 2024
1 parent 98ee230 commit e37cf03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/laziness/laziness.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewWithRetry[T any](f func() (T, error)) Laziness[T] {
func (l *lazinessImpl[T]) Get() (T, error) {
if atomic.LoadUint32(&l.done) == 0 {
}
return nil, nil

Check failure on line 39 in pkg/laziness/laziness.go

View workflow job for this annotation

GitHub Actions / Go Test

cannot use nil as T value in return statement
}

func (l *lazinessImpl[T]) doSlow() (T, error) {
Expand All @@ -44,7 +45,7 @@ func (l *lazinessImpl[T]) doSlow() (T, error) {
if l.done == 0 {
done := uint32(1)
defer func() {
atomic.StoreInt32(&l.done, done)
atomic.StoreUint32(&l.done, done)
}()
res, err := l.getter()
if l.retry && err != nil {
Expand Down

0 comments on commit e37cf03

Please sign in to comment.