Browse Source

go fmt

pull/8147/head
Chris Lu 4 days ago
parent
commit
dffe038efa
  1. 22
      weed/cluster/lock_client.go
  2. 6
      weed/s3api/cors/middleware_test.go

22
weed/cluster/lock_client.go

@ -32,17 +32,17 @@ func NewLockClient(grpcDialOption grpc.DialOption, seedFiler pb.ServerAddress) *
} }
type LiveLock struct { type LiveLock struct {
key string
renewToken string
expireAtNs int64
hostFiler pb.ServerAddress
cancelCh chan struct{}
grpcDialOption grpc.DialOption
isLocked int32 // 0 = unlocked, 1 = locked; use atomic operations
self string
lc *LockClient
owner string
lockTTL time.Duration
key string
renewToken string
expireAtNs int64
hostFiler pb.ServerAddress
cancelCh chan struct{}
grpcDialOption grpc.DialOption
isLocked int32 // 0 = unlocked, 1 = locked; use atomic operations
self string
lc *LockClient
owner string
lockTTL time.Duration
consecutiveFailures int // Track connection failures to trigger fallback consecutiveFailures int // Track connection failures to trigger fallback
} }

6
weed/s3api/cors/middleware_test.go

@ -453,7 +453,7 @@ func TestMiddlewareVaryHeader(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
// Setup mocks // Setup mocks
bucketChecker := &mockBucketChecker{bucketExists: true} bucketChecker := &mockBucketChecker{bucketExists: true}
var errCode s3err.ErrorCode var errCode s3err.ErrorCode
if tt.bucketConfig == nil { if tt.bucketConfig == nil {
errCode = s3err.ErrNoSuchCORSConfiguration errCode = s3err.ErrNoSuchCORSConfiguration
@ -503,7 +503,7 @@ func TestMiddlewareVaryHeader(t *testing.T) {
func TestHandleOptionsRequestVaryHeader(t *testing.T) { func TestHandleOptionsRequestVaryHeader(t *testing.T) {
// Setup mocks // Setup mocks
bucketChecker := &mockBucketChecker{bucketExists: true} bucketChecker := &mockBucketChecker{bucketExists: true}
config := &CORSConfiguration{ config := &CORSConfiguration{
CORSRules: []CORSRule{ CORSRules: []CORSRule{
{ {
@ -528,7 +528,7 @@ func TestHandleOptionsRequestVaryHeader(t *testing.T) {
"bucket": "testbucket", "bucket": "testbucket",
"object": "testobject", "object": "testobject",
}) })
// Set valid CORS headers // Set valid CORS headers
req.Header.Set("Origin", "https://example.com") req.Header.Set("Origin", "https://example.com")
req.Header.Set("Access-Control-Request-Method", "GET") req.Header.Set("Access-Control-Request-Method", "GET")

Loading…
Cancel
Save