1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

NewRelic Module - Fixing out of bound error

This commit is contained in:
Lasantha Kularatne 2018-05-31 13:35:47 -05:00 committed by Chris Cummer
parent 1dae2456cc
commit 0a1b1376be

View File

@ -68,9 +68,14 @@ func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string {
lineColor = "lightblue"
}
var revLen = 8
if revLen > len(deploy.Revision) {
revLen = len(deploy.Revision)
}
str = str + fmt.Sprintf(
" [green]%s[%s] %s %-.16s[white]\n",
deploy.Revision[0:8],
deploy.Revision[0:revLen],
lineColor,
deploy.Timestamp.Format("Jan 02, 15:04 MST"),
wtf.NameFromEmail(deploy.User),