From 2c7e3dd6cb7e89d54b4eeb6c031640d4b81b95ce Mon Sep 17 00:00:00 2001 From: Greg Dubicki Date: Thu, 28 May 2020 17:31:51 +0200 Subject: [PATCH] Make validating host[:port] more elegant --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 0268633..a73bbf5 100644 --- a/main.go +++ b/main.go @@ -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 {