diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-09-03 19:58:18 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-09-03 19:58:18 -0600 |
commit | 9a68591255747c82fd4ce99351bca6d43349cafa (patch) | |
tree | 06928eeb617b954a80bbdab2e6164952d47e13bf /gopher/gophermap/parse.go | |
parent | 5befdc9c851f285000c15abc01a08010c719b307 (diff) |
implement gophernicus extensions for gophermaps
Diffstat (limited to 'gopher/gophermap/parse.go')
-rw-r--r-- | gopher/gophermap/parse.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) } |