|
|
@ -3,6 +3,8 @@ package format
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/ghodss/yaml"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// This is all just placeholder.
|
|
|
|
// This is all just placeholder.
|
|
|
@ -35,3 +37,13 @@ func Warning(msg string, v ...interface{}) {
|
|
|
|
msg = "[Warning] " + msg + "\n"
|
|
|
|
msg = "[Warning] " + msg + "\n"
|
|
|
|
fmt.Fprintf(os.Stdout, msg, v...)
|
|
|
|
fmt.Fprintf(os.Stdout, msg, v...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func YAML(v interface{}) error {
|
|
|
|
|
|
|
|
y, err := yaml.Marshal(v)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return fmt.Errorf("Failed to serialize to yaml: %s", v.(string))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Msg(string(y))
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|