mirror of
https://github.com/onyx-and-iris/gobs-cli.git
synced 2025-06-09 21:20:34 +01:00
23 lines
462 B
Go
23 lines
462 B
Go
// Package util provides utility functions for the application.
|
|
|
|
package main
|
|
|
|
import "strings"
|
|
|
|
func snakeCaseToTitleCase(snake string) string {
|
|
words := strings.Split(snake, "_")
|
|
for i, word := range words {
|
|
if len(word) > 0 {
|
|
words[i] = strings.ToUpper(word[:1]) + word[1:]
|
|
}
|
|
}
|
|
return strings.Join(words, " ")
|
|
}
|
|
|
|
func getEnabledMark(enabled bool) string {
|
|
if enabled {
|
|
return "\u2713" // green check mark
|
|
}
|
|
return "\u274c" // red cross mark
|
|
}
|