Skip to content

Commit 985855f

Browse files
committed
cue: remove support for legacy protobuf attributes
https://cue-review.googlesource.com/c/cue/+/9368 in April 2021 added a bit of code so that we could still support old attributes like @protobuf(4,type=double,name=double_value) alongside the new form @protobuf(4,double,name=double_value) It has been over three years now, and we are early in the v0.11 release cycle, so it is a good time to remove the compatibility code. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Iba2f1339a56138f642216bb802612fe8402f547b Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200324 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Matthew Sackman <[email protected]>
1 parent de41586 commit 985855f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

cue/attribute.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,5 @@ func (a *Attribute) Flag(pos int, key string) (bool, error) {
211211
// and reports the value if found. It reports an error if the attribute is
212212
// invalid or if the first pos-1 entries are not defined.
213213
func (a *Attribute) Lookup(pos int, key string) (val string, found bool, err error) {
214-
val, found, err = a.attr.Lookup(pos, key)
215-
216-
// TODO: remove at some point. This is an ugly hack to simulate the old
217-
// behavior of protobufs.
218-
if !found && a.attr.Name == "protobuf" && key == "type" {
219-
val, err = a.String(1)
220-
found = err == nil
221-
}
222-
return val, found, err
214+
return a.attr.Lookup(pos, key)
223215
}

0 commit comments

Comments
 (0)