Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

cmd/cue: mod init blah not allowed #645

Closed
myitcv opened this issue Jan 19, 2021 · 3 comments
Closed

cmd/cue: mod init blah not allowed #645

myitcv opened this issue Jan 19, 2021 · 3 comments

Comments

@myitcv
Copy link
Contributor

myitcv commented Jan 19, 2021

What version of CUE are you using (cue version)?

$ cue version
cue version +f0c025c1 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

cue mod init blah

What did you expect to see?

No error

What did you see instead?

invalid host name "blah"

In Go, first-elements in a module that do not include a dot are, in general, reserved for the standard library and the Go toolchain (see golang/go#37641 and golang/go#32819).

golang/go#37641 is about reserving certain names as "special" but in general go mod init blah is allowed. We should do the same for cue mod init

@mpvl
Copy link
Contributor

mpvl commented Jan 27, 2021

Not sure we should do this. It won't allow imports. However, we could allow "anonymous" modules, which I believe are already supported.

@myitcv
Copy link
Contributor Author

myitcv commented Jan 29, 2021

It won't allow imports

It won't allow imports of other packages int he main module, indeed. But these kinds of throwaway modules are only ever single-package things.

It's really only laziness that caused me to raise this issue, because typing .com is apparently too hard for me!

But I take your point - it introduces a potentially sharp edge for someone who is new to CUE, where really we don't need one. Keeping it strict is certainly not a problem.

@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#645.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

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

No branches or pull requests

3 participants