update to go1.23 and replace golang.org/x/exp/maps with stdlib maps

This commit is contained in:
Mechiel Lukkien
2025-03-28 16:16:27 +01:00
parent 7a87522be0
commit 027e5754a0
21 changed files with 39 additions and 215 deletions

View File

@ -6,14 +6,14 @@ import (
"errors"
"fmt"
"io"
"maps"
"os"
"path/filepath"
"slices"
"strconv"
"strings"
"time"
"golang.org/x/exp/maps"
"github.com/mjl-/mox/mlog"
)
@ -182,7 +182,7 @@ func (mr *MboxReader) Next() (*Message, *os.File, string, error) {
return nil, nil, mr.Position(), fmt.Errorf("flush: %v", err)
}
m := &Message{Flags: flags, Keywords: maps.Keys(keywords), Size: size}
m := &Message{Flags: flags, Keywords: slices.Sorted(maps.Keys(keywords)), Size: size}
if t := strings.SplitN(fromLine, " ", 3); len(t) == 3 {
layouts := []string{time.ANSIC, time.UnixDate, time.RubyDate}
@ -357,7 +357,7 @@ func (mr *MaildirReader) Next() (*Message, *os.File, string, error) {
}
}
m := &Message{Received: received, Flags: flags, Keywords: maps.Keys(keywords), Size: size}
m := &Message{Received: received, Flags: flags, Keywords: slices.Sorted(maps.Keys(keywords)), Size: size}
// Prevent cleanup by defer.
mf := f