mirror of https://github.com/jlelse/GoBlog
Fix group strings (with umlauts...)
This commit is contained in:
parent
fae7893f0b
commit
55902a2de9
3
main.go
3
main.go
|
@ -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...")
|
||||
|
||||
|
|
2
utils.go
2
utils.go
|
@ -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{}
|
||||
|
|
Loading…
Reference in New Issue