Skip to content

Commit

Permalink
Make validating host[:port] more elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Dubicki committed May 28, 2020
1 parent 384aa30 commit 2c7e3dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func validateLogAddress(logAddress string) error {
if err != nil && match {
return nil
}
if !govalidator.IsDialString(logAddress) && !govalidator.IsDialString(logAddress+":514") {
if !govalidator.IsHost(logAddress) && !govalidator.IsDialString(logAddress) {
return errors.New(fmt.Sprintf("%s should be either syslog host[:port] or a socket", logAddress))
}
} else {
Expand Down

0 comments on commit 2c7e3dd

Please sign in to comment.