mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2026-01-07 15:51:45 +00:00
fix golint errors in pkg/util/strings
Signed-off-by: Christian Schlotter <christi.schlotter@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// Splits a fully qualified name and returns its namespace and name.
|
||||
// SplitQualifiedName Splits a fully qualified name and returns its namespace and name.
|
||||
// Assumes that the input 'str' has been validated.
|
||||
func SplitQualifiedName(str string) (string, string) {
|
||||
parts := strings.Split(str, "/")
|
||||
@@ -32,19 +32,18 @@ func SplitQualifiedName(str string) (string, string) {
|
||||
return parts[0], parts[1]
|
||||
}
|
||||
|
||||
// Joins 'namespace' and 'name' and returns a fully qualified name
|
||||
// JoinQualifiedName joins 'namespace' and 'name' and returns a fully qualified name
|
||||
// Assumes that the input is valid.
|
||||
func JoinQualifiedName(namespace, name string) string {
|
||||
return path.Join(namespace, name)
|
||||
}
|
||||
|
||||
// Returns the first N slice of a string.
|
||||
// ShortenString returns the first N slice of a string.
|
||||
func ShortenString(str string, n int) string {
|
||||
if len(str) <= n {
|
||||
return str
|
||||
} else {
|
||||
return str[:n]
|
||||
}
|
||||
return str[:n]
|
||||
}
|
||||
|
||||
// isVowel returns true if the rune is a vowel (case insensitive).
|
||||
|
||||
Reference in New Issue
Block a user