From ba98f02d021d42c106927e623c7c7222ace49921 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 23 May 2024 08:25:16 -0700 Subject: [PATCH] go fmt --- weed/replication/sink/s3sink/s3_sink.go | 2 +- weed/stats/disk_openbsd.go | 27 ++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/weed/replication/sink/s3sink/s3_sink.go b/weed/replication/sink/s3sink/s3_sink.go index 6e7549cdc..279108e16 100644 --- a/weed/replication/sink/s3sink/s3_sink.go +++ b/weed/replication/sink/s3sink/s3_sink.go @@ -1,6 +1,7 @@ package S3Sink import ( + "encoding/base64" "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" @@ -11,7 +12,6 @@ import ( "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" "strconv" "strings" - "encoding/base64" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" diff --git a/weed/stats/disk_openbsd.go b/weed/stats/disk_openbsd.go index 8224e626e..bb03126bf 100644 --- a/weed/stats/disk_openbsd.go +++ b/weed/stats/disk_openbsd.go @@ -4,22 +4,21 @@ package stats import ( - "syscall" + "syscall" - "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb" + "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb" ) func fillInDiskStatus(disk *volume_server_pb.DiskStatus) { - fs := syscall.Statfs_t{} - err := syscall.Statfs(disk.Dir, &fs) - if err != nil { - return - } - disk.All = fs.F_blocks * uint64(fs.F_bsize) - disk.Free = fs.F_bfree * uint64(fs.F_bsize) - disk.Used = disk.All - disk.Free - disk.PercentFree = float32((float64(disk.Free) / float64(disk.All)) * 100) - disk.PercentUsed = float32((float64(disk.Used) / float64(disk.All)) * 100) - return + fs := syscall.Statfs_t{} + err := syscall.Statfs(disk.Dir, &fs) + if err != nil { + return + } + disk.All = fs.F_blocks * uint64(fs.F_bsize) + disk.Free = fs.F_bfree * uint64(fs.F_bsize) + disk.Used = disk.All - disk.Free + disk.PercentFree = float32((float64(disk.Free) / float64(disk.All)) * 100) + disk.PercentUsed = float32((float64(disk.Used) / float64(disk.All)) * 100) + return } -