Theo pushed to branch main at Root / CLI / Netboxadm

Commits:

1 changed file:

Changes:

  • internal/models/interface.go
    ... ... @@ -103,13 +103,15 @@ func (i *Interface) UnmarshalJSON(data []byte) error {
    103 103
     		i.DeviceType = ObjectTypeVM
    
    104 104
     	}
    
    105 105
     
    
    106
    -	var alias Interface
    
    106
    +	type interfaceAlias Interface
    
    107
    +
    
    108
    +	var alias interfaceAlias
    
    107 109
     
    
    108 110
     	if err := json.Unmarshal(data, &alias); err != nil {
    
    109 111
     		return fmt.Errorf("error unmarshalling interface fields: %w", err)
    
    110 112
     	}
    
    111 113
     
    
    112
    -	*i = alias
    
    114
    +	*i = Interface(alias)
    
    113 115
     
    
    114 116
     	// need to restore
    
    115 117
     	if parentProbe.Device != nil {