mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
chore: more miscellaneous updates
This commit is contained in:
parent
788926a033
commit
fb1b7bf99c
1 changed files with 4 additions and 4 deletions
|
|
@ -23,22 +23,22 @@ func PrintRemoteAssets(data []RemoteAsset, format string) {
|
||||||
fmt.Printf("%s:%d (%s) @%s\n", r.Host, r.Port, r.Protocol, r.Timestamp.Format(time.UnixDate))
|
fmt.Printf("%s:%d (%s) @%s\n", r.Host, r.Port, r.Protocol, r.Timestamp.Format(time.UnixDate))
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
log.Error().Msg("unrecognized format")
|
log.Error().Msg("PrintRemoteAssets: unrecognized format")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func PrintMapFormat(data map[string]any, format string) {
|
func PrintMapWithFormat(data map[string]any, format string) {
|
||||||
switch strings.ToLower(format) {
|
switch strings.ToLower(format) {
|
||||||
case "json":
|
case "json":
|
||||||
util.PrintJSON(data)
|
util.PrintJSON(data)
|
||||||
case "yaml":
|
case "yaml":
|
||||||
util.PrintYAML(data)
|
util.PrintYAML(data)
|
||||||
case "none":
|
case "list":
|
||||||
for k, v := range data {
|
for k, v := range data {
|
||||||
fmt.Printf("%s: %v\n", k, v)
|
fmt.Printf("%s: %v\n", k, v)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
log.Error().Msg("unrecognized format")
|
log.Error().Msg("PrintMapWithFormat: unrecognized format")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue