Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
asabya committed Oct 23, 2024
1 parent f5e2ce8 commit dc6f43d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GO ?= go
GOLANGCI_LINT ?= $$($(GO) env GOPATH)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.57.1
GOLANGCI_LINT_VERSION ?= v1.61.0
GOGOPROTOBUF ?= protoc-gen-gogofaster
GOGOPROTOBUF_VERSION ?= v1.3.1

Expand Down
8 changes: 4 additions & 4 deletions cmd/dfs-cli/cmd/fdfs-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (s *fdfsClient) getAccessToken() string {

func (s *fdfsClient) postReq(method, urlPath string, jsonBytes []byte) ([]byte, error) {
// prepare the request
fullUrl := fmt.Sprintf(s.url + urlPath)
fullUrl := fmt.Sprintf("%s%s", s.url, urlPath)
var req *http.Request
var err error
if jsonBytes != nil {
Expand Down Expand Up @@ -178,7 +178,7 @@ func (s *fdfsClient) postReq(method, urlPath string, jsonBytes []byte) ([]byte,
}

func (s *fdfsClient) getReq(urlPath, argsString string) ([]byte, error) {
fullUrl := fmt.Sprintf(s.url + urlPath)
fullUrl := fmt.Sprintf("%s%s", s.url, urlPath)
var req *http.Request
var err error
if argsString != "" {
Expand Down Expand Up @@ -270,7 +270,7 @@ func (s *fdfsClient) uploadMultipartFile(urlPath, fileName string, fileSize int6
return nil, err
}

fullUrl := fmt.Sprintf(s.url + urlPath)
fullUrl := fmt.Sprintf("%s%s", s.url, urlPath)
req, err := http.NewRequest(http.MethodPost, fullUrl, body)
if err != nil {
return nil, err
Expand Down Expand Up @@ -312,7 +312,7 @@ func (s *fdfsClient) uploadMultipartFile(urlPath, fileName string, fileSize int6

func (s *fdfsClient) downloadMultipartFile(method, urlPath string, arguments map[string]string, out *os.File) (int64, error) {
// prepare the request
fullUrl := fmt.Sprintf(s.url + urlPath)
fullUrl := fmt.Sprintf("%s%s", s.url, urlPath)
var req *http.Request
var err error

Expand Down
6 changes: 3 additions & 3 deletions pkg/blockstore/bee/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (s *Client) Do(req *http.Request) (*http.Response, error) {
func (s *Client) UploadSOC(owner, id, signature string, data []byte) (address []byte, err error) {
to := time.Now()
socResStr := socResource(owner, id, signature)
fullUrl := fmt.Sprintf(s.url + socResStr)
fullUrl := fmt.Sprintf("%s%s", s.url, socResStr)

req, err := http.NewRequest(http.MethodPost, fullUrl, bytes.NewBuffer(data))
if err != nil {
Expand Down Expand Up @@ -238,7 +238,7 @@ func (s *Client) UploadSOC(owner, id, signature string, data []byte) (address []
// UploadChunk uploads a chunk to Swarm network.
func (s *Client) UploadChunk(ch swarm.Chunk) (address []byte, err error) {
to := time.Now()
fullUrl := fmt.Sprintf(s.url + chunkUploadDownloadUrl)
fullUrl := fmt.Sprintf("%s%s", s.url, chunkUploadDownloadUrl)
req, err := http.NewRequest(http.MethodPost, fullUrl, bytes.NewBuffer(ch.Data()))
if err != nil {
return nil, err
Expand Down Expand Up @@ -298,7 +298,7 @@ func (s *Client) DownloadChunk(ctx context.Context, address []byte) (data []byte
addrString := swarm.NewAddress(address).String()

path := chunkUploadDownloadUrl + "/" + addrString
fullUrl := fmt.Sprintf(s.url + path)
fullUrl := fmt.Sprintf("%s%s", s.url, path)
req, err := http.NewRequest(http.MethodGet, fullUrl, bytes.NewBuffer(data))
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions pkg/dir/rmdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (d *Directory) RmDir(directoryNameWithPath, podPassword string) error {
return ErrDirectoryNotPresent
}

if dirInode.FileOrDirNames != nil && len(dirInode.FileOrDirNames) > 0 {
if len(dirInode.FileOrDirNames) > 0 {
for _, fileOrDirName := range dirInode.FileOrDirNames {
if strings.HasPrefix(fileOrDirName, "_F_") {
fileName := strings.TrimPrefix(fileOrDirName, "_F_")
Expand Down Expand Up @@ -93,7 +93,7 @@ func (d *Directory) RmRootDir(podPassword string) error {
}
// recursive delete
dirInode := d.GetDirFromDirectoryMap(totalPath)
if dirInode.FileOrDirNames != nil && len(dirInode.FileOrDirNames) > 0 {
if len(dirInode.FileOrDirNames) > 0 {
for _, fileOrDirName := range dirInode.FileOrDirNames {
if strings.HasPrefix(fileOrDirName, "_F_") {
fileName := strings.TrimPrefix(fileOrDirName, "_F_")
Expand Down

0 comments on commit dc6f43d

Please sign in to comment.