code: func (d *Decoder) indirect(v reflect.Value) (reflect.Value, error) {
  	rv := v
  	for rv.Kind() == reflect.Ptr {
  		// Allocate pointer if needed.
  		isNil := rv.IsNil()
  		if isNil && !rv.CanSet() {
  			msg := fmt.Sprintf("unable to allocate pointer for '%v'",
  				rv.Type().String())
  			err := unmarshalError("indirect", ErrNotSettable, msg,
  				nil, nil)
  			return rv, err
  		}
  		if isNil {
  			rv.Set(reflect.New(rv.Type().Elem()))
  		}
  		rv = rv.Elem()
  	}
  	return rv, nil
  }
docs: // indirect dereferences pointers allocating them as needed until it reaches
  // a non-pointer.  This allows transparent decoding through arbitrary levels
  // of indirection.