Add format functions
Add functions to go templates such as truncating a field. Also add the table keyword, which, if placed at the beginning of a format string, adds headers to the output Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
parent
6ca462a3b6
commit
08c3d241a4
10 changed files with 298 additions and 1046 deletions
|
@ -1,8 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
is "github.com/containers/image/storage"
|
||||
"github.com/containers/storage"
|
||||
"github.com/fatih/camelcase"
|
||||
"github.com/kubernetes-incubator/cri-o/libkpod"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
|
@ -53,3 +56,8 @@ func getConfig(c *cli.Context) (*libkpod.Config, error) {
|
|||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
func splitCamelCase(src string) string {
|
||||
entries := camelcase.Split(src)
|
||||
return strings.Join(entries, " ")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue