mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:20:54 +00:00
remove the dead code
This commit is contained in:
parent
e665a7dd32
commit
4823a0f114
12
cache/conv.go
vendored
12
cache/conv.go
vendored
@ -98,15 +98,3 @@ func GetBool(v interface{}) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// getByteArray convert interface to byte slice.
|
|
||||||
func getByteArray(v interface{}) []byte {
|
|
||||||
switch result := v.(type) {
|
|
||||||
case []byte:
|
|
||||||
return result
|
|
||||||
case string:
|
|
||||||
return []byte(result)
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -63,7 +63,7 @@ var (
|
|||||||
dbBasers = map[DriverType]dbBaser{
|
dbBasers = map[DriverType]dbBaser{
|
||||||
DRMySQL: newdbBaseMysql(),
|
DRMySQL: newdbBaseMysql(),
|
||||||
DRSqlite: newdbBaseSqlite(),
|
DRSqlite: newdbBaseSqlite(),
|
||||||
DROracle: newdbBaseMysql(),
|
DROracle: newdbBaseOracle(),
|
||||||
DRPostgres: newdbBasePostgres(),
|
DRPostgres: newdbBasePostgres(),
|
||||||
DRTiDB: newdbBaseTidb(),
|
DRTiDB: newdbBaseTidb(),
|
||||||
}
|
}
|
||||||
|
18
orm/utils.go
18
orm/utils.go
@ -249,30 +249,12 @@ func (a argInt) Get(i int, args ...int) (r int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type argAny []interface{}
|
|
||||||
|
|
||||||
// get interface by index from interface slice
|
|
||||||
func (a argAny) Get(i int, args ...interface{}) (r interface{}) {
|
|
||||||
if i >= 0 && i < len(a) {
|
|
||||||
r = a[i]
|
|
||||||
}
|
|
||||||
if len(args) > 0 {
|
|
||||||
r = args[0]
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse time to string with location
|
// parse time to string with location
|
||||||
func timeParse(dateString, format string) (time.Time, error) {
|
func timeParse(dateString, format string) (time.Time, error) {
|
||||||
tp, err := time.ParseInLocation(format, dateString, DefaultTimeLoc)
|
tp, err := time.ParseInLocation(format, dateString, DefaultTimeLoc)
|
||||||
return tp, err
|
return tp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// format time string
|
|
||||||
func timeFormat(t time.Time, format string) string {
|
|
||||||
return t.Format(format)
|
|
||||||
}
|
|
||||||
|
|
||||||
// get pointer indirect type
|
// get pointer indirect type
|
||||||
func indirectType(v reflect.Type) reflect.Type {
|
func indirectType(v reflect.Type) reflect.Type {
|
||||||
switch v.Kind() {
|
switch v.Kind() {
|
||||||
|
@ -48,8 +48,6 @@ var redispder = &Provider{}
|
|||||||
// redis max pool size
|
// redis max pool size
|
||||||
var MaxPoolSize = 100
|
var MaxPoolSize = 100
|
||||||
|
|
||||||
var redisPool chan redis.Conn
|
|
||||||
|
|
||||||
// SessionStore redis session store
|
// SessionStore redis session store
|
||||||
type SessionStore struct {
|
type SessionStore struct {
|
||||||
p *redis.Pool
|
p *redis.Pool
|
||||||
|
@ -518,7 +518,6 @@ const (
|
|||||||
complexKind
|
complexKind
|
||||||
intKind
|
intKind
|
||||||
floatKind
|
floatKind
|
||||||
integerKind
|
|
||||||
stringKind
|
stringKind
|
||||||
uintKind
|
uintKind
|
||||||
)
|
)
|
||||||
|
@ -26,12 +26,6 @@ var (
|
|||||||
dunno = []byte("???")
|
dunno = []byte("???")
|
||||||
centerDot = []byte("·")
|
centerDot = []byte("·")
|
||||||
dot = []byte(".")
|
dot = []byte(".")
|
||||||
lbr = []byte("{")
|
|
||||||
lbrn = []byte("{\n")
|
|
||||||
com = []byte(",")
|
|
||||||
comn = []byte(",\n")
|
|
||||||
rbr = []byte("}")
|
|
||||||
comnrbr = []byte(",\n}")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type pointerInfo struct {
|
type pointerInfo struct {
|
||||||
@ -376,8 +370,8 @@ func printKeyValue(buf *bytes.Buffer, val reflect.Value, pointers **pointerInfo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dump pointer value
|
// PrintPointerInfo dump pointer value
|
||||||
func printPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo) {
|
func PrintPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo) {
|
||||||
var anyused = false
|
var anyused = false
|
||||||
var pointerNum = 0
|
var pointerNum = 0
|
||||||
|
|
||||||
@ -444,8 +438,8 @@ func printPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get stack bytes
|
// Stack get stack bytes
|
||||||
func stack(skip int, indent string) []byte {
|
func Stack(skip int, indent string) []byte {
|
||||||
var buf = new(bytes.Buffer)
|
var buf = new(bytes.Buffer)
|
||||||
|
|
||||||
for i := skip; ; i++ {
|
for i := skip; ; i++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user