mirror of
https://github.com/gogs/gogs.git
synced 2025-12-22 16:20:14 +01:00
refactor(db): add Users.Update (#7263)
This commit is contained in:
@@ -54,3 +54,12 @@ func Ellipsis(str string, threshold int) string {
|
||||
}
|
||||
return str[:threshold] + "..."
|
||||
}
|
||||
|
||||
// Truncate returns a truncated string if its length is over the limit.
|
||||
// Otherwise, it returns the original string.
|
||||
func Truncate(str string, limit int) string {
|
||||
if len(str) < limit {
|
||||
return str
|
||||
}
|
||||
return str[:limit]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user