Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

go fix

Chris Lue4b70c252154
diff --git a/test/foundationdb/foundationdb_concurrent_test.go b/test/foundationdb/foundationdb_concurrent_test.go
index de49ecc61a..5063ba8946 100644
--- a/test/foundationdb/foundationdb_concurrent_test.go
+++ b/test/foundationdb/foundationdb_concurrent_test.go
@@ -1,5 +1,4 @@
//go:build foundationdb
-// +build foundationdb
package foundationdb
diff --git a/test/foundationdb/foundationdb_integration_test.go b/test/foundationdb/foundationdb_integration_test.go
index 63ed41ef9b..eb60d37078 100644
--- a/test/foundationdb/foundationdb_integration_test.go
+++ b/test/foundationdb/foundationdb_integration_test.go
@@ -1,5 +1,4 @@
//go:build foundationdb
-// +build foundationdb
package foundationdb
diff --git a/test/s3/sse/s3_volume_encryption_test.go b/test/s3/sse/s3_volume_encryption_test.go
index 4a3a5eaa52..cc7849a8dc 100644
--- a/test/s3/sse/s3_volume_encryption_test.go
+++ b/test/s3/sse/s3_volume_encryption_test.go
@@ -1,5 +1,4 @@
//go:build integration
-// +build integration
package sse
diff --git a/unmaintained/disk/disk_status.go b/unmaintained/disk/disk_status.go
index e01b16f225..ddf90e89c8 100644
--- a/unmaintained/disk/disk_status.go
+++ b/unmaintained/disk/disk_status.go
@@ -1,5 +1,4 @@
//go:build !windows && !openbsd && !netbsd && !plan9 && !solaris
-// +build !windows,!openbsd,!netbsd,!plan9,!solaris
package main
diff --git a/weed/command/filer_meta_tail_elastic.go b/weed/command/filer_meta_tail_elastic.go
index 6e18638dd6..308520612b 100644
--- a/weed/command/filer_meta_tail_elastic.go
+++ b/weed/command/filer_meta_tail_elastic.go
@@ -1,5 +1,4 @@
//go:build elastic
-// +build elastic
package command
diff --git a/weed/command/filer_meta_tail_non_elastic.go b/weed/command/filer_meta_tail_non_elastic.go
index 989e32bec5..7bb6fa2aba 100644
--- a/weed/command/filer_meta_tail_non_elastic.go
+++ b/weed/command/filer_meta_tail_non_elastic.go
@@ -1,5 +1,4 @@
//go:build !elastic
-// +build !elastic
package command
diff --git a/weed/command/filer_sync_std.go b/weed/command/filer_sync_std.go
index 1f9b6fa148..8013337511 100644
--- a/weed/command/filer_sync_std.go
+++ b/weed/command/filer_sync_std.go
@@ -1,5 +1,4 @@
//go:build !windows
-// +build !windows
package command
diff --git a/weed/command/fuse_notsupported.go b/weed/command/fuse_notsupported.go
index ce54707919..8437a658a3 100644
--- a/weed/command/fuse_notsupported.go
+++ b/weed/command/fuse_notsupported.go
@@ -1,5 +1,4 @@
//go:build !darwin && !freebsd && !linux
-// +build !darwin,!freebsd,!linux
package command
diff --git a/weed/command/fuse_std.go b/weed/command/fuse_std.go
index 60c3402de1..8fb52d5d84 100644
--- a/weed/command/fuse_std.go
+++ b/weed/command/fuse_std.go
@@ -1,5 +1,4 @@
//go:build darwin || freebsd || linux
-// +build darwin freebsd linux
package command
diff --git a/weed/command/mount_notsupported.go b/weed/command/mount_notsupported.go
index 1e5c9f53d6..da2a90cd8d 100644
--- a/weed/command/mount_notsupported.go
+++ b/weed/command/mount_notsupported.go
@@ -1,5 +1,4 @@
//go:build !linux && !darwin && !freebsd
-// +build !linux,!darwin,!freebsd
package command
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 22e30a6cbb..57aca5f5c8 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -1,5 +1,4 @@
//go:build linux || darwin || freebsd
-// +build linux darwin freebsd
package command
diff --git a/weed/command/mount_std_test.go b/weed/command/mount_std_test.go
index e4b8e7598d..e41540b467 100644
--- a/weed/command/mount_std_test.go
+++ b/weed/command/mount_std_test.go
@@ -1,5 +1,4 @@
//go:build linux || darwin || freebsd
-// +build linux darwin freebsd
package command
diff --git a/weed/command/update_full.go b/weed/command/update_full.go
index 95ca5fc00d..6f9a324d1c 100644
--- a/weed/command/update_full.go
+++ b/weed/command/update_full.go
@@ -1,5 +1,4 @@
//go:build elastic && gocdk && rclone && sqlite && tarantool && tikv && ydb
-// +build elastic,gocdk,rclone,sqlite,tarantool,tikv,ydb
package command
diff --git a/weed/filer/elastic/v7/elastic_store.go b/weed/filer/elastic/v7/elastic_store.go
index 159330decc..db67b405d0 100644
--- a/weed/filer/elastic/v7/elastic_store.go
+++ b/weed/filer/elastic/v7/elastic_store.go
@@ -1,5 +1,4 @@
//go:build elastic
-// +build elastic
package elastic
diff --git a/weed/filer/elastic/v7/elastic_store_kv.go b/weed/filer/elastic/v7/elastic_store_kv.go
index 6986ea7ef9..f662639ff9 100644
--- a/weed/filer/elastic/v7/elastic_store_kv.go
+++ b/weed/filer/elastic/v7/elastic_store_kv.go
@@ -1,5 +1,4 @@
//go:build elastic
-// +build elastic
package elastic
diff --git a/weed/filer/foundationdb/foundationdb_store.go b/weed/filer/foundationdb/foundationdb_store.go
index abbf550911..b413d260f6 100644
--- a/weed/filer/foundationdb/foundationdb_store.go
+++ b/weed/filer/foundationdb/foundationdb_store.go
@@ -1,5 +1,4 @@
//go:build foundationdb
-// +build foundationdb
// Package foundationdb provides a filer store implementation using FoundationDB as the backend.
//
diff --git a/weed/filer/foundationdb/foundationdb_store_test.go b/weed/filer/foundationdb/foundationdb_store_test.go
index aab8b1f651..72f8b27adf 100644
--- a/weed/filer/foundationdb/foundationdb_store_test.go
+++ b/weed/filer/foundationdb/foundationdb_store_test.go
@@ -1,5 +1,4 @@
//go:build foundationdb
-// +build foundationdb
package foundationdb
diff --git a/weed/filer/sqlite/sqlite_store.go b/weed/filer/sqlite/sqlite_store.go
index 6c9ca4ecc4..5f04e64701 100644
--- a/weed/filer/sqlite/sqlite_store.go
+++ b/weed/filer/sqlite/sqlite_store.go
@@ -1,6 +1,4 @@
//go:build (linux || darwin || windows) && sqlite
-// +build linux darwin windows
-// +build sqlite
// limited GOOS due to modernc.org/libc/unistd
diff --git a/weed/filer/sqlite/sqlite_store_unsupported.go b/weed/filer/sqlite/sqlite_store_unsupported.go
index 351d2e501f..377267d615 100644
--- a/weed/filer/sqlite/sqlite_store_unsupported.go
+++ b/weed/filer/sqlite/sqlite_store_unsupported.go
@@ -1,5 +1,4 @@
//go:build !linux && !darwin && !windows && !s390 && !ppc64le && !mips64 && !sqlite
-// +build !linux,!darwin,!windows,!s390,!ppc64le,!mips64,!sqlite
// limited GOOS due to modernc.org/libc/unistd
diff --git a/weed/filer/tarantool/tarantool_store.go b/weed/filer/tarantool/tarantool_store.go
index 1bcd318306..beba41ed43 100644
--- a/weed/filer/tarantool/tarantool_store.go
+++ b/weed/filer/tarantool/tarantool_store.go
@@ -1,5 +1,4 @@
//go:build tarantool
-// +build tarantool
package tarantool
diff --git a/weed/filer/tarantool/tarantool_store_kv.go b/weed/filer/tarantool/tarantool_store_kv.go
index e45ff778cf..0b4811c90a 100644
--- a/weed/filer/tarantool/tarantool_store_kv.go
+++ b/weed/filer/tarantool/tarantool_store_kv.go
@@ -1,5 +1,4 @@
//go:build tarantool
-// +build tarantool
package tarantool
diff --git a/weed/filer/tarantool/tarantool_store_test.go b/weed/filer/tarantool/tarantool_store_test.go
index 5002897736..3fb6f7ebdf 100644
--- a/weed/filer/tarantool/tarantool_store_test.go
+++ b/weed/filer/tarantool/tarantool_store_test.go
@@ -1,5 +1,4 @@
//go:build tarantool
-// +build tarantool
package tarantool
diff --git a/weed/filer/tikv/tikv_store.go b/weed/filer/tikv/tikv_store.go
index 72f9461bf3..d6ba8f2844 100644
--- a/weed/filer/tikv/tikv_store.go
+++ b/weed/filer/tikv/tikv_store.go
@@ -1,5 +1,4 @@
//go:build tikv
-// +build tikv
package tikv
diff --git a/weed/filer/tikv/tikv_store_kv.go b/weed/filer/tikv/tikv_store_kv.go
index 1f32dfb963..e6bba72fef 100644
--- a/weed/filer/tikv/tikv_store_kv.go
+++ b/weed/filer/tikv/tikv_store_kv.go
@@ -1,5 +1,4 @@
//go:build tikv
-// +build tikv
package tikv
diff --git a/weed/filer/ydb/ydb_queries.go b/weed/filer/ydb/ydb_queries.go
index baafc59a19..1118cceb64 100644
--- a/weed/filer/ydb/ydb_queries.go
+++ b/weed/filer/ydb/ydb_queries.go
@@ -1,5 +1,4 @@
//go:build ydb
-// +build ydb
package ydb
diff --git a/weed/filer/ydb/ydb_store.go b/weed/filer/ydb/ydb_store.go
index ee94d13e17..66a38cc0f9 100644
--- a/weed/filer/ydb/ydb_store.go
+++ b/weed/filer/ydb/ydb_store.go
@@ -1,5 +1,4 @@
//go:build ydb
-// +build ydb
package ydb
diff --git a/weed/filer/ydb/ydb_store_kv.go b/weed/filer/ydb/ydb_store_kv.go
index decec14ea0..581dd4acff 100644
--- a/weed/filer/ydb/ydb_store_kv.go
+++ b/weed/filer/ydb/ydb_store_kv.go
@@ -1,5 +1,4 @@
//go:build ydb
-// +build ydb
package ydb
diff --git a/weed/filer/ydb/ydb_store_test.go b/weed/filer/ydb/ydb_store_test.go
index 14ff769e9f..c53c7515c4 100644
--- a/weed/filer/ydb/ydb_store_test.go
+++ b/weed/filer/ydb/ydb_store_test.go
@@ -1,5 +1,4 @@
//go:build ydb
-// +build ydb
package ydb
diff --git a/weed/filer/ydb/ydb_types.go b/weed/filer/ydb/ydb_types.go
index af6ceec052..9eb42705b7 100644
--- a/weed/filer/ydb/ydb_types.go
+++ b/weed/filer/ydb/ydb_types.go
@@ -1,5 +1,4 @@
//go:build ydb
-// +build ydb
package ydb
diff --git a/weed/iam/oidc/mock_provider_test.go b/weed/iam/oidc/mock_provider_test.go
index 920b2b3be5..b6baf00426 100644
--- a/weed/iam/oidc/mock_provider_test.go
+++ b/weed/iam/oidc/mock_provider_test.go
@@ -1,5 +1,4 @@
//go:build test
-// +build test
package oidc
diff --git a/weed/mount/unmount/unmount_std.go b/weed/mount/unmount/unmount_std.go
index 410eb12352..fcb09f3edd 100644
--- a/weed/mount/unmount/unmount_std.go
+++ b/weed/mount/unmount/unmount_std.go
@@ -1,5 +1,4 @@
//go:build !linux && !windows
-// +build !linux,!windows
package unmount
diff --git a/weed/mount/unmount/unmount_unsupported.go b/weed/mount/unmount/unmount_unsupported.go
index d0a94cc4a1..d8d00b776a 100644
--- a/weed/mount/unmount/unmount_unsupported.go
+++ b/weed/mount/unmount/unmount_unsupported.go
@@ -1,5 +1,4 @@
//go:build windows
-// +build windows
package unmount
diff --git a/weed/mount/weedfs_xattr.go b/weed/mount/weedfs_xattr.go
index ade1d3d84d..6a4b9f8baa 100644
--- a/weed/mount/weedfs_xattr.go
+++ b/weed/mount/weedfs_xattr.go
@@ -1,5 +1,4 @@
//go:build !freebsd
-// +build !freebsd
package mount
diff --git a/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go b/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go
index 1e75379183..fa6d854db3 100644
--- a/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go
+++ b/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go
@@ -1,5 +1,4 @@
//go:build gocdk
-// +build gocdk
// Package gocdk_pub_sub supports the Go CDK (Cloud Development Kit) PubSub API,
// which in turn supports many providers, including Amazon SNS/SQS, Azure Service Bus,
diff --git a/weed/replication/sub/notification_gocdk_pub_sub.go b/weed/replication/sub/notification_gocdk_pub_sub.go
index 0632c6bf01..26e2234529 100644
--- a/weed/replication/sub/notification_gocdk_pub_sub.go
+++ b/weed/replication/sub/notification_gocdk_pub_sub.go
@@ -1,5 +1,4 @@
//go:build gocdk
-// +build gocdk
package sub
diff --git a/weed/s3api/policy_engine/examples.go b/weed/s3api/policy_engine/examples.go
index c4cea6512d..14cd512689 100644
--- a/weed/s3api/policy_engine/examples.go
+++ b/weed/s3api/policy_engine/examples.go
@@ -1,5 +1,4 @@
//go:build ignore
-// +build ignore
package policy_engine
diff --git a/weed/server/filer_server_rocksdb.go b/weed/server/filer_server_rocksdb.go
index 57b1d08f81..9a03e35e07 100644
--- a/weed/server/filer_server_rocksdb.go
+++ b/weed/server/filer_server_rocksdb.go
@@ -1,5 +1,4 @@
//go:build rocksdb
-// +build rocksdb
package weed_server
diff --git a/weed/server/volume_grpc_client_to_master.go b/weed/server/volume_grpc_client_to_master.go
index a4349771b8..e2523543a6 100644
--- a/weed/server/volume_grpc_client_to_master.go
+++ b/weed/server/volume_grpc_client_to_master.go
@@ -15,7 +15,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
- "golang.org/x/net/context"
+ "context"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
diff --git a/weed/stats/disk_notsupported.go b/weed/stats/disk_notsupported.go
index 956c7bf9f0..8dbe14c37d 100644
--- a/weed/stats/disk_notsupported.go
+++ b/weed/stats/disk_notsupported.go
@@ -1,5 +1,4 @@
//go:build netbsd || plan9
-// +build netbsd plan9
package stats
diff --git a/weed/stats/disk_openbsd.go b/weed/stats/disk_openbsd.go
index 1be41e5c72..a8511de449 100644
--- a/weed/stats/disk_openbsd.go
+++ b/weed/stats/disk_openbsd.go
@@ -1,5 +1,4 @@
//go:build openbsd
-// +build openbsd
package stats
diff --git a/weed/stats/disk_solaris.go b/weed/stats/disk_solaris.go
index cce20e4ccf..dccf87d74e 100644
--- a/weed/stats/disk_solaris.go
+++ b/weed/stats/disk_solaris.go
@@ -1,5 +1,4 @@
//go:build solaris
-// +build solaris
package stats
diff --git a/weed/stats/disk_supported.go b/weed/stats/disk_supported.go
index aad065e261..807f62bce6 100644
--- a/weed/stats/disk_supported.go
+++ b/weed/stats/disk_supported.go
@@ -1,5 +1,4 @@
//go:build !windows && !openbsd && !netbsd && !plan9 && !solaris
-// +build !windows,!openbsd,!netbsd,!plan9,!solaris
package stats
diff --git a/weed/stats/memory_notsupported.go b/weed/stats/memory_notsupported.go
index f795aec9ce..49bde254e4 100644
--- a/weed/stats/memory_notsupported.go
+++ b/weed/stats/memory_notsupported.go
@@ -1,5 +1,4 @@
//go:build !linux
-// +build !linux
package stats
diff --git a/weed/stats/memory_supported.go b/weed/stats/memory_supported.go
index f7a577813d..3b94d9bc0b 100644
--- a/weed/stats/memory_supported.go
+++ b/weed/stats/memory_supported.go
@@ -1,5 +1,4 @@
//go:build linux
-// +build linux
package stats
diff --git a/weed/storage/backend/memory_map/memory_map_other.go b/weed/storage/backend/memory_map/memory_map_other.go
index 63c168f6a4..2b49c5d8a6 100644
--- a/weed/storage/backend/memory_map/memory_map_other.go
+++ b/weed/storage/backend/memory_map/memory_map_other.go
@@ -1,5 +1,4 @@
//go:build !windows
-// +build !windows
package memory_map
diff --git a/weed/storage/backend/memory_map/memory_map_windows.go b/weed/storage/backend/memory_map/memory_map_windows.go
index b120c8dd75..4392dbcc94 100644
--- a/weed/storage/backend/memory_map/memory_map_windows.go
+++ b/weed/storage/backend/memory_map/memory_map_windows.go
@@ -1,5 +1,4 @@
//go:build windows
-// +build windows
package memory_map
diff --git a/weed/storage/backend/rclone_backend/rclone_backend.go b/weed/storage/backend/rclone_backend/rclone_backend.go
index c954c0b73d..db0b5d0d39 100644
--- a/weed/storage/backend/rclone_backend/rclone_backend.go
+++ b/weed/storage/backend/rclone_backend/rclone_backend.go
@@ -1,5 +1,4 @@
//go:build rclone
-// +build rclone
package rclone_backend
diff --git a/weed/storage/backend/rclone_backend/rclone_progress.go b/weed/storage/backend/rclone_backend/rclone_progress.go
index 738f33d825..aa1a6bedd2 100644
--- a/weed/storage/backend/rclone_backend/rclone_progress.go
+++ b/weed/storage/backend/rclone_backend/rclone_progress.go
@@ -1,5 +1,4 @@
//go:build rclone
-// +build rclone
package rclone_backend
diff --git a/weed/storage/backend/volume_create.go b/weed/storage/backend/volume_create.go
index def3768221..4f26f86940 100644
--- a/weed/storage/backend/volume_create.go
+++ b/weed/storage/backend/volume_create.go
@@ -1,5 +1,4 @@
//go:build !linux && !windows
-// +build !linux,!windows
package backend
diff --git a/weed/storage/backend/volume_create_linux.go b/weed/storage/backend/volume_create_linux.go
index 2e52cce1b5..ab3481fd67 100644
--- a/weed/storage/backend/volume_create_linux.go
+++ b/weed/storage/backend/volume_create_linux.go
@@ -1,5 +1,4 @@
//go:build linux
-// +build linux
package backend
diff --git a/weed/storage/backend/volume_create_windows.go b/weed/storage/backend/volume_create_windows.go
index b2e0ea92bc..d6eddc81aa 100644
--- a/weed/storage/backend/volume_create_windows.go
+++ b/weed/storage/backend/volume_create_windows.go
@@ -1,5 +1,4 @@
//go:build windows
-// +build windows
package backend
diff --git a/weed/storage/needle_map/compact_map_cases_test.go b/weed/storage/needle_map/compact_map_cases_test.go
index 15a6a7b832..1fe393f3fb 100644
--- a/weed/storage/needle_map/compact_map_cases_test.go
+++ b/weed/storage/needle_map/compact_map_cases_test.go
@@ -1,5 +1,4 @@
//go:build 5BytesOffset
-// +build 5BytesOffset
package needle_map
diff --git a/weed/storage/types/offset_4bytes.go b/weed/storage/types/offset_4bytes.go
index 5835b24d7b..54ed9e00cb 100644
--- a/weed/storage/types/offset_4bytes.go
+++ b/weed/storage/types/offset_4bytes.go
@@ -1,5 +1,4 @@
//go:build !5BytesOffset
-// +build !5BytesOffset
package types
diff --git a/weed/storage/types/offset_5bytes.go b/weed/storage/types/offset_5bytes.go
index 4b16bd8220..0feb24ab5d 100644
--- a/weed/storage/types/offset_5bytes.go
+++ b/weed/storage/types/offset_5bytes.go
@@ -1,5 +1,4 @@
//go:build 5BytesOffset
-// +build 5BytesOffset
package types
diff --git a/weed/util/constants_4bytes.go b/weed/util/constants_4bytes.go
index 4cf07165e1..aa8dde6390 100644
--- a/weed/util/constants_4bytes.go
+++ b/weed/util/constants_4bytes.go
@@ -1,5 +1,4 @@
//go:build !5BytesOffset
-// +build !5BytesOffset
package util
diff --git a/weed/util/constants_5bytes.go b/weed/util/constants_5bytes.go
index 406287440e..2ed9009c3d 100644
--- a/weed/util/constants_5bytes.go
+++ b/weed/util/constants_5bytes.go
@@ -1,5 +1,4 @@
//go:build 5BytesOffset
-// +build 5BytesOffset
package util
diff --git a/weed/util/constants_lifecycle_interval_10sec.go b/weed/util/constants_lifecycle_interval_10sec.go
index 60f19c3167..449b5119fb 100644
--- a/weed/util/constants_lifecycle_interval_10sec.go
+++ b/weed/util/constants_lifecycle_interval_10sec.go
@@ -1,5 +1,4 @@
//go:build s3tests
-// +build s3tests
package util
diff --git a/weed/util/constants_lifecycle_interval_day.go b/weed/util/constants_lifecycle_interval_day.go
index e2465ad5f8..e3d5c817e4 100644
--- a/weed/util/constants_lifecycle_interval_day.go
+++ b/weed/util/constants_lifecycle_interval_day.go
@@ -1,5 +1,4 @@
//go:build !s3tests
-// +build !s3tests
package util
diff --git a/weed/util/file_util_non_posix.go b/weed/util/file_util_non_posix.go
index 29aecffa61..83e54d534e 100644
--- a/weed/util/file_util_non_posix.go
+++ b/weed/util/file_util_non_posix.go
@@ -1,5 +1,4 @@
//go:build linux || darwin || freebsd || netbsd || openbsd || plan9 || solaris || zos
-// +build linux darwin freebsd netbsd openbsd plan9 solaris zos
package util
diff --git a/weed/util/file_util_posix.go b/weed/util/file_util_posix.go
index 0bec8abad7..4d593e1201 100644
--- a/weed/util/file_util_posix.go
+++ b/weed/util/file_util_posix.go
@@ -1,5 +1,4 @@
//go:build windows
-// +build windows
package util
diff --git a/weed/util/grace/signal_handling.go b/weed/util/grace/signal_handling.go
index a661f939ca..bb2b1f3dba 100644
--- a/weed/util/grace/signal_handling.go
+++ b/weed/util/grace/signal_handling.go
@@ -1,5 +1,4 @@
//go:build !plan9
-// +build !plan9
package grace
diff --git a/weed/util/grace/signal_handling_notsupported.go b/weed/util/grace/signal_handling_notsupported.go
index de898159ac..7e57c1350b 100644
--- a/weed/util/grace/signal_handling_notsupported.go
+++ b/weed/util/grace/signal_handling_notsupported.go
@@ -1,5 +1,4 @@
//go:build plan9
-// +build plan9
package grace