doc: cleanup and improve for recently moved pkgs (#354)
* chore(atomicx): review docs and add usage example * chore(fsx): improve docs, return value, add examples * fix(kvstore): correct typo and add example * fix(multierror): add basic example * doc: revamp ooapi documentation
This commit is contained in:
@@ -13,9 +13,6 @@
|
||||
// 32 bit platform, but that's difficult to do correctly. This package
|
||||
// provides an easier-to-use interface. We use allocated
|
||||
// structures protected by a mutex that encapsulate a int64 value.
|
||||
//
|
||||
// While there we also added support for atomic float64 operations, again
|
||||
// by using structures protected by a mutex variable.
|
||||
package atomicx
|
||||
|
||||
import "sync"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package atomicx_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/atomicx"
|
||||
)
|
||||
|
||||
func Example_typicalUsage() {
|
||||
v := &atomicx.Int64{}
|
||||
v.Add(1)
|
||||
fmt.Printf("%d\n", v.Load())
|
||||
// Output: 1
|
||||
}
|
||||
Reference in New Issue
Block a user