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

cmd/cue: get go: improve help text #117

Closed
cueckoo opened this issue Jul 3, 2021 · 2 comments
Closed

cmd/cue: get go: improve help text #117

cueckoo opened this issue Jul 3, 2021 · 2 comments
Labels
Documentation get go issues related to cue get go

Comments

@cueckoo
Copy link
Collaborator

cueckoo commented Jul 3, 2021

Originally opened by @rogpeppe in cuelang/cue#117

Currently the cue get help says:

The command "cue get go" is like "go get", but converts the retrieved Go packages to CUE.

The documentation leaves it ambiguous whether you can import whole Go modules this way, and whether any kind of pattern syntax is accepted (for example ... as a pattern qualifier). By experiment, it seems that the answer to both those questions is "no", but it would be good to be clear, as the higher level cue get help talks about downloading modules.

Also, the cue get help also implies that CUE modules or packages can be downloaded, but the get command doesn't seem to allow a cue subcommand, so it's not clear how that would work.

@cueckoo cueckoo added Documentation get go issues related to cue get go labels Jul 3, 2021
@cueckoo cueckoo closed this as completed Jul 3, 2021
@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @mpvl in cuelang/cue#117 (comment)

getting cue native modules or packages is not yet implemented.

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @myitcv in cuelang/cue#117 (comment)

By experiment, it seems that the answer to both those questions is "no"

I think the answer is actually "yes", at least based on my experiment using f0c025c:

exec cue get go go.com/...
exec cue def go.com/b

-- cue.mod/module.cue --
module: "cue.com"
-- go.mod --
module go.com
-- a/a.go --
package a

const Name = "a"
-- b/b.go --
package b

const Name = "b"

Gives:

> exec cue get go go.com/...
> exec cue def go.com/b
[stdout]
package b

#Name: "b"

Per cuelang/cue#621 (comment) and cuelang/cue#646 the current plan is to deprecate cue get go in favour of cue import go, partly because the separation of concerns is cleaner.

So I'm tempted to close this issue and improve the docs as part of cuelang/cue#646. But please shout if you disagree, @rogpeppe or @mpvl

The question of CUE module support is covered by cuelang/cue#337 (and issues that will be created from it)

ptMcGit pushed a commit to ptMcGit/cue that referenced this issue Jan 22, 2023
small typo
particarlar -> particular
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation get go issues related to cue get go
Projects
None yet
Development

No branches or pull requests

1 participant