chore: style fixes from go fix (#10846)
Just `go fix ./...` Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -313,7 +313,7 @@ nextScript:
|
||||
// files on lines containing only a semicolon and execute them
|
||||
// separately. We require it on a separate line because there are
|
||||
// also statement-internal semicolons in the triggers.
|
||||
for _, stmt := range strings.Split(string(bs), "\n;") {
|
||||
for stmt := range strings.SplitSeq(string(bs), "\n;") {
|
||||
if _, err := tx.Exec(s.expandTemplateVars(stmt)); err != nil {
|
||||
if strings.Contains(stmt, "syncthing:ignore-failure") {
|
||||
// We're ok with this failing. Just note it.
|
||||
|
||||
@@ -474,10 +474,7 @@ func (s *folderDB) recalcGlobalForFile(txp *txPreparedStmts, file string) error
|
||||
// The global version is the first one in the list that is not invalid,
|
||||
// or just the first one in the list if all are invalid.
|
||||
var global fileRow
|
||||
globIdx := slices.IndexFunc(es, func(e fileRow) bool { return !e.IsInvalid() })
|
||||
if globIdx < 0 {
|
||||
globIdx = 0
|
||||
}
|
||||
globIdx := max(slices.IndexFunc(es, func(e fileRow) bool { return !e.IsInvalid() }), 0)
|
||||
global = es[globIdx]
|
||||
|
||||
// We "have" the file if the position in the list of versions is at the
|
||||
|
||||
@@ -41,8 +41,8 @@ func SetDefaultLevel(level slog.Level) {
|
||||
}
|
||||
|
||||
func SetLevelOverrides(sttrace string) {
|
||||
pkgs := strings.Split(sttrace, ",")
|
||||
for _, pkg := range pkgs {
|
||||
pkgs := strings.SplitSeq(sttrace, ",")
|
||||
for pkg := range pkgs {
|
||||
pkg = strings.TrimSpace(pkg)
|
||||
if pkg == "" {
|
||||
continue
|
||||
|
||||
@@ -45,11 +45,11 @@ type adapter struct {
|
||||
l *slog.Logger
|
||||
}
|
||||
|
||||
func (a adapter) Debugln(vals ...interface{}) {
|
||||
func (a adapter) Debugln(vals ...any) {
|
||||
a.log(strings.TrimSpace(fmt.Sprintln(vals...)), slog.LevelDebug)
|
||||
}
|
||||
|
||||
func (a adapter) Debugf(format string, vals ...interface{}) {
|
||||
func (a adapter) Debugf(format string, vals ...any) {
|
||||
a.log(fmt.Sprintf(format, vals...), slog.LevelDebug)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user