From 5b32548f7658691d73f3f73ef467d3e36c9ff026 Mon Sep 17 00:00:00 2001 From: Alexandre Couedelo Date: Wed, 9 Oct 2024 13:36:16 +0100 Subject: [PATCH] test: refactor to use Document instead of []Section Signed-off-by: Alexandre Couedelo --- document/metadata_test.go | 10 +++++----- document/template.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/document/metadata_test.go b/document/metadata_test.go index 81c3ca17a..d54b03f02 100644 --- a/document/metadata_test.go +++ b/document/metadata_test.go @@ -96,7 +96,7 @@ func TestGetDocument(t *testing.T) { tests := []struct { name string modules [][]string - want []Section + want Document wantErr bool }{ { @@ -112,7 +112,7 @@ package foo p := 7 `}, }, - want: []Section{ + want: Document{ { H: "#", Path: "foo", @@ -142,7 +142,7 @@ package foo.bar p := 7 `}, }, - want: []Section{ + want: Document{ { H: "#", Path: "foo.bar", @@ -176,7 +176,7 @@ p := 7 q := 8 `}, }, - want: []Section{ + want: Document{ { H: "#", Path: "foo", @@ -223,7 +223,7 @@ r := 9 `}, }, - want: []Section{ + want: Document{ { H: "#", Path: "foo", diff --git a/document/template.go b/document/template.go index ff649f0a3..f271fe668 100644 --- a/document/template.go +++ b/document/template.go @@ -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 @@ -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