mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
24 lines
468 B
Go
24 lines
468 B
Go
package golinters
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/golangci/golangci-lint/pkg/config"
|
|
)
|
|
|
|
func formatCode(code string, cfg *config.Run) string {
|
|
if strings.Contains(code, "`") {
|
|
return code // TODO: properly escape or remove
|
|
}
|
|
|
|
return fmt.Sprintf("`%s`", code)
|
|
}
|
|
|
|
func formatCodeBlock(code string, cfg *config.Run) string {
|
|
if strings.Contains(code, "`") {
|
|
return code // TODO: properly escape or remove
|
|
}
|
|
|
|
return fmt.Sprintf("```\n%s\n```", code)
|
|
}
|