ContainerImage.Pinniped/internal/here/doc.go
Ryan Richard da7c981f14 Organize Pinniped CLI into subcommands; Add get-kubeconfig subcommand
- Add flag parsing and help messages for root command,
  `exchange-credential` subcommand, and new `get-kubeconfig` subcommand
- The new `get-kubeconfig` subcommand is a work in progress in this
  commit
- Also add here.Doc() and here.Docf() to enable nice heredocs in
  our code
2020-09-11 17:56:05 -07:00

26 lines
414 B
Go

/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package here
import (
"strings"
"github.com/MakeNowJust/heredoc/v2"
)
const (
tab = "\t"
fourSpaces = " "
)
func Doc(s string) string {
return strings.ReplaceAll(heredoc.Doc(s), tab, fourSpaces)
}
func Docf(raw string, args ...interface{}) string {
return strings.ReplaceAll(heredoc.Docf(raw, args...), tab, fourSpaces)
}