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

remove unnecessary time.Duration(...) #1153

Merged
merged 1 commit into from Dec 22, 2022

Conversation

favonia
Copy link
Contributor

@favonia favonia commented Dec 22, 2022

This is a minor clean-up of unnecessary (and arguably confusing) type conversion to time.Duration.

Description

Untyped constants in Go will automatically match the type of the other operand of *, and thus time.Duration(30) * time.Second is the same as 30 * time.Second. Arguably, the latter is cleaner.

Has your change been tested?

The changes should be covered by the existing test cases.

Screenshots (if appropriate):

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

This is just a minor style clean-up.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

@github-actions
Copy link
Contributor

Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/cloudflare-go/blob/master/docs/changelog-process.md.

Example:

```release-note:TYPE
Release note
```

If you do not require a release note to be included, please add the workflow/skip-changelog-entry label.

@jacobbednarz jacobbednarz merged commit 717f161 into cloudflare:master Dec 22, 2022
@github-actions github-actions bot added this to the v0.58.0 milestone Dec 22, 2022
@favonia favonia deleted the cleanup-duration branch December 23, 2022 02:00
@jacobbednarz jacobbednarz modified the milestones: v0.58.0, v0.57.1 Dec 23, 2022
@github-actions
Copy link
Contributor

This functionality has been released in v0.57.1.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

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