~miki-tebeka/mgo/string-compile

« back to all changes in this revision

Viewing changes to encode.go

  • Committer: Gustavo Niemeyer
  • Date: 2011-04-24 00:39:38 UTC
  • Revision ID: gustavo@niemeyer.net-20110424003938-kr587ptfvs1dvom9
Tags: r2011.04.24
Better handling of pointers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        switch v.Kind() {
150
150
        case reflect.String:
151
151
                return len(v.String()) == 0
152
 
        case reflect.Interface:
 
152
        case reflect.Ptr, reflect.Interface:
153
153
                return v.IsNil()
154
154
        case reflect.Slice:
155
155
                return v.Len() == 0