From 2b40d844a4e91e26ec628ac2cfde60863b212ffa Mon Sep 17 00:00:00 2001 From: Cocoa <0xbbc@0xbbc.com> Date: Tue, 25 Feb 2020 20:56:26 +0800 Subject: [PATCH] fixed typo in glob pattern, `-` -> `.` Signed-off-by: Cocoa <0xbbc@0xbbc.com> --- webp-server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webp-server.go b/webp-server.go index ddf3c84..4b21981 100644 --- a/webp-server.go +++ b/webp-server.go @@ -165,7 +165,7 @@ func main() { // /home/webp_server/exhaust/path/to/tsuki.jpg.1582558100.webp <- older ones will be removed // /home/webp_server/exhaust/path/to/tsuki.jpg.1582558990.webp <- keep the latest one - WebpCachedImgPath := path.Clean(fmt.Sprintf("%s/exhaust%s/%s-*.webp", CurrentPath, DirPath, ImgName)) + WebpCachedImgPath := path.Clean(fmt.Sprintf("%s/exhaust%s/%s.*.webp", CurrentPath, DirPath, ImgName)) matches, err := filepath.Glob(WebpCachedImgPath) if err != nil { fmt.Println(err.Error())