rosgo
rosgo copied to clipboard
Fix invalid type assertion
Hi akio-san,
I find panic on the SearchParam type assertion.
package example_test
import (
"testing"
"ros"
)
func TestSearchParam(t *testing.T) {
node := ros.NewNode("/example_node")
_, err := node.SearchParam("not_found")
if err == nil {
t.Errorf("want err, got nil")
}
}
got panic:
go test
--- FAIL: TestSearchParam (0.00s)
panic: interface conversion: interface {} is nil, not string [recovered]
panic: interface conversion: interface {} is nil, not string