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:
parent
9e49c18c44
commit
6a72e8c182
@ -68,9 +68,14 @@ func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string {
|
|||||||
lineColor = "lightblue"
|
lineColor = "lightblue"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var revLen = 8
|
||||||
|
if revLen > len(deploy.Revision) {
|
||||||
|
revLen = len(deploy.Revision)
|
||||||
|
}
|
||||||
|
|
||||||
str = str + fmt.Sprintf(
|
str = str + fmt.Sprintf(
|
||||||
" [green]%s[%s] %s %-.16s[white]\n",
|
" [green]%s[%s] %s %-.16s[white]\n",
|
||||||
deploy.Revision[0:8],
|
deploy.Revision[0:revLen],
|
||||||
lineColor,
|
lineColor,
|
||||||
deploy.Timestamp.Format("Jan 02, 15:04 MST"),
|
deploy.Timestamp.Format("Jan 02, 15:04 MST"),
|
||||||
wtf.NameFromEmail(deploy.User),
|
wtf.NameFromEmail(deploy.User),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user