From d754f75f49e1f3c50e5f94b0ab6fbedba315386b Mon Sep 17 00:00:00 2001 From: nodivbyzero Date: Mon, 2 Jun 2025 15:24:13 -0700 Subject: [PATCH] docs: add description for 'port' validator --- README.md | 3 ++- doc.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 28f7e159..1890ce02 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,9 @@ validate := validator.New(validator.WithRequiredStructEnabled()) | datauri | Data URL | | fqdn | Full Qualified Domain Name (FQDN) | | hostname | Hostname RFC 952 | -| hostname_port | HostPort | | hostname_rfc1123 | Hostname RFC 1123 | +| hostname_port | HostPort | +| port | Port number | | ip | Internet Protocol Address IP | | ip4_addr | Internet Protocol Address IPv4 | | ip6_addr | Internet Protocol Address IPv6 | diff --git a/doc.go b/doc.go index 91bace77..f202b1bb 100644 --- a/doc.go +++ b/doc.go @@ -1330,6 +1330,12 @@ can be used to validate fields typically passed to sockets and connections. Usage: hostname_port +# Port + +This validates that the value falls within the valid port number range of 1 to 65,535. + + Usage: port + # Datetime This validates that a string value is a valid datetime based on the supplied datetime format.