Skip to content

Commit

Permalink
fix: fix string representation of the device
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ko committed Apr 24, 2024
1 parent 7a9527c commit a40110a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/netbox/objects/dcim.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ type Device struct {
}

func (d Device) String() string {
return fmt.Sprintf("Device{Name: %s, %s, %s, %s}", d.Name, d.DeviceType, d.DeviceRole, d.Site)
return fmt.Sprintf("Device{Name: %s, Type: %s, Role: %s, Site: %s}", d.Name, d.DeviceType, d.DeviceRole, d.Site)
}

type InterfaceType struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/netbox/objects/dcim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestDevice_String(t *testing.T) {
Name: "Test site",
},
},
want: fmt.Sprintf("Device{Name: %s, %s, %s, %s}", "Test device", "DeviceType{Manufacturer: Test manufacturer, Model: test model}", "DeviceRole{Name: Test device-role}", "Site{Name: Test site}"),
want: fmt.Sprintf("Device{Name: %s, Type: %s, Role: %s, Site: %s}", "Test device", "DeviceType{Manufacturer: Test manufacturer, Model: test model}", "DeviceRole{Name: Test device-role}", "Site{Name: Test site}"),
},
}
for _, tt := range tests {
Expand Down

0 comments on commit a40110a

Please sign in to comment.