Skip to content

Commit

Permalink
#8 gofmt -w -s
Browse files Browse the repository at this point in the history
  • Loading branch information
vanng822 committed May 2, 2019
1 parent 1c2c22d commit 5591781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion premailer/premailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (pr *premailer) addLeftover() {
styleNode := &html.Node{}
styleNode.Type = html.ElementNode
styleNode.Data = "style"
styleNode.Attr = []html.Attribute{html.Attribute{Key: "type", Val: "text/css"}}
styleNode.Attr = []html.Attribute{{Key: "type", Val: "text/css"}}
cssNode := &html.Node{}
cssData := make([]string, 0, len(pr.leftover))
for _, rule := range pr.leftover {
Expand Down
14 changes: 7 additions & 7 deletions premailer/specificity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ func TestSpecificitySortRuleIndex(t *testing.T) {
func TestSpecificitySortLongArray(t *testing.T) {
// It has to be longer than 6 due to internal implementation of sort.Sort(),
rules := []*styleRule{
&styleRule{specificity: makeSpecificity(0, 0, 1, "table.padded")},
&styleRule{specificity: makeSpecificity(0, 0, 2, "table.padded")},
&styleRule{specificity: makeSpecificity(0, 0, 3, "table.padded")},
&styleRule{specificity: makeSpecificity(0, 0, 4, "table.padded")},
&styleRule{specificity: makeSpecificity(0, 0, 5, "table.padded")},
&styleRule{specificity: makeSpecificity(0, 0, 6, "table.padded")},
&styleRule{specificity: makeSpecificity(0, 0, 11, "table")},
{specificity: makeSpecificity(0, 0, 1, "table.padded")},
{specificity: makeSpecificity(0, 0, 2, "table.padded")},
{specificity: makeSpecificity(0, 0, 3, "table.padded")},
{specificity: makeSpecificity(0, 0, 4, "table.padded")},
{specificity: makeSpecificity(0, 0, 5, "table.padded")},
{specificity: makeSpecificity(0, 0, 6, "table.padded")},
{specificity: makeSpecificity(0, 0, 11, "table")},
}

sort.Sort(bySpecificity(rules))
Expand Down

0 comments on commit 5591781

Please sign in to comment.