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

Basic New Relic deploy info

This commit is contained in:
Chris Cummer
2018-04-06 21:14:19 -07:00
committed by Chris Cummer
parent a82db2bea8
commit 6303acc9a4
6 changed files with 154 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"os/exec"
"strings"
"time"
)
@@ -34,6 +35,30 @@ func ExecuteCommand(cmd *exec.Cmd) string {
return str
}
func Exclude(strs []string, val string) bool {
for _, str := range strs {
if val == str {
return false
}
}
return true
}
func NameFromEmail(email string) string {
parts := strings.Split(email, "@")
return strings.Title(strings.Replace(parts[0], ".", " ", -1))
}
func NamesFromEmails(emails []string) []string {
names := []string{}
for _, email := range emails {
names = append(names, NameFromEmail(email))
}
return names
}
func PrettyDate(dateStr string) string {
newTime, _ := time.Parse(DateFormat, dateStr)
return fmt.Sprint(newTime.Format("Jan 2, 2006"))