-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isolate nlopt dependency further by moving inject.motion_service.go
to its own package
#4907
base: main
Are you sure you want to change the base?
Conversation
@@ -6,7 +6,7 @@ import ( | |||
"strconv" | |||
|
|||
"github.com/golang/geo/r3" | |||
protov1 "github.com/golang/protobuf/proto" //nolint:staticcheck | |||
protov1 "github.com/golang/protobuf/proto" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was added by the linter
@@ -462,13 +461,6 @@ func TestManagerAdd(t *testing.T) { | |||
test.That(t, err, test.ShouldBeNil) | |||
test.That(t, resource1, test.ShouldEqual, injectBoard) | |||
|
|||
injectMotionService := &inject.MotionService{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the test does not seem to add anything and means that anyone importing resource also needs to import nlopt by transitive dependencies (although the reason resource is importing this is unclear to me)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested with a module that uses injects and found that nlopt was no longer being imported! thanks for the quick change
actually quickish q, nlopt is no longer in the go.mod but it still appears in the go.sum for my modules. Would that still cause build issues? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Currently when someone tries to import anything in the
inject
package (for example if they are writing unit tests for their module) they are forced to import nlopt too. This PR creates a separate package for injected motion so that this only is required when someone goes to importinject/motion
rather than justinject
.This is the cleanest solution I thought of but looking for sign off from @cheukt since it is a departure from how we have structured RDK so far.