Skip to content

Commit d754f75

Browse files
committed
docs: add description for 'port' validator
1 parent 5b9542b commit d754f75

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ validate := validator.New(validator.WithRequiredStructEnabled())
106106
| datauri | Data URL |
107107
| fqdn | Full Qualified Domain Name (FQDN) |
108108
| hostname | Hostname RFC 952 |
109-
| hostname_port | HostPort |
110109
| hostname_rfc1123 | Hostname RFC 1123 |
110+
| hostname_port | HostPort |
111+
| port | Port number |
111112
| ip | Internet Protocol Address IP |
112113
| ip4_addr | Internet Protocol Address IPv4 |
113114
| ip6_addr | Internet Protocol Address IPv6 |

doc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,12 @@ can be used to validate fields typically passed to sockets and connections.
13301330
13311331
Usage: hostname_port
13321332
1333+
# Port
1334+
1335+
This validates that the value falls within the valid port number range of 1 to 65,535.
1336+
1337+
Usage: port
1338+
13331339
# Datetime
13341340
13351341
This validates that a string value is a valid datetime based on the supplied datetime format.

0 commit comments

Comments
 (0)