diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2023-07-02 14:31:51 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2023-07-02 14:31:51 +0100 |
| commit | ad0306e9e79df26146ee8c74531574385f461f81 (patch) | |
| tree | 03b3ab6cf9414d14fda0c2faacb341b1a7655134 | |
| parent | f75f92495a5107086b3a6b33aa2554b349aab2f4 (diff) | |
Use StoreInt32 instead of SwapInt32v0.6.1
| -rw-r--r-- | flag.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -130,8 +130,8 @@ func FlagFeatureVar(fs *flag.FlagSet, f *Feature, name, usage string) { fs.Var(flagFeature{f}, name, usage) } -func (f *Feature) Disable() { atomic.SwapInt32(&f.enabled, 0) } -func (f *Feature) Enable() { atomic.SwapInt32(&f.enabled, 1) } +func (f *Feature) Disable() { atomic.StoreInt32(&f.enabled, 0) } +func (f *Feature) Enable() { atomic.StoreInt32(&f.enabled, 1) } func (f *Feature) Enabled() bool { return atomic.LoadInt32(&f.enabled) == 1 } func (f *Feature) String() string { |
