chore: execute goimports to format the code (#7983)

* chore: execute goimports to format the code

Signed-off-by: promalert <promalert@outlook.com>

* goimports -w .

---------

Signed-off-by: promalert <promalert@outlook.com>
Co-authored-by: Chris Lu <chris.lu@gmail.com>
This commit is contained in:
promalert
2026-01-08 05:06:08 +08:00
committed by GitHub
parent 6432019d08
commit 9012069bd7
271 changed files with 608 additions and 461 deletions

View File

@@ -1,8 +1,9 @@
package chunk_cache
import (
"github.com/karlseguin/ccache/v2"
"time"
"github.com/karlseguin/ccache/v2"
)
var (

View File

@@ -2,11 +2,12 @@ package chunk_cache
import (
"fmt"
"path"
"slices"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"path"
"slices"
)
type OnDiskCacheLayer struct {

View File

@@ -5,12 +5,13 @@ import (
"crypto/sha256"
"errors"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/glog"
"os"
"os/user"
"path/filepath"
"strings"
"time"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
const maxFilenameLength = 255

View File

@@ -4,13 +4,14 @@
package grace
import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"os"
"os/signal"
"reflect"
"runtime"
"sync"
"syscall"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
var signalChan chan os.Signal

View File

@@ -4,14 +4,15 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
util "github.com/seaweedfs/seaweedfs/weed/util"
"github.com/spf13/viper"
"io"
"net/http"
"net/url"
"os"
"strings"
"sync"
util "github.com/seaweedfs/seaweedfs/weed/util"
"github.com/spf13/viper"
)
var (

View File

@@ -1,8 +1,9 @@
package util
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
func TestHumanReadableIntsMax(t *testing.T) {

View File

@@ -2,10 +2,11 @@ package util
import (
"fmt"
"github.com/stretchr/testify/assert"
"sort"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestAsyncPool(t *testing.T) {

View File

@@ -75,9 +75,9 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition
}
bytesBuf, batchIndex, err = logBuffer.ReadFromBuffer(lastReadPosition)
if err == ResumeFromDiskError {
// Try to read from disk if readFromDiskFn is available
if logBuffer.ReadFromDiskFn != nil {
lastReadPosition, isDone, err = logBuffer.ReadFromDiskFn(lastReadPosition, stopTsNs, eachLogDataFn)
// Try to read from disk if readFromDiskFn is available
if logBuffer.ReadFromDiskFn != nil {
lastReadPosition, isDone, err = logBuffer.ReadFromDiskFn(lastReadPosition, stopTsNs, eachLogDataFn)
if err != nil {
return lastReadPosition, isDone, err
}

View File

@@ -1,8 +1,9 @@
package mem
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAllocateFree(t *testing.T) {

View File

@@ -3,9 +3,10 @@ package util
import (
"errors"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/glog"
"strconv"
"strings"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
// MinFreeSpaceType is the type of MinFreeSpace.

View File

@@ -1,8 +1,9 @@
package util
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewQueue(t *testing.T) {

View File

@@ -1,10 +1,11 @@
package skiplist
import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"google.golang.org/protobuf/proto"
"slices"
"strings"
"github.com/seaweedfs/seaweedfs/weed/glog"
"google.golang.org/protobuf/proto"
)
type NameBatch struct {

View File

@@ -7,10 +7,11 @@
package skiplist
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (