Skip to content

Commit

Permalink
cmd/objbench: fix the objbench command run on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Nov 8, 2023
1 parent cea8330 commit 1b975f2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cmd/objbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"os"
"os/user"
"path/filepath"
"runtime"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -167,17 +168,18 @@ func objbench(ctx *cli.Context) error {
pass = fmt.Sprintf("%s%dm%s%s", COLOR_SEQ, GREEN, pass, RESET_SEQ)
failed = fmt.Sprintf("%s%dm%s%s", COLOR_SEQ, RED, failed, RESET_SEQ)
}
nobody, err := user.Lookup("nobody")
if err != nil {
logger.Fatalf("lookup nobody user failed: %v", err)
} else {
group, err := user.LookupGroupId(nobody.Gid)
if runtime.GOOS != "windows" {
nobody, err := user.Lookup("nobody")
if err != nil {
logger.Fatalf("lookup nobody's group failed: %v", err)
logger.Fatalf("lookup nobody user failed: %v", err)
} else {
group, err := user.LookupGroupId(nobody.Gid)
if err != nil {
logger.Fatalf("lookup nobody's group failed: %v", err)
}
groupName = group.Name
}
groupName = group.Name
}

if ctx.Bool("skip-functional-tests") {
if err := blob.Create(); err != nil {
return fmt.Errorf("can't create bucket: %s", err)
Expand Down Expand Up @@ -650,6 +652,7 @@ func functionalTesting(blob object.ObjectStorage, result *[][]string, colorful b
if err != nil {
return "", err
}
defer r.Close()
data, err := io.ReadAll(r)
if err != nil {
return "", err
Expand Down

0 comments on commit 1b975f2

Please sign in to comment.