Fix comments

Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
gotjosh 2022-11-09 17:20:22 +00:00
parent b3f50f0c84
commit c7362ab831
No known key found for this signature in database
GPG Key ID: A6E1DDE38FF3C74E
1 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ func Drain(r *http.Response) {
r.Body.Close()
}
// Truncate truncates a string to fit the given size in Bytes.
// Truncate truncates a string to fit the given size in Runes.
func TruncateInRunes(s string, n int) (string, bool) {
r := []rune(s)
if len(r) <= n {
@ -95,7 +95,7 @@ func TruncateInRunes(s string, n int) (string, bool) {
return string(r[:n-1]) + "…", true
}
// Truncate truncates a string to fit the given size in Runes.
// Truncate truncates a string to fit the given size in Bytes.
func TruncateInBytes(s string, n int) (string, bool) {
if len(s) <= n {
return s, false