From ba0d83f4fb1b588f7931b9a31609807adfa11163 Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Tue, 8 Jun 2021 18:12:04 +0200 Subject: Add examples in test files (#80) These show up in godoc.--- components/attributes_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'components') diff --git a/components/attributes_test.go b/components/attributes_test.go index bf3e93b..9de0604 100644 --- a/components/attributes_test.go +++ b/components/attributes_test.go @@ -1,6 +1,7 @@ package components_test import ( + "os" "testing" g "github.com/maragudk/gomponents" @@ -30,3 +31,9 @@ func TestClasses(t *testing.T) { } }) } + +func ExampleClasses() { + e := g.El("div", c.Classes{"party-hat": true, "boring-hat": false}) + _ = e.Render(os.Stdout) + // Output:
+} -- cgit 1.4.1