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

View File

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