Skip to content

Commit

Permalink
Reduce code duplication by reusing the correct function in deprecated…
Browse files Browse the repository at this point in the history
… functions (#194)
  • Loading branch information
yardenshoham authored Aug 20, 2024
1 parent 935a601 commit 9c29bfc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions html/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func Data(name, v string) g.Node {
//
// Deprecated: Use [Data] instead.
func DataAttr(name, v string) g.Node {
return g.Attr("data-"+name, v)
return Data(name, v)
}

func For(v string) g.Node {
Expand Down Expand Up @@ -247,7 +247,7 @@ func Style(v string) g.Node {

// Deprecated: Use [Style] instead.
func StyleAttr(v string) g.Node {
return g.Attr("style", v)
return Style(v)
}

func TabIndex(v string) g.Node {
Expand All @@ -264,7 +264,7 @@ func Title(v string) g.Node {

// Deprecated: Use [Title] instead.
func TitleAttr(v string) g.Node {
return g.Attr("title", v)
return Title(v)
}

func Type(v string) g.Node {
Expand Down
4 changes: 2 additions & 2 deletions html/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func Form(children ...g.Node) g.Node {

// Deprecated: Use [Form] instead.
func FormEl(children ...g.Node) g.Node {
return g.El("form", children...)
return Form(children...)
}

func FieldSet(children ...g.Node) g.Node {
Expand Down Expand Up @@ -177,7 +177,7 @@ func Label(children ...g.Node) g.Node {

// Deprecated: Use [Label] instead.
func LabelEl(children ...g.Node) g.Node {
return g.El("label", children...)
return Label(children...)
}

func Legend(children ...g.Node) g.Node {
Expand Down

0 comments on commit 9c29bfc

Please sign in to comment.