Use go.uber.org/atomic instead of sync/atomic#825
Conversation
Signed-off-by: Arve Knudsen <[email protected]>
There was a problem hiding this comment.
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/atomicas 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.
|
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 :) |
|
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. |
This reverts commit 6d40fe1. Signed-off-by: Arve Knudsen <[email protected]>
This reverts commit 6d40fe1. Signed-off-by: Arve Knudsen <[email protected]>
This reverts commit 6d40fe1. Signed-off-by: Arve Knudsen <[email protected]>
Use
go.uber.org/atomicinstead ofsync/atomic.