Skip to content

Commit

Permalink
cmd/cue: use parser.PackageClauseOnly in 'get go'
Browse files Browse the repository at this point in the history
When importing CUE files, we parse each file to obtain its package name.
We only need to parse up to the package clause for this to work.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I21247bf16fed1cc3985bd1ef3f98a5be62ceb425
Dispatch-Trailer: {"type":"trybot","CL":1200969,"patchset":3,"ref":"refs/changes/69/1200969/3","targetBranch":"master"}
  • Loading branch information
mvdan authored and cueckoo committed Sep 10, 2024
1 parent 74a06f8 commit 2a9d942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/cue/cmd/get_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ func (e *extractor) importCUEFiles(p *packages.Package, dstDir, args string) err
if !ok {
return nil
}
f, err := parser.ParseFile(path, nil)
f, err := parser.ParseFile(path, nil, parser.PackageClauseOnly)
if err != nil {
return err
}
Expand Down

0 comments on commit 2a9d942

Please sign in to comment.