diff options
author | tjp <tjp@ctrl-c.club> | 2023-11-13 07:27:56 -0700 |
---|---|---|
committer | tjp <tjp@ctrl-c.club> | 2023-11-13 07:27:56 -0700 |
commit | aa9bca810912f102a13a674ee30bf97f5667f662 (patch) | |
tree | 793c215fee17cdf5c728af47ff8510a02aad874e /gopher/gophermap | |
parent | 629e6a0e0c3a24f35888036f957ee3a631e62816 (diff) |
lint and bug fixes
Diffstat (limited to 'gopher/gophermap')
-rw-r--r-- | gopher/gophermap/extended.go | 5 | ||||
-rw-r--r-- | gopher/gophermap/extended_test.go | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gopher/gophermap/extended.go b/gopher/gophermap/extended.go index 7d64fe0..f2ca3fc 100644 --- a/gopher/gophermap/extended.go +++ b/gopher/gophermap/extended.go @@ -193,6 +193,7 @@ func (edoc *ExtendedMapDocument) Compatible(cwd string, settings FileSystemSetti hidden := map[string]struct{}{} extensions := map[string]types.Status{} +lineloop: for num, item := range edoc.Lines { switch item.Type { case CommentType: @@ -252,9 +253,9 @@ func (edoc *ExtendedMapDocument) Compatible(cwd string, settings FileSystemSetti doc = append(doc, dirlist...) - break + break lineloop case EndDocType: - break + break lineloop default: doc = append(doc, item) } diff --git a/gopher/gophermap/extended_test.go b/gopher/gophermap/extended_test.go index 0c8b647..5210984 100644 --- a/gopher/gophermap/extended_test.go +++ b/gopher/gophermap/extended_test.go @@ -66,6 +66,9 @@ func TestUptimeOutput(t *testing.T) { Path: "/customlist.gophermap", }) _ = file.Close() + if err != nil { + t.Fatal(err) + } doc, _, err := edoc.Compatible("testdata", FileSystemSettings{ ParseExtended: true, @@ -82,6 +85,9 @@ func TestUptimeOutput(t *testing.T) { expected, err := io.ReadAll(file) _ = file.Close() + if err != nil { + t.Fatal(err) + } if string(expected) != got { fmt.Printf("expected:\n%s", string(expected)) |