diff --git a/glob_test.go b/glob_test.go index b8833a9..65c5832 100644 --- a/glob_test.go +++ b/glob_test.go @@ -17,7 +17,7 @@ import ( "github.com/matryer/is" ) -func TestGlob(t *testing.T) { // nolint:funlen +func TestGlob(t *testing.T) { // nolint:funlen,maintidx t.Parallel() t.Run("real", func(t *testing.T) { t.Parallel() diff --git a/prefix.go b/prefix.go index 05cdfb8..230ee50 100644 --- a/prefix.go +++ b/prefix.go @@ -47,7 +47,11 @@ func staticText(node *ast.Node) (text string, ok bool) { return text, true case ast.KindText: - return node.Value.(ast.Text).Text, true + t, ok := node.Value.(ast.Text) + if !ok { + return "", false + } + return t.Text, true case ast.KindNothing: return "", true default: