mirror of
https://github.com/mudler/luet.git
synced 2025-09-07 18:20:19 +00:00
Update vendor
This commit is contained in:
28
vendor/github.com/jedib0t/go-pretty/text/format.go
generated
vendored
Normal file
28
vendor/github.com/jedib0t/go-pretty/text/format.go
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package text
|
||||
|
||||
import "strings"
|
||||
|
||||
// Format denotes the "case" to use for text.
|
||||
type Format int
|
||||
|
||||
// Format enumerations
|
||||
const (
|
||||
FormatDefault Format = iota // default_Case
|
||||
FormatLower // lower
|
||||
FormatTitle // Title
|
||||
FormatUpper // UPPER
|
||||
)
|
||||
|
||||
// Apply converts the text as directed.
|
||||
func (tc Format) Apply(text string) string {
|
||||
switch tc {
|
||||
case FormatLower:
|
||||
return strings.ToLower(text)
|
||||
case FormatTitle:
|
||||
return strings.Title(text)
|
||||
case FormatUpper:
|
||||
return strings.ToUpper(text)
|
||||
default:
|
||||
return text
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user