From e4b0253ec674e921d576e8517068b6d2ec276eb4 Mon Sep 17 00:00:00 2001 From: zu1k Date: Tue, 26 Oct 2021 13:23:05 +0800 Subject: [PATCH] fix: Trim result --- internal/db/db.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/db/db.go b/internal/db/db.go index 70765a5..21504db 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -3,6 +3,7 @@ package db import ( "os" "path/filepath" + "strings" "github.com/zu1k/nali/internal/constant" "github.com/zu1k/nali/pkg/cdn" @@ -105,5 +106,7 @@ func Find(typ dbif.QueryType, query string) string { if err != nil { return "" } - return result.String() + r := strings.Trim(result.String(), " ") + queryCache[query] = r + return r }