code: func HasField(obj interface{}, name string) (bool, error) {
  	if !hasValidType(obj, []reflect.Kind{reflect.Struct, reflect.Ptr}) {
  		return false, errors.New("Cannot use GetField on a non-struct interface")
  	}
  
  	objValue := reflectValue(obj)
  	objType := objValue.Type()
  	field, ok := objType.FieldByName(name)
  	if !ok || !isExportableField(field) {
  		return false, nil
  	}
  
  	return true, nil
  }
docs: // HasField checks if the provided field name is part of a struct. obj can whether
  // be a structure or pointer to structure.