Skip to content

Instantly share code, notes, and snippets.

@songjiayang
Last active April 9, 2018 09:50
Show Gist options
  • Save songjiayang/354f2b4387880d18c10185288e1d8a47 to your computer and use it in GitHub Desktop.
Save songjiayang/354f2b4387880d18c10185288e1d8a47 to your computer and use it in GitHub Desktop.
golang time format in template
{{ define "wechat.default.message" }}
{{ range .Alerts }}
告警级别:{{ .Labels.severity }}
告警类型:{{ .Labels.alertname }}
故障主机: {{ .Labels.instance }}
告警主题: {{ .Annotations.summary }}
告警详情: {{ .Annotations.description }}
触发时间: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
{{ end }}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment