Documentation ¶
Overview ¶
The package namepool is used to provide a name pool that contains names that are safe to use by multiple goroutines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pool ¶
func Pool(format string) *pool
Pool is a wrapper around a sync.Pool utilizing sync/atomic to provide simple name pools that are safe to use by multiple goroutines.
The argument format should include exactly one format verb for base 10 integers (%d). It is not an error if format doesn't include any verbs. The ID will still be stored in acquired Names.
Types ¶
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
Name is a member of a Pool. It contains the formatted string of the format and the ID as well as the ID itself.
Click to show internal directories.
Click to hide internal directories.