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

lowercase package name #7

Closed
kolyshkin opened this issue Mar 24, 2020 · 4 comments
Closed

lowercase package name #7

kolyshkin opened this issue Mar 24, 2020 · 4 comments

Comments

@kolyshkin
Copy link

Apparently (golang/go#26456) golang doesn't like Uppercased letters in package names.

When I'm trying to use gopls in a repository (https://github.com/opencontainers/runc) that uses a package (github.com/russross/blackfriday/v2) that uses this package (i.e. github.com/shurcooL/ sanitized_anchor_name), I end up with the following error:

/home/kir/go/pkg/mod/github.com/russross/blackfriday/v2@v2.0.1/block.go:22:2: could not import github.com/shurcooL/sanitized_anchor_name (go/build: importGo github.com/shurcooL/sanitized_anchor_name: exit status 1

I look into go package cache, and here it is:

[kir@kir-rhat github.com]$ pwd
/home/kir/go/pkg/mod/github.com
[kir@kir-rhat github.com]$ ls -d s*
 seccomp  'shurcoo!l'   sirupsen   stretchr   syndtr

I realize my request might look idiotic, but can you please consider renaming your repo to be all lowercase, or move this package under some other path that would all be lowercase?

@kolyshkin
Copy link
Author

kolyshkin commented Mar 24, 2020

OK, I see that you ended up copying this code to blackfriday (russross/blackfriday@8cc535d) to resolve russross/blackfriday#350.

This was done in 2018 but no release since that time :( life is pain :-\

Closing this one

@dmitshur
Copy link
Member

dmitshur commented Mar 24, 2020

Hi @kolyshkin, thanks for reporting this issue.

There seem to be a few different things here.

Apparently (golang/go#26456) golang doesn't like Uppercased letters in package names.

This isn't true. Uppercase letters in import paths and package names are supported by Go. The tests for this package are passing, and it has been used by various other projects for years without issues. The issue you linked is very old and not related.

When I'm trying to use gopls in a repository (https://github.com/opencontainers/runc) that uses a package (github.com/russross/blackfriday/v2) that uses this package (i.e. github.com/shurcooL/ sanitized_anchor_name), I end up with the following error: [...]

If you're seeing that behavior with the latest version of gopls, then it's a bug that should be fixed. Could you please report it and provide information that is needed to reproduce it? See https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md for instructions to do that.

[...] This was done in 2018 but no release since that time

A new v2 release that includes that change should indeed be made. Can you file an issue about it in the blackfriday issue tracker?

@kolyshkin
Copy link
Author

A new v2 release that includes that change should indeed be made. Can you file an issue about it in the blackfriday issue tracker?

I sort of hinted about it in russross/blackfriday#586 yesterday.

@kolyshkin
Copy link
Author

Created: russross/blackfriday#587

To the readers of this: I found it's guru not gopls that can't work with packages from go mod cache having uppercase names. I guess guru is no longer maintained so I'm leaving it as is.

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

No branches or pull requests

2 participants