From 634941a1ef4c4545a3c72d511f2b9a3cacc3a98e Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Fri, 1 Sep 2023 20:00:42 +0000 Subject: [PATCH] wireguard: implement EndpointAddress.UnmarshalText Signed-off-by: Alejandro Mery --- pkg/wireguard/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/wireguard/config.go b/pkg/wireguard/config.go index ccdb531..4e0e374 100644 --- a/pkg/wireguard/config.go +++ b/pkg/wireguard/config.go @@ -107,6 +107,11 @@ func (ep EndpointAddress) String() string { } } +// UnmarshalText loads an endpoint address from text data +func (ep *EndpointAddress) UnmarshalText(b []byte) error { + return ep.FromString(string(b)) +} + // FromString sets the EndpointAddress from a given "[host]:port" func (ep *EndpointAddress) FromString(s string) error { host, port, err := core.SplitHostPort(s)