Fix: remove unused code according to golangci-lint

This commit is contained in:
loyalsoldier 2021-05-18 23:30:49 +08:00
parent 7b99c324be
commit c6813f0d24
No known key found for this signature in database
GPG Key ID: 23829BBC1ACF2C90
4 changed files with 3 additions and 30 deletions

View File

@ -23,13 +23,7 @@ import (
"github.com/stretchr/testify/assert"
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
const initError = "init err"
func TestCacheIncr(t *testing.T) {
bm, err := NewCache("memory", `{"interval":20}`)

View File

@ -26,16 +26,7 @@ import (
"github.com/beego/beego/v2/adapter/cache"
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
func TestMemcacheCache(t *testing.T) {
addr := os.Getenv("MEMCACHE_ADDR")
if addr == "" {
addr = "127.0.0.1:11211"

View File

@ -27,11 +27,8 @@ import (
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
initError = "init err"
setError = "set Error"
)
func TestRedisCache(t *testing.T) {
@ -121,5 +118,4 @@ func TestCacheScan(t *testing.T) {
if err = bm.ClearAll(); err != nil {
t.Error("clear all err")
}
}

View File

@ -12,14 +12,6 @@ import (
"github.com/beego/beego/v2/adapter/cache"
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
func TestSsdbcacheCache(t *testing.T) {
ssdbAddr := os.Getenv("SSDB_ADDR")
if ssdbAddr == "" {