go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
17k stars 1.33k forks source link

feat: add validator for numeric ports #1294

Closed nodivbyzero closed 1 week ago

nodivbyzero commented 4 months ago

Fixes Or Enhances

This PR adds a new validation for numeric ports. Connected to: #1216

    type Host struct {
        Port uint32 `validate:"port"`
    }

Make sure that you've checked the boxes below before you submit PR:

@go-playground/validator-maintainers

coveralls commented 4 months ago

Coverage Status

coverage: 74.298% (+0.007%) from 74.291% when pulling 70d0cd06f245743d69f699a8d35c777d79e67c86 on nodivbyzero:feat-numeric-port-validation into a947377040f8ebaee09f20d09a745ec369396793 on go-playground:master.