package
Version:
v2.0.2
Opens a new window with list of versions in this module.
Published: Mar 23, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package identifiers is a handy place to request a new string identifier from.
New produces a new string ID.
package main
import (
"fmt"
"github.com/verygoodsoftwarenotvirus/platform/v2/identifiers"
)
func main() {
id := identifiers.New()
// IDs are 20-character xid strings
fmt.Println(len(id))
}
Output:
20
Validate validates a string ID.
package main
import (
"fmt"
"github.com/verygoodsoftwarenotvirus/platform/v2/identifiers"
)
func main() {
id := identifiers.New()
err := identifiers.Validate(id)
fmt.Println(err)
}
Output:
<nil>
Source Files
¶
Click to show internal directories.
Click to hide internal directories.