Fix group strings (with umlauts...)

This commit is contained in:
Jan-Lukas Else 2021-01-11 17:45:57 +01:00
parent fae7893f0b
commit 55902a2de9
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"log" "log"
"os" "os"
"os/signal" "os/signal"
"syscall"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
) )
@ -90,7 +91,7 @@ func main() {
}() }()
// Graceful shutdown // Graceful shutdown
signal.Notify(quit, os.Interrupt) signal.Notify(quit, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
<-quit <-quit
log.Println("Stopping...") log.Println("Stopping...")

View File

@ -125,7 +125,7 @@ type stringGroup struct {
func groupStrings(toGroup []string) []stringGroup { func groupStrings(toGroup []string) []stringGroup {
stringMap := map[string][]string{} stringMap := map[string][]string{}
for _, s := range toGroup { for _, s := range toGroup {
first := strings.ToUpper(s[:1]) first := strings.ToUpper(strings.Split(s, "")[0])
stringMap[first] = append(stringMap[first], s) stringMap[first] = append(stringMap[first], s)
} }
stringGroups := []stringGroup{} stringGroups := []stringGroup{}