mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-16 10:37:09 +00:00
Fix comments
Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
parent
b3f50f0c84
commit
c7362ab831
@ -81,7 +81,7 @@ func Drain(r *http.Response) {
|
|||||||
r.Body.Close()
|
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) {
|
func TruncateInRunes(s string, n int) (string, bool) {
|
||||||
r := []rune(s)
|
r := []rune(s)
|
||||||
if len(r) <= n {
|
if len(r) <= n {
|
||||||
@ -95,7 +95,7 @@ func TruncateInRunes(s string, n int) (string, bool) {
|
|||||||
return string(r[:n-1]) + "…", true
|
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) {
|
func TruncateInBytes(s string, n int) (string, bool) {
|
||||||
if len(s) <= n {
|
if len(s) <= n {
|
||||||
return s, false
|
return s, false
|
||||||
|
Loading…
Reference in New Issue
Block a user