Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry timestamp read/write in Swift #90

Merged
merged 1 commit into from
Jan 11, 2024
Merged

retry timestamp read/write in Swift #90

merged 1 commit into from
Jan 11, 2024

Conversation

majewsky
Copy link
Contributor

@majewsky majewsky commented Jan 9, 2024

This is based on #89, see comments there.

This is based on a first draft by Sandro that I cleaned up by moving the
retry into a separate function.
if err != nil {
var str string
err := retryUpToThreeTimes(func() error {
var err error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a thing in go to name this err2 to reduce confusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have sometimes used alternative variable names if I need to be able to access the older error within the same scope. But in this case, I'd rather reuse the name in order to shadow the outer err. If we go with err2, there's a chance to accidentally reference the outer error when the inner error was meant.

@SuperSandro2000 SuperSandro2000 merged commit bc27365 into master Jan 11, 2024
6 checks passed
@SuperSandro2000 SuperSandro2000 deleted the retry-alt branch January 11, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants