Skip to content

Commit

Permalink
From path.Join to filepath.Join (#338)
Browse files Browse the repository at this point in the history
* From path.Join to filepath.Join

Signed-off-by: Daniel González Lopes <[email protected]>

* Add to changelog

Signed-off-by: Daniel González Lopes <[email protected]>
  • Loading branch information
dgzlopes authored Nov 13, 2020
1 parent 9503c34 commit fd43f2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## master / unreleased

* [CHANGE] From path.Join to filepath.Join [#338](https://github.com/grafana/tempo/pull/338)
* [BUGFIX] Frequent errors logged by compactor regarding meta not found [#327](https://github.com/grafana/tempo/pull/327)

## v0.3.0
Expand Down
8 changes: 4 additions & 4 deletions tempodb/backend/diskcache/disk_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"io/ioutil"
"os"
"path"
"path/filepath"
"syscall"
"time"

Expand All @@ -19,7 +19,7 @@ func (r *reader) readOrCacheBloom(ctx context.Context, blockID uuid.UUID, tenant
var skippableError error

k := bloomKey(blockID, tenantID, typeBloom, shardNum)
filename := path.Join(r.cfg.Path, k)
filename := filepath.Join(r.cfg.Path, k)

bytes, err := ioutil.ReadFile(filename)

Expand Down Expand Up @@ -51,7 +51,7 @@ func (r *reader) readOrCacheIndex(ctx context.Context, blockID uuid.UUID, tenant
var skippableError error

k := key(blockID, tenantID, typeIndex)
filename := path.Join(r.cfg.Path, k)
filename := filepath.Join(r.cfg.Path, k)

bytes, err := ioutil.ReadFile(filename)

Expand Down Expand Up @@ -152,7 +152,7 @@ func clean(folder string, allowedMBs int, pruneCount int) (bool, error) {
continue
}

err = os.Remove(path.Join(folder, info.Name()))
err = os.Remove(filepath.Join(folder, info.Name()))
}

return true, err
Expand Down
4 changes: 2 additions & 2 deletions tempodb/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"

"github.com/google/uuid"
Expand Down Expand Up @@ -46,7 +46,7 @@ func New(c *Config) (*WAL, error) {
}

if c.CompletedFilepath == "" {
completedFilepath := path.Join(c.Filepath, completedDir)
completedFilepath := filepath.Join(c.Filepath, completedDir)
err = os.RemoveAll(completedFilepath)
if err != nil {
return nil, err
Expand Down

0 comments on commit fd43f2d

Please sign in to comment.