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

add major version to module path, sync module name with repo's #113

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

consolethinks
Copy link
Collaborator

Description

According to official Go guidelines, we need to add the major version to the module path in order for people to be able to include the package as a dependency. They also recommend to create separate branches for major releases, but that's optional.

@consolethinks
Copy link
Collaborator Author

consolethinks commented Sep 13, 2024

As an additional note, here's what happens if I try to include v3.0,0 in a different module without the module name change:
image
image

Copy link
Member

@sbliven sbliven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to follow the golang best practices.

Looking at managing source it looks like the directory structure should match the full module name. So should it be moved to eg github.com/paulscherrerinstitute/scicat-cli/cmd?

@consolethinks consolethinks merged commit d54504e into main Sep 16, 2024
3 checks passed
@consolethinks consolethinks deleted the major_version_module_path branch September 16, 2024 09:07
@consolethinks
Copy link
Collaborator Author

consolethinks commented Sep 16, 2024

It's good to follow the golang best practices.

Looking at managing source it looks like the directory structure should match the full module name. So should it be moved to eg github.com/paulscherrerinstitute/scicat-cli/cmd?

@sbliven
The module encompasses the cmd, datasetUtils, datasetIngestor packages, so no change is needed because of that. However, since the module name is now scicat-cli/v3, we could move all packages into a v3 subfolder if you think that works better.

Personally, I prefer the solution of creating a new v3 branch, and then we could revert main to a pre-v3 state. However, main will still be technically non conformant as its module name does not include /v2 at the end, nor does it have its files in a v2 subfolder, nor does it use a v2 branch.

References on best go language practices regarding major version bumps:
https://stackoverflow.com/questions/70058951/project-structure-with-v2-go-modules
https://go.dev/wiki/Modules#releasing-modules-v2-or-higher

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