Skip to content

Commit 813654f

Browse files
committed
Refactoring.
Fix unnecessary type conversion. Fix argument order in diff. Update to latest go-runewidth.
1 parent df6aebc commit 813654f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Godeps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
},
1010
{
1111
"ImportPath": "github.com/mattn/go-runewidth",
12-
"Comment": "go1",
13-
"Rev": "ce86f93d9cc06f69ba0441bbe37c8845e0dc9204"
12+
"Comment": "travisish-12-g39104c7",
13+
"Rev": "39104c78546f11be4bbc161e39858258aac6d9b8"
1414
},
1515
{
1616
"ImportPath": "github.com/russross/blackfriday",

markdown/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ func (_ *markdownRenderer) Header(out *bytes.Buffer, text func() bool, level int
101101

102102
switch level {
103103
case 1:
104-
len := runewidth.StringWidth(string(out.Bytes()[textMarker:]))
104+
len := runewidth.StringWidth(out.String()[textMarker:])
105105
fmt.Fprint(out, "\n", strings.Repeat("=", len))
106106
case 2:
107-
len := runewidth.StringWidth(string(out.Bytes()[textMarker:]))
107+
len := runewidth.StringWidth(out.String()[textMarker:])
108108
fmt.Fprint(out, "\n", strings.Repeat("-", len))
109109
}
110110
out.WriteString("\n")

markdown/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ aaa/あああ
217217
log.Fatalln(err)
218218
}
219219

220-
diff, err := diff(output, expected)
220+
diff, err := diff(expected, output)
221221
if err != nil {
222222
log.Fatalln(err)
223223
}

0 commit comments

Comments
 (0)