Isaev Denis 95ec0cf21e
dramatically reduce memory usage ()
Run all linters per package. It allows unloading package data when it's
processed. It dramatically reduces memory (and CPU because of GC) usage.

Relates: 
2019-09-30 16:19:41 +03:00

25 lines
470 B
Go

package golinters
import (
"fmt"
"strings"
"github.com/golangci/golangci-lint/pkg/config"
)
func formatCode(code string, _ *config.Config) string {
if strings.Contains(code, "`") {
return code // TODO: properly escape or remove
}
return fmt.Sprintf("`%s`", code)
}
func formatCodeBlock(code string, _ *config.Config) string {
if strings.Contains(code, "`") {
return code // TODO: properly escape or remove
}
return fmt.Sprintf("```\n%s\n```", code)
}