MCPcopy Create free account
hub / github.com/basecamp/hey-cli / truncate

Function truncate

internal/cmd/formatting.go:85–90  ·  view source on GitHub ↗
(s string, maxWidth int)

Source from the content-addressed store, hash-verified

83}
84
85func truncate(s string, maxWidth int) string {
86 if runewidth.StringWidth(s) <= maxWidth {
87 return s
88 }
89 return runewidth.Truncate(s, maxWidth, "...")
90}
91
92func stdinIsTerminal() bool {
93 return term.IsTerminal(int(os.Stdin.Fd())) //nolint:gosec // G115: fd fits in int

Callers 3

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected