code: func SetDefaults(data interface{}) {
  	s := reflect.ValueOf(data).Elem()
  	t := s.Type()
  
  	for i := 0; i < s.NumField(); i++ {
  		f := s.Field(i)
  		tag := t.Field(i).Tag
  
  		v := tag.Get("default")
  		if len(v) > 0 {
  			if f.CanInterface() {
  				if parser, ok := f.Interface().(defaultParser); ok {
  					if err := parser.ParseDefault(v); err != nil {
  						panic(err)
  					}
  					continue
  				}
  			}
  
  			if f.CanAddr() && f.Addr().CanInterface() {
  				if parser, ok := f.Addr().Interface().(defaultParser); ok {
  					if err := parser.ParseDefault(v); err != nil {
  						panic(err)
  					}
  					continue
  				}
  			}
  
  			switch f.Interface().(type) {
  			case string:
  				f.SetString(v)
  
  			case int:
  				i, err := strconv.ParseInt(v, 10, 64)
  				if err != nil {
  					panic(err)
  				}
  				f.SetInt(i)
  
  			case float64:
  				i, err := strconv.ParseFloat(v, 64)
  				if err != nil {
  					panic(err)
  				}
  				f.SetFloat(i)
  
  			case bool:
  				f.SetBool(v == "true")
  
  			case []string:
  				// We don't do anything with string slices here. Any default
  				// we set will be appended to by the XML decoder, so we fill
  				// those after decoding.
  
  			default:
  				panic(f.Type())
  			}
  		}
  	}
  }
docs: // SetDefaults sets default values on a struct, based on the default annotation.