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

Commit

Permalink
encoding/protobuf: enforce loading builting packages
Browse files Browse the repository at this point in the history
For now it loads all. This avoids renumbering (confusing
while debugging) and potential other misses.

Fixes #635

Change-Id: I8dd67f023a2c3667e9af4f530cd51c6f28206f2b
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8232
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Jan 18, 2021
1 parent f03928d commit f0c025c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions encoding/protobuf/protobuf.go
Expand Up @@ -100,6 +100,15 @@ import (
"cuelang.org/go/cue/parser"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal"

// Generated protobuf CUE may use builtins. Ensure that these can always be
// found, even if the user does not use cue/load or another package that
// triggers its loading.
//
// TODO: consider whether just linking in the necessary packages suffices.
// It probably does, but this may reorder some of the imports, which may,
// in turn, change the numbering, which can be confusing while debugging.
_ "cuelang.org/go/pkg"
)

// Config specifies the environment into which to parse a proto definition file.
Expand Down

0 comments on commit f0c025c

Please sign in to comment.