all: Run modernize -fix ./...

This commit is contained in:
Bjørn Erik Pedersen
2025-02-26 10:15:04 +01:00
parent b7ae24b9c2
commit 521911a576
141 changed files with 302 additions and 354 deletions

View File

@@ -27,6 +27,7 @@ import (
"github.com/gohugoio/hugo/resources"
"github.com/gohugoio/hugo/resources/resource"
"github.com/spf13/afero"
"slices"
)
const (
@@ -167,15 +168,11 @@ func createBuildPlugins(rs *resources.Spec, assetsResolver *fsResolver, depsMana
}
}
for _, ext := range opts.Externals {
// ESBuild will do a more thorough check for packages resolved in node_modules,
// but we need to make sure that we don't try to resolve these in the /assets folder.
if ext == impPath {
return api.OnResolveResult{
Path: impPath,
External: true,
}, nil
}
if slices.Contains(opts.Externals, impPath) {
return api.OnResolveResult{
Path: impPath,
External: true,
}, nil
}
if opts.ImportOnResolveFunc != nil {

View File

@@ -384,7 +384,7 @@ func newDispatcher[Q, R any](opts Options) (*dispatcherPool[Q, R], error) {
}
inOuts := make([]*inOut, opts.PoolSize)
for i := 0; i < opts.PoolSize; i++ {
for i := range opts.PoolSize {
var stdin, stdout hugio.ReadWriteCloser
stdin = hugio.NewPipeReadWriteCloser()
@@ -478,7 +478,7 @@ func newDispatcher[Q, R any](opts Options) (*dispatcherPool[Q, R], error) {
close(dp.donec)
}()
for i := 0; i < len(inOuts); i++ {
for i := range inOuts {
d := &dispatcher[Q, R]{
pending: make(map[uint32]*call[Q, R]),
inOut: inOuts[i],

View File

@@ -101,7 +101,7 @@ func TestGreet(t *testing.T) {
Infof: t.Logf,
}
for i := 0; i < 2; i++ {
for range 2 {
func() {
d, err := Start[person, greeting](opts)
if err != nil {
@@ -123,7 +123,7 @@ func TestGreet(t *testing.T) {
},
}
for j := 0; j < 20; j++ {
for j := range 20 {
inputMessage.Header.ID = uint32(j + 1)
g, err := d.Execute(ctx, inputMessage)
if err != nil {
@@ -163,7 +163,7 @@ func TestGreetParallel(t *testing.T) {
ctx := context.Background()
for j := 0; j < 5; j++ {
for j := range 5 {
base := i * 100
id := uint32(base + j)
@@ -217,7 +217,7 @@ func TestKatexParallel(t *testing.T) {
ctx := context.Background()
for j := 0; j < 1; j++ {
for j := range 1 {
base := i * 100
id := uint32(base + j)