Skip to content

feat: add check to ensure proper Go module path#12

Merged
ldez merged 4 commits intoldez:mainfrom
jqdurham:CheckModulePath
Dec 4, 2025
Merged

feat: add check to ensure proper Go module path#12
ldez merged 4 commits intoldez:mainfrom
jqdurham:CheckModulePath

Conversation

@jqdurham
Copy link
Copy Markdown
Contributor

@jqdurham jqdurham commented Dec 3, 2025

I'm part of an organization where they rushed into building Go applications without noticing that Go module paths are often URLs (sans protocol).

https://go.dev/doc/modules/gomod-ref

The current module’s module path. This should be a location from which the module can be downloaded by Go tools, such as the module code’s repository location.

https://go.dev/ref/mod#module-path

A module path should describe both what the module does and where to find it. Typically, a module path consists of a repository root path, a directory within the repository (usually empty), and a major version suffix (only for major version 2 or higher).

This check makes use of https://pkg.go.dev/golang.org/x/mod/module#CheckPath.

Comment thread cmd/gomoddirectives/gomoddirectives.go
@ldez ldez self-requested a review December 3, 2025 20:45
@ldez
Copy link
Copy Markdown
Owner

ldez commented Dec 3, 2025

Note: your PP doesn't appear inside the commit tree because the email you have used to commit is not defined inside your GitHub account.
To add it, go to https://github.com/settings/emails

@ldez ldez added the enhancement New feature or request label Dec 3, 2025
@jqdurham
Copy link
Copy Markdown
Contributor Author

jqdurham commented Dec 3, 2025

The email has been added to my profile.

@ldez
Copy link
Copy Markdown
Owner

ldez commented Dec 3, 2025

@jqdurham I saw you are working for a big company, and this feature seems related to it.

In this context, I was wondering if you could kindly inquire with your company about the possibility of supporting golangci-lint?

If you don't feel comfortable with this request, I fully understand, and you can ignore my request.

Copy link
Copy Markdown
Owner

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

@ldez ldez changed the title Add check to ensure proper Go module path feat: add check to ensure proper Go module path Dec 4, 2025
@ldez ldez merged commit 79a648a into ldez:main Dec 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants