code: func (r *Result) convertTo020() (*types020.Result, error) {
  	oldResult := &types020.Result{
  		CNIVersion: types020.ImplementedSpecVersion,
  		DNS:        r.DNS,
  	}
  
  	for _, ip := range r.IPs {
  		// Only convert the first IP address of each version as 0.2.0
  		// and earlier cannot handle multiple IP addresses
  		if ip.Version == "4" && oldResult.IP4 == nil {
  			oldResult.IP4 = &types020.IPConfig{
  				IP:      ip.Address,
  				Gateway: ip.Gateway,
  			}
  		} else if ip.Version == "6" && oldResult.IP6 == nil {
  			oldResult.IP6 = &types020.IPConfig{
  				IP:      ip.Address,
  				Gateway: ip.Gateway,
  			}
  		}
  
  		if oldResult.IP4 != nil && oldResult.IP6 != nil {
  			break
  		}
  	}
  
  	for _, route := range r.Routes {
  		is4 := route.Dst.IP.To4() != nil
  		if is4 && oldResult.IP4 != nil {
  			oldResult.IP4.Routes = append(oldResult.IP4.Routes, types.Route{
  				Dst: route.Dst,
  				GW:  route.GW,
  			})
  		} else if !is4 && oldResult.IP6 != nil {
  			oldResult.IP6.Routes = append(oldResult.IP6.Routes, types.Route{
  				Dst: route.Dst,
  				GW:  route.GW,
  			})
  		}
  	}
  
  	if oldResult.IP4 == nil && oldResult.IP6 == nil {
  		return nil, fmt.Errorf("cannot convert: no valid IP addresses")
  	}
  
  	return oldResult, nil
  }
docs: // Convert to the older 0.2.0 CNI spec Result type