mirror of
https://github.com/astaxie/beego.git
synced 2025-07-10 02:40:17 +00:00
golint cache package
This commit is contained in:
12
cache/conv.go
vendored
12
cache/conv.go
vendored
@ -19,7 +19,7 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// convert interface to string.
|
||||
// GetString convert interface to string.
|
||||
func GetString(v interface{}) string {
|
||||
switch result := v.(type) {
|
||||
case string:
|
||||
@ -34,7 +34,7 @@ func GetString(v interface{}) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// convert interface to int.
|
||||
// GetInt convert interface to int.
|
||||
func GetInt(v interface{}) int {
|
||||
switch result := v.(type) {
|
||||
case int:
|
||||
@ -52,7 +52,7 @@ func GetInt(v interface{}) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
// convert interface to int64.
|
||||
// GetInt64 convert interface to int64.
|
||||
func GetInt64(v interface{}) int64 {
|
||||
switch result := v.(type) {
|
||||
case int:
|
||||
@ -71,7 +71,7 @@ func GetInt64(v interface{}) int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// convert interface to float64.
|
||||
// GetFloat64 convert interface to float64.
|
||||
func GetFloat64(v interface{}) float64 {
|
||||
switch result := v.(type) {
|
||||
case float64:
|
||||
@ -85,7 +85,7 @@ func GetFloat64(v interface{}) float64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// convert interface to bool.
|
||||
// GetBool convert interface to bool.
|
||||
func GetBool(v interface{}) bool {
|
||||
switch result := v.(type) {
|
||||
case bool:
|
||||
@ -99,7 +99,7 @@ func GetBool(v interface{}) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// convert interface to byte slice.
|
||||
// getByteArray convert interface to byte slice.
|
||||
func getByteArray(v interface{}) []byte {
|
||||
switch result := v.(type) {
|
||||
case []byte:
|
||||
|
Reference in New Issue
Block a user