Skip to content

Commit 63594a0

Browse files
authored
docs: add description for 'port' validator (#1435)
1 parent 45f3a8e commit 63594a0

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
@@ -1331,6 +1331,12 @@ can be used to validate fields typically passed to sockets and connections.
13311331
13321332
Usage: hostname_port
13331333
1334+
# Port
1335+
1336+
This validates that the value falls within the valid port number range of 1 to 65,535.
1337+
1338+
Usage: port
1339+
13341340
# Datetime
13351341
13361342
This validates that a string value is a valid datetime based on the supplied datetime format.

0 commit comments

Comments
 (0)