code: func getLen(x interface{}) (ok bool, length int) {
  	v := reflect.ValueOf(x)
  	defer func() {
  		if e := recover(); e != nil {
  			ok = false
  		}
  	}()
  	return true, v.Len()
  }
docs: // getLen try to get length of object.
  // return (false, 0) if impossible.