diff --git a/README.md b/README.md index 390fc4f..c05db5a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://godoc.org/github.com/enbility/spine-go) [![Coverage Status](https://coveralls.io/repos/github/enbility/spine-go/badge.svg?branch=dev)](https://coveralls.io/github/enbility/eebus-go?branch=dev) [![Go report](https://goreportcard.com/badge/github.com/enbility/spine-go)](https://goreportcard.com/report/github.com/enbility/spine-go) +[![CodeFactor](https://www.codefactor.io/repository/github/enbility/spine-go/badge)](https://www.codefactor.io/repository/github/enbility/spine-go) ## Introduction diff --git a/model/electricalconnection_additions_test.go b/model/electricalconnection_additions_test.go index 343922b..667dc94 100644 --- a/model/electricalconnection_additions_test.go +++ b/model/electricalconnection_additions_test.go @@ -431,7 +431,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Modify( return } - delete := &FilterType{ + deleteFilter := &FilterType{ CmdControl: &CmdControlType{ Delete: &ElementTagType{}, }, @@ -442,7 +442,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Modify( } // Act - sut.UpdateList(&newData, NewFilterTypePartial(), delete) + sut.UpdateList(&newData, NewFilterTypePartial(), deleteFilter) data := sut.ElectricalConnectionPermittedValueSetData // check the deleted item is gone @@ -527,7 +527,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete(t *test return } - delete := &FilterType{ + deleteFilter := &FilterType{ CmdControl: &CmdControlType{ Delete: &ElementTagType{}, }, @@ -538,7 +538,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete(t *test } // Act - sut.UpdateList(nil, nil, delete) + sut.UpdateList(nil, nil, deleteFilter) data := sut.ElectricalConnectionPermittedValueSetData // check the deleted item is added again @@ -623,7 +623,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Element return } - delete := &FilterType{ + deleteFilter := &FilterType{ CmdControl: &CmdControlType{ Delete: &ElementTagType{}, }, @@ -637,7 +637,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Element } // Act - sut.UpdateList(nil, nil, delete) + sut.UpdateList(nil, nil, deleteFilter) data := sut.ElectricalConnectionPermittedValueSetData // check no items are deleted @@ -729,7 +729,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_OnlyEle return } - delete := &FilterType{ + deleteFilter := &FilterType{ CmdControl: &CmdControlType{ Delete: &ElementTagType{}, }, @@ -739,7 +739,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_OnlyEle } // Act - sut.UpdateList(nil, nil, delete) + sut.UpdateList(nil, nil, deleteFilter) data := sut.ElectricalConnectionPermittedValueSetData // check no items are deleted @@ -902,7 +902,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Add(t * return } - delete := &FilterType{ + deleteFilter := &FilterType{ CmdControl: &CmdControlType{ Delete: &ElementTagType{}, }, @@ -913,7 +913,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Add(t * } // Act - sut.UpdateList(&newData, NewFilterTypePartial(), delete) + sut.UpdateList(&newData, NewFilterTypePartial(), deleteFilter) data := sut.ElectricalConnectionPermittedValueSetData // check the deleted item is added again diff --git a/spine/device_local.go b/spine/device_local.go index 9854bc7..581381a 100644 --- a/spine/device_local.go +++ b/spine/device_local.go @@ -128,6 +128,8 @@ func (r *DeviceLocalImpl) HandleEvent(payload api.EventPayload) { return } + // the codefactor warning is invalid, as .(type) check can not be replaced with if then + //revive:disable-next-line switch payload.Data.(type) { case *model.NodeManagementDetailedDiscoveryDataType: _, _ = r.nodeManagement.Subscribe(payload.Feature.Address())