Repository: maragudk/gomponents (go)

Issue:
Add "checked" bool attribute
For https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/checkbox

Pull request description:
Add "checked" bool attribute
Fixes #127.

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 3c69f94..b38dd95 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -16,6 +16,10 @@ func AutoPlay() g.Node {
 	return g.Attr("autoplay")
 }
 
+func Checked() g.Node {
+	return g.Attr("checked")
+}
+
 func Controls() g.Node {
 	return g.Attr("controls")
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 5e2c179..bcb6daf 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -14,6 +14,7 @@ func TestBooleanAttributes(t *testing.T) {
 		"async":       Async,
 		"autofocus":   AutoFocus,
 		"autoplay":    AutoPlay,
+		"checked":     Checked,
 		"controls":    Controls,
 		"defer":       Defer,
 		"disabled":    Disabled,