Documentation
¶
Overview ¶
Example (CustomType) ¶
package main
import (
"fmt"
"maps"
"github.com/ndx-technologies/countset"
)
func main() {
type ID uint64
id := ID(1234)
m := map[ID]int{
id: -11,
}
b, _ := countset.MarshalBinary(m)
m2, _ := countset.UnmarshalBinary[ID, int](b)
fmt.Println(maps.Equal(m, m2), m[id])
}
Output: true -11
Example (Uint64) ¶
package main
import (
"fmt"
"maps"
"github.com/ndx-technologies/countset"
)
func main() {
m := map[uint64]int{
1234: -11,
}
b, _ := countset.MarshalBinary(m)
m2, _ := countset.UnmarshalBinary[uint64, int](b)
fmt.Println(maps.Equal(m, m2), m[1234])
}
Output: true -11
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ByteOrder = binary.LittleEndian
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.