mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	hack/update-vendor.sh
This commit is contained in:
		
							
								
								
									
										47
									
								
								vendor/github.com/go-openapi/swag/yaml.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								vendor/github.com/go-openapi/swag/yaml.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -143,19 +143,43 @@ func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func transformData(input interface{}) (out interface{}, err error) {
 | 
			
		||||
	format := func(t interface{}) (string, error) {
 | 
			
		||||
		switch k := t.(type) {
 | 
			
		||||
		case string:
 | 
			
		||||
			return k, nil
 | 
			
		||||
		case uint:
 | 
			
		||||
			return strconv.FormatUint(uint64(k), 10), nil
 | 
			
		||||
		case uint8:
 | 
			
		||||
			return strconv.FormatUint(uint64(k), 10), nil
 | 
			
		||||
		case uint16:
 | 
			
		||||
			return strconv.FormatUint(uint64(k), 10), nil
 | 
			
		||||
		case uint32:
 | 
			
		||||
			return strconv.FormatUint(uint64(k), 10), nil
 | 
			
		||||
		case uint64:
 | 
			
		||||
			return strconv.FormatUint(k, 10), nil
 | 
			
		||||
		case int:
 | 
			
		||||
			return strconv.Itoa(k), nil
 | 
			
		||||
		case int8:
 | 
			
		||||
			return strconv.FormatInt(int64(k), 10), nil
 | 
			
		||||
		case int16:
 | 
			
		||||
			return strconv.FormatInt(int64(k), 10), nil
 | 
			
		||||
		case int32:
 | 
			
		||||
			return strconv.FormatInt(int64(k), 10), nil
 | 
			
		||||
		case int64:
 | 
			
		||||
			return strconv.FormatInt(k, 10), nil
 | 
			
		||||
		default:
 | 
			
		||||
			return "", fmt.Errorf("unexpected map key type, got: %T", k)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch in := input.(type) {
 | 
			
		||||
	case yaml.MapSlice:
 | 
			
		||||
 | 
			
		||||
		o := make(JSONMapSlice, len(in))
 | 
			
		||||
		for i, mi := range in {
 | 
			
		||||
			var nmi JSONMapItem
 | 
			
		||||
			switch k := mi.Key.(type) {
 | 
			
		||||
			case string:
 | 
			
		||||
				nmi.Key = k
 | 
			
		||||
			case int:
 | 
			
		||||
				nmi.Key = strconv.Itoa(k)
 | 
			
		||||
			default:
 | 
			
		||||
				return nil, fmt.Errorf("types don't match expect map key string or int got: %T", mi.Key)
 | 
			
		||||
			if nmi.Key, err = format(mi.Key); err != nil {
 | 
			
		||||
				return nil, err
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			v, ert := transformData(mi.Value)
 | 
			
		||||
@@ -170,13 +194,8 @@ func transformData(input interface{}) (out interface{}, err error) {
 | 
			
		||||
		o := make(JSONMapSlice, 0, len(in))
 | 
			
		||||
		for ke, va := range in {
 | 
			
		||||
			var nmi JSONMapItem
 | 
			
		||||
			switch k := ke.(type) {
 | 
			
		||||
			case string:
 | 
			
		||||
				nmi.Key = k
 | 
			
		||||
			case int:
 | 
			
		||||
				nmi.Key = strconv.Itoa(k)
 | 
			
		||||
			default:
 | 
			
		||||
				return nil, fmt.Errorf("types don't match expect map key string or int got: %T", ke)
 | 
			
		||||
			if nmi.Key, err = format(ke); err != nil {
 | 
			
		||||
				return nil, err
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			v, ert := transformData(va)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user