Skip to content

Commit

Permalink
test: refactor to use Document instead of []Section
Browse files Browse the repository at this point in the history
  • Loading branch information
xNok committed Oct 9, 2024
1 parent de4b81d commit 191ca6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions document/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestGetDocument(t *testing.T) {
tests := []struct {
name string
modules [][]string
want []Section
want Document
wantErr bool
}{
{
Expand All @@ -112,7 +112,7 @@ package foo
p := 7
`},
},
want: []Section{
want: Document{
{
H: "#",
Path: "foo",
Expand Down Expand Up @@ -142,7 +142,7 @@ package foo.bar
p := 7
`},
},
want: []Section{
want: Document{
{
H: "#",
Path: "foo.bar",
Expand Down Expand Up @@ -176,7 +176,7 @@ p := 7
q := 8
`},
},
want: []Section{
want: Document{
{
H: "#",
Path: "foo",
Expand Down Expand Up @@ -223,7 +223,7 @@ r := 9
`},
},
want: []Section{
want: Document{
{
H: "#",
Path: "foo",
Expand Down
4 changes: 2 additions & 2 deletions document/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
//go:embed resources/*
var resources embed.FS

// TemplateKind helps us to select where to find the template.
// TemplateKind helps us to select where to find the template.
// It can either be embedded or on the host filesystem
type TemplateKind int

Expand Down Expand Up @@ -62,7 +62,7 @@ func RenderDocument(out io.Writer, d Document, opts ...RenderDocumentOption) err
}

// renderTemplate is an utility function to use go-template it handles fetching the template file(s)
// whether they are embeded or on the host file system.
// whether they are embedded or on the host file system.
func renderTemplate(tpl *TemplateConfig, args interface{}, out io.Writer) error {
var t *template.Template
var err error
Expand Down

0 comments on commit 191ca6e

Please sign in to comment.