Browse Source

Optimize file paths

Volodymyr Tkach 2 years ago
parent
commit
357f8fb507
1 changed files with 2 additions and 1 deletions
  1. 2 1
      session/clean.go

+ 2 - 1
session/clean.go

@@ -3,6 +3,7 @@ package session
 import (
 import (
 	"io/ioutil"
 	"io/ioutil"
 	"os"
 	"os"
+	"strings"
 	"time"
 	"time"
 )
 )
 
 
@@ -14,7 +15,7 @@ func Clean(tmpdir string) error {
 	for _, file := range files {
 	for _, file := range files {
 		if len(file.Name()) == 40 {
 		if len(file.Name()) == 40 {
 			if diff := time.Since(file.ModTime()); diff > 24*time.Hour {
 			if diff := time.Since(file.ModTime()); diff > 24*time.Hour {
-				err = os.Remove(tmpdir + string(os.PathSeparator) + file.Name())
+				err = os.Remove(strings.Join([]string{tmpdir, file.Name()}, string(os.PathSeparator)))
 				if err != nil {
 				if err != nil {
 					return err
 					return err
 				}
 				}