ax(node): replace prose description on validatePeerName with usage examples
Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
97b8b66241
commit
27e7f6ef74
1 changed files with 3 additions and 3 deletions
|
|
@ -68,9 +68,9 @@ func safeKeyPrefix(key string) string {
|
|||
return key
|
||||
}
|
||||
|
||||
// validatePeerName checks if a peer name is valid.
|
||||
// Peer names must be 1-64 characters, start and end with alphanumeric,
|
||||
// and contain only alphanumeric, hyphens, underscores, and spaces.
|
||||
// validatePeerName("my-worker") // nil
|
||||
// validatePeerName("bad name!!!") // error: invalid characters
|
||||
// validatePeerName("") // nil (empty names are optional)
|
||||
func validatePeerName(name string) error {
|
||||
if name == "" {
|
||||
return nil // Empty names are allowed (optional field)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue