Skip to content

Commit 88b2569

Browse files
refactor(formatter): move truncate util to default
1 parent 9fa04a6 commit 88b2569

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

formatter/default.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ func writeLintResult(w *strings.Builder, title string, resArr []lint.RuleResult,
5151
fmt.Fprintf(w, "\n %s %s: %s", sign, msg.Name, msg.Message)
5252
}
5353
}
54+
55+
func truncate(maxSize int, input string) string {
56+
if len(input) < maxSize {
57+
return input
58+
}
59+
return input[:maxSize-3] + "..."
60+
}

formatter/util.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)