Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SamNet-dev/snix
/ truncate
Function
truncate
tui/scan.go:391–399 ·
view source on GitHub ↗
(s string, n int)
Source
from the content-addressed store, hash-verified
389
}
390
391
func
truncate(s string, n int) string {
392
if
len(s) <= n {
393
return
s
394
}
395
if
n < 1 {
396
return
""
397
}
398
return
s[:n-1] +
"…"
399
}
400
401
func
max(a, b int) int {
402
if
a > b {
Callers
1
renderSNIPanel
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected