Skip to content

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Aug 27, 2025

Use go.uber.org/atomic instead of sync/atomic.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 requested review from bwplotka, Copilot and ywwg August 27, 2025 05:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates from the standard library's sync/atomic package to the go.uber.org/atomic package, which provides a more type-safe and ergonomic API for atomic operations.

  • Adds go.uber.org/atomic as a dependency in go.mod
  • Replaces atomic int64 variables with atomic.NewInt64() constructors
  • Updates atomic operations to use the new method-based API
  • Enables the golangci-lint rule to prevent future usage of sync/atomic

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
go.mod Adds go.uber.org/atomic v1.11.0 dependency
config/http_config_test.go Replaces sync/atomic usage with go.uber.org/atomic types and methods
.golangci.yml Enables linter rule to enforce go.uber.org/atomic usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SuperQ
Copy link
Member

SuperQ commented Aug 27, 2025

Can we turn off these useless copilot "reviews"?

@aknuds1
Copy link
Contributor Author

aknuds1 commented Aug 27, 2025

Can we turn off these useless copilot "reviews"?

@SuperQ They're not enabled by default - I tend to request them myself, just to catch in case I make some stupid mistake. I can stop requesting them if you don't like them :)

@aknuds1 aknuds1 merged commit 6d40fe1 into main Aug 27, 2025
9 checks passed
@aknuds1 aknuds1 deleted the arve/use-atomic branch August 27, 2025 06:16
@SuperQ
Copy link
Member

SuperQ commented Aug 27, 2025

I'd like to disable it completely. It's not reliable. It's more I now need to look at when reviewing a PR.

"AI" is not ready for this kind of work.

aknuds1 added a commit that referenced this pull request Sep 4, 2025
This reverts commit 6d40fe1.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
aknuds1 added a commit that referenced this pull request Sep 4, 2025
This reverts commit 6d40fe1.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
aknuds1 added a commit that referenced this pull request Sep 5, 2025
This reverts commit 6d40fe1.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
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.

2 participants