Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Oct 21, 2023
1 parent 7c804c8 commit 9c0d8f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (m *Markdown) PlainTextf(format string, args ...interface{}) *Markdown {
func (m *Markdown) Build() error {
if _, err := fmt.Fprint(m.dest, m.String()); err != nil {
if m.err != nil {
return fmt.Errorf("failed to write markdown text: %w: %s", err, m.err)
return fmt.Errorf("failed to write markdown text: %w: %s", err, m.err) //nolint:wrapcheck
}
return fmt.Errorf("failed to write markdown text: %w", err)
}
Expand Down Expand Up @@ -337,7 +337,7 @@ func (m *Markdown) Table(t TableSet) *Markdown {
if err := t.ValidateColumns(); err != nil {
// NOTE: If go version is 1.20, use errors.Join
if m.err != nil {
m.err = fmt.Errorf("failed to validate columns: %w: %s", err, m.err)
m.err = fmt.Errorf("failed to validate columns: %w: %s", err, m.err) //nolint:wrapcheck
} else {
m.err = fmt.Errorf("failed to validate columns: %w", err)
}
Expand Down
11 changes: 5 additions & 6 deletions markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func TestMarkdownNumberList(t *testing.T) {
}

func TestMarkdownCheckBoxf(t *testing.T) {

t.Run("success CheckBoxf(); check [x]", func(t *testing.T) {
t.Parallel()

Expand All @@ -171,8 +170,8 @@ func TestMarkdownCheckBoxf(t *testing.T) {
}
m.CheckBox(set)
want := []string{
fmt.Sprintf("- [x] Hello"),
fmt.Sprintf("- [ ] World"),
"- [x] Hello",
"- [ ] World",
}
got := m.body

Expand All @@ -191,9 +190,9 @@ func TestMarkdownBlockquote(t *testing.T) {
m := NewMarkdown(os.Stdout)
m.Blockquote(fmt.Sprintf("%s%s%s%s%s", "Hello", lineFeed(), "Good", lineFeed(), "World"))
want := []string{
fmt.Sprintf("> Hello"),
fmt.Sprintf("> Good"),
fmt.Sprintf("> World"),
"> Hello",
"> Good",
"> World",
}
got := m.body

Expand Down

0 comments on commit 9c0d8f2

Please sign in to comment.