Skip to content
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

examples submodule #173

Closed
wants to merge 1 commit into from
Closed

Conversation

CrimsonVoid
Copy link

Make examples and examples_security submodules, removing the only external dependency. I wasn't sure about moving examples_security to examples/security, but I can update the PR if you think that would make more sense.

This PR depends on an unreleased version zmq4 1.3.0

Unfortunately it seems the best way to convert a subpackage into a module is to depend on a future version where that subpackage doesn't exist; the naïve solution leads to build failures. You can add replace github.com/pebbe/zmq4 v1.3.0 => ../ to go.mod if you want to test the changes.

See https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository

@pebbe
Copy link
Owner

pebbe commented Mar 24, 2021

Thank for this. I looked at what you did, and decided to do it a little differently.

The directory examples_security doesn't need its own go.mod because it doesn't have external dependencies. It can use the go.mod in the parent direcory.

For examples/go.mod I used a replace, so as to not depend on a particular release. This means you can't do a go get github.com/pebbe/zmq4/examples/... but you couldn't do that anyway, because there are sources for different programs in the same directory. To make this possible, I would need to move each program to its own subdirectory, but I don't think you would want to run go get or go install on all examples anyway, because you would end up with 81 programs in your general bin directory.

@CrimsonVoid
Copy link
Author

ty, I'll go ahead and close this.

Also, you might want to look into replacing github.com/pborman/uuid with github.com/google/uuid since it's just a thin wrapper around google's library. It's not a drop-in replacement, but the few errors I got when building examples had pretty simple fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants