INNER CODE UNIT · Go
ColorResourceID
rebuy-de/aws-nuke · cmd/log.go:23
ColorResourceID = *color.New(color.Bold)
ColorResourceProperties = *color.New(color.Italic)
)
// Format the resource properties in sorted order ready for printing.
// This ensures that multiple runs of aws-nuke produce stable output so
// that they can be compared with each other.
func Sorted(m map[string]string) string {
keys := make([]string, 0, len(m))
for k := range m {
keys = append(keys, k)
}
sort.Strings(keys)
sorted := make([]string, 0, len(m))
for k := range keys {
sorted = append(sorted, fmt.Sprintf("%s: \"%s\"", keys[k], m[keys[k]]))
}
return fmt.Sprintf("[%s]", strings.Join(sorted, ", "))