Skip to content

Commit

Permalink
remove the dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
astaxie committed Sep 17, 2015
1 parent e665a7d commit 4823a0f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 44 deletions.
12 changes: 0 additions & 12 deletions cache/conv.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,3 @@ func GetBool(v interface{}) bool {
}
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
}
}
2 changes: 1 addition & 1 deletion orm/db_alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var (
dbBasers = map[DriverType]dbBaser{
DRMySQL: newdbBaseMysql(),
DRSqlite: newdbBaseSqlite(),
DROracle: newdbBaseMysql(),
DROracle: newdbBaseOracle(),
DRPostgres: newdbBasePostgres(),
DRTiDB: newdbBaseTidb(),
}
Expand Down
18 changes: 0 additions & 18 deletions orm/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,30 +249,12 @@ func (a argInt) Get(i int, args ...int) (r int) {
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
func timeParse(dateString, format string) (time.Time, error) {
tp, err := time.ParseInLocation(format, dateString, DefaultTimeLoc)
return tp, err
}

// format time string
func timeFormat(t time.Time, format string) string {
return t.Format(format)
}

// get pointer indirect type
func indirectType(v reflect.Type) reflect.Type {
switch v.Kind() {
Expand Down
2 changes: 0 additions & 2 deletions session/redis/sess_redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ var redispder = &Provider{}
// redis max pool size
var MaxPoolSize = 100

var redisPool chan redis.Conn

// SessionStore redis session store
type SessionStore struct {
p *redis.Pool
Expand Down
1 change: 0 additions & 1 deletion templatefunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ const (
complexKind
intKind
floatKind
integerKind
stringKind
uintKind
)
Expand Down
14 changes: 4 additions & 10 deletions utils/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ var (
dunno = []byte("???")
centerDot = []byte("·")
dot = []byte(".")
lbr = []byte("{")
lbrn = []byte("{\n")
com = []byte(",")
comn = []byte(",\n")
rbr = []byte("}")
comnrbr = []byte(",\n}")
)

type pointerInfo struct {
Expand Down Expand Up @@ -376,8 +370,8 @@ func printKeyValue(buf *bytes.Buffer, val reflect.Value, pointers **pointerInfo,
}
}

// dump pointer value
func printPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo) {
// PrintPointerInfo dump pointer value
func PrintPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo) {
var anyused = false
var pointerNum = 0

Expand Down Expand Up @@ -444,8 +438,8 @@ func printPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo) {
}
}

// get stack bytes
func stack(skip int, indent string) []byte {
// Stack get stack bytes
func Stack(skip int, indent string) []byte {
var buf = new(bytes.Buffer)

for i := skip; ; i++ {
Expand Down

0 comments on commit 4823a0f

Please sign in to comment.