Bump pkglib to go1.22 version
This commit is contained in:
parent
84799afda2
commit
2d1f3e3819
9 changed files with 31 additions and 36 deletions
|
|
@ -42,7 +42,7 @@ func (log *Logger) For(ctx context.Context, slug string) (exports []models.Expor
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return collection.Filter(exports, func(s models.Export) bool {
|
||||
return collection.KeepFunc(exports, func(s models.Export) bool {
|
||||
return s.Slug == slug
|
||||
}), nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,11 +138,12 @@ func MarshalMap(m map[string]any) string {
|
|||
var builder strings.Builder
|
||||
|
||||
builder.WriteString("array(")
|
||||
collection.IterateSorted(m, func(k string, v any) {
|
||||
collection.IterateSorted(m, func(k string, v any) bool {
|
||||
builder.WriteString(MarshalString(k))
|
||||
builder.WriteString("=>")
|
||||
builder.WriteString(MarshalJSON(v))
|
||||
builder.WriteString(",")
|
||||
return true
|
||||
})
|
||||
builder.WriteString(")")
|
||||
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/tkw1536/pkglib/collection"
|
||||
"github.com/tkw1536/pkglib/lazy"
|
||||
"github.com/tkw1536/pkglib/status"
|
||||
"github.com/tkw1536/pkglib/stream"
|
||||
|
|
@ -285,8 +285,8 @@ func init() {
|
|||
}
|
||||
|
||||
// remove comment lines
|
||||
lines = collection.Filter(lines, func(line string) bool {
|
||||
return !strings.HasPrefix(line, "//")
|
||||
lines = slices.DeleteFunc(lines, func(line string) bool {
|
||||
return strings.HasPrefix(line, "//")
|
||||
})
|
||||
|
||||
serverPHP = minifier.ReplaceAllString(strings.Join(lines, ""), "$1")
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ func (prefixes *Prefixes) getLivePrefixes(ctx context.Context, server *phpx.Serv
|
|||
}
|
||||
|
||||
// filter out blocked prefixes
|
||||
return collection.Filter(pfs, func(uri string) bool { return !hasAnyPrefix(uri, blocks) }), nil
|
||||
return slices.DeleteFunc(pfs, func(uri string) bool { return hasAnyPrefix(uri, blocks) }), nil
|
||||
}
|
||||
|
||||
func (wisski *Prefixes) getAdapterPrefixes(ctx context.Context, server *phpx.Server) (pfs []string, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue