Skip to content

Commit

Permalink
func
Browse files Browse the repository at this point in the history
func
  • Loading branch information
jiuker committed Feb 11, 2025
1 parent 6ea9694 commit 7b7d191
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/common-methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package cmd
import (
"context"
"errors"
"fmt"
"github.com/minio/cli"

Check failure on line 23 in cmd/common-methods.go

View workflow job for this annotation

GitHub Actions / vetchecks

File is not properly formatted (gofumpt)

Check failure on line 23 in cmd/common-methods.go

View workflow job for this annotation

GitHub Actions / Test on Go 1.23.x and ubuntu-latest

File is not properly formatted (gofumpt)
"io"
"net/http"
Expand Down Expand Up @@ -601,14 +600,14 @@ type uploadSourceToTargetURLOpts struct {
ifNotExists bool
}

func parseCustomHeader(ctx *cli.Context) (http.Header, error) {
func getCustomHeader(ctx *cli.Context) http.Header {

Check failure on line 603 in cmd/common-methods.go

View workflow job for this annotation

GitHub Actions / vetchecks

func `getCustomHeader` is unused (unused)

Check failure on line 603 in cmd/common-methods.go

View workflow job for this annotation

GitHub Actions / Test on Go 1.23.x and ubuntu-latest

func `getCustomHeader` is unused (unused)
customHeader := make(http.Header)
for _, h := range ctx.StringSlice("header") {
i := strings.IndexByte(h, ':')
if i <= 0 {
return nil, fmt.Errorf("invalid header entry %s", h)
fatalIf(probe.NewError(errors.New("invalid header")), "'key:value' format.")
}
customHeader.Add(h[:i], h[i+1:])
}
return customHeader, nil
return customHeader
}

0 comments on commit 7b7d191

Please sign in to comment.