refactor: modernize using min()
This commit is contained in:
@@ -32,10 +32,7 @@ func templateFuncMap() template.FuncMap {
|
||||
if start >= len(s) {
|
||||
return ""
|
||||
}
|
||||
end := start + length
|
||||
if end > len(s) {
|
||||
end = len(s)
|
||||
}
|
||||
end := min(start+length, len(s))
|
||||
return s[start:end]
|
||||
},
|
||||
"upper": strings.ToUpper,
|
||||
|
||||
Reference in New Issue
Block a user