ax(node): replace prose description on validatePeerName with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 08:03:14 +01:00
parent 97b8b66241
commit 27e7f6ef74
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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)