From 9a68591255747c82fd4ce99351bca6d43349cafa Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sun, 3 Sep 2023 19:58:18 -0600 Subject: implement gophernicus extensions for gophermaps --- gopher/gophermap/parse.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gopher/gophermap/parse.go') diff --git a/gopher/gophermap/parse.go b/gopher/gophermap/parse.go index 3317514..04286bd 100644 --- a/gopher/gophermap/parse.go +++ b/gopher/gophermap/parse.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io" + "strconv" sr "tildegit.org/tjp/sliderule" "tildegit.org/tjp/sliderule/gopher" @@ -38,6 +39,9 @@ func Parse(input io.Reader) (gopher.MapDocument, error) { item.Selector = string(spl[1]) item.Hostname = string(spl[2]) item.Port = string(spl[3]) + if _, err = strconv.Atoi(item.Port); err != nil { + return nil, InvalidLine(num) + } doc = append(doc, item) } -- cgit v1.2.3