Skip to content

Commit

Permalink
NewRelic Module - Fixing out of bound error
Browse files Browse the repository at this point in the history
  • Loading branch information
lasanthak authored and senorprogrammer committed May 31, 2018
1 parent 1dae245 commit 0a1b137
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion newrelic/widget.go
Expand Up @@ -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),
Expand Down

0 comments on commit 0a1b137

Please sign in to comment.