mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 21:59:12 +00:00
Refactoring part 1: Fix some annoying linter warnings in API code (#1064)
* names, constants of reusable strings, removed unneeded `if`, replaced deprecated imports * more deprecated imports replaced * What is this?)) * Fix a path and quote a var in Dockerfile * Addressing review comments --------- Co-authored-by: Konstantin Koval <kkb@ukr.net>
This commit is contained in:
@@ -37,16 +37,16 @@ func CachePathForMedia(albumID int, mediaID int) (string, error) {
|
||||
return photoCachePath, nil
|
||||
}
|
||||
|
||||
var test_cache_path string = ""
|
||||
var testCachePath string = ""
|
||||
|
||||
func ConfigureTestCache(tmp_dir string) {
|
||||
test_cache_path = tmp_dir
|
||||
func ConfigureTestCache(tmpDir string) {
|
||||
testCachePath = tmpDir
|
||||
}
|
||||
|
||||
// MediaCachePath returns the path for where the media cache is located on the file system
|
||||
func MediaCachePath() string {
|
||||
if test_cache_path != "" {
|
||||
return test_cache_path
|
||||
if testCachePath != "" {
|
||||
return testCachePath
|
||||
}
|
||||
|
||||
photoCache := EnvMediaCachePath.GetValue()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package utils_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
@@ -18,7 +17,7 @@ func TestIsDirSymlink(t *testing.T) {
|
||||
test_utils.FilesystemTest(t)
|
||||
|
||||
// Prepare a temporary directory for testing purposes
|
||||
dir, err := ioutil.TempDir("", "testing")
|
||||
dir, err := os.MkdirTemp("", "testing")
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create temp directory for testing")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user