rename function to fix sonar

This commit is contained in:
linxiaoyi 2021-05-17 14:43:09 +08:00
parent 511714d616
commit 480bb0e5d0
4 changed files with 30 additions and 29 deletions

View File

@ -40,6 +40,7 @@
- Init exceptMethod by using reflection. [4583](https://github.com/beego/beego/pull/4583)
## Fix Sonar
- [4608](https://github.com/beego/beego/pull/4608)
- [4473](https://github.com/beego/beego/pull/4473)
- [4474](https://github.com/beego/beego/pull/4474)
- [4479](https://github.com/beego/beego/pull/4479)

View File

@ -30,7 +30,7 @@ var (
mutex sync.Mutex
)
func TestFileProvider_SessionExist(t *testing.T) {
func TestFileProviderSessionExist(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -53,7 +53,7 @@ func TestFileProvider_SessionExist(t *testing.T) {
}
}
func TestFileProvider_SessionExist2(t *testing.T) {
func TestFileProviderSessionExist2(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -75,7 +75,7 @@ func TestFileProvider_SessionExist2(t *testing.T) {
}
}
func TestFileProvider_SessionRead(t *testing.T) {
func TestFileProviderSessionRead(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -97,7 +97,7 @@ func TestFileProvider_SessionRead(t *testing.T) {
}
}
func TestFileProvider_SessionRead1(t *testing.T) {
func TestFileProviderSessionRead1(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -117,7 +117,7 @@ func TestFileProvider_SessionRead1(t *testing.T) {
}
}
func TestFileProvider_SessionAll(t *testing.T) {
func TestFileProviderSessionAll(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -140,7 +140,7 @@ func TestFileProvider_SessionAll(t *testing.T) {
}
}
func TestFileProvider_SessionRegenerate(t *testing.T) {
func TestFileProviderSessionRegenerate(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -172,7 +172,7 @@ func TestFileProvider_SessionRegenerate(t *testing.T) {
}
}
func TestFileProvider_SessionDestroy(t *testing.T) {
func TestFileProviderSessionDestroy(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -200,7 +200,7 @@ func TestFileProvider_SessionDestroy(t *testing.T) {
}
}
func TestFileProvider_SessionGC(t *testing.T) {
func TestFileProviderSessionGC(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -226,7 +226,7 @@ func TestFileProvider_SessionGC(t *testing.T) {
}
}
func TestFileSessionStore_Set(t *testing.T) {
func TestFileSessionStoreSet(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -245,7 +245,7 @@ func TestFileSessionStore_Set(t *testing.T) {
}
}
func TestFileSessionStore_Get(t *testing.T) {
func TestFileSessionStoreGet(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -266,7 +266,7 @@ func TestFileSessionStore_Get(t *testing.T) {
}
}
func TestFileSessionStore_Delete(t *testing.T) {
func TestFileSessionStoreDelete(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -289,7 +289,7 @@ func TestFileSessionStore_Delete(t *testing.T) {
}
}
func TestFileSessionStore_Flush(t *testing.T) {
func TestFileSessionStoreFlush(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -313,7 +313,7 @@ func TestFileSessionStore_Flush(t *testing.T) {
}
}
func TestFileSessionStore_SessionID(t *testing.T) {
func TestFileSessionStoreSessionID(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)

View File

@ -18,7 +18,7 @@ import (
"testing"
)
func Test_gob(t *testing.T) {
func TestGob(t *testing.T) {
a := make(map[interface{}]interface{})
a["username"] = "astaxie"
a[12] = 234

View File

@ -31,7 +31,7 @@ var (
mutex sync.Mutex
)
func TestFileProvider_SessionInit(t *testing.T) {
func TestFileProviderSessionInit(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -48,7 +48,7 @@ func TestFileProvider_SessionInit(t *testing.T) {
}
}
func TestFileProvider_SessionExist(t *testing.T) {
func TestFileProviderSessionExist(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -79,7 +79,7 @@ func TestFileProvider_SessionExist(t *testing.T) {
}
}
func TestFileProvider_SessionExist2(t *testing.T) {
func TestFileProviderSessionExist2(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -113,7 +113,7 @@ func TestFileProvider_SessionExist2(t *testing.T) {
}
}
func TestFileProvider_SessionRead(t *testing.T) {
func TestFileProviderSessionRead(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -135,7 +135,7 @@ func TestFileProvider_SessionRead(t *testing.T) {
}
}
func TestFileProvider_SessionRead1(t *testing.T) {
func TestFileProviderSessionRead1(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -155,7 +155,7 @@ func TestFileProvider_SessionRead1(t *testing.T) {
}
}
func TestFileProvider_SessionAll(t *testing.T) {
func TestFileProviderSessionAll(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -178,7 +178,7 @@ func TestFileProvider_SessionAll(t *testing.T) {
}
}
func TestFileProvider_SessionRegenerate(t *testing.T) {
func TestFileProviderSessionRegenerate(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -222,7 +222,7 @@ func TestFileProvider_SessionRegenerate(t *testing.T) {
}
}
func TestFileProvider_SessionDestroy(t *testing.T) {
func TestFileProviderSessionDestroy(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -258,7 +258,7 @@ func TestFileProvider_SessionDestroy(t *testing.T) {
}
}
func TestFileProvider_SessionGC(t *testing.T) {
func TestFileProviderSessionGC(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -284,7 +284,7 @@ func TestFileProvider_SessionGC(t *testing.T) {
}
}
func TestFileSessionStore_Set(t *testing.T) {
func TestFileSessionStoreSet(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -303,7 +303,7 @@ func TestFileSessionStore_Set(t *testing.T) {
}
}
func TestFileSessionStore_Get(t *testing.T) {
func TestFileSessionStoreGet(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -324,7 +324,7 @@ func TestFileSessionStore_Get(t *testing.T) {
}
}
func TestFileSessionStore_Delete(t *testing.T) {
func TestFileSessionStoreDelete(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -347,7 +347,7 @@ func TestFileSessionStore_Delete(t *testing.T) {
}
}
func TestFileSessionStore_Flush(t *testing.T) {
func TestFileSessionStoreFlush(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -371,7 +371,7 @@ func TestFileSessionStore_Flush(t *testing.T) {
}
}
func TestFileSessionStore_SessionID(t *testing.T) {
func TestFileSessionStoreSessionID(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)
@ -393,7 +393,7 @@ func TestFileSessionStore_SessionID(t *testing.T) {
}
}
func TestFileSessionStore_SessionRelease(t *testing.T) {
func TestFileSessionStoreSessionRelease(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
os.RemoveAll(sessionPath)