Skip to content

Commit 2c7e3dd

Browse files
author
Greg Dubicki
committed
Make validating host[:port] more elegant
1 parent 384aa30 commit 2c7e3dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func validateLogAddress(logAddress string) error {
7171
if err != nil && match {
7272
return nil
7373
}
74-
if !govalidator.IsDialString(logAddress) && !govalidator.IsDialString(logAddress+":514") {
74+
if !govalidator.IsHost(logAddress) && !govalidator.IsDialString(logAddress) {
7575
return errors.New(fmt.Sprintf("%s should be either syslog host[:port] or a socket", logAddress))
7676
}
7777
} else {

0 commit comments

Comments
 (0)