cel-go icon indicating copy to clipboard operation
cel-go copied to clipboard

Inconsistent codelab example

Open maksymvavilov opened this issue 10 months ago • 0 comments

What

In the codelab https://codelabs.developers.google.com/codelabs/cel-go#9 the code snippet as follows:

  env, _ := cel.NewEnv(
    // Add cel.Container() option for 'google.rpc.context.AttributeContext'
    cel.Container("google.rpc.context.AttributeContext.Request"),
    cel.Types(requestType),
    // Later, add cel.Variable() options for 'jwt' as a map(string, Dyn) type
    // and for 'now' as a timestamp.
    // cel.Variable("now", cel.TimestampType),
    // cel.Variable("jwt", cel.MapType(cel.StringType, cel.DynType)),
  )

In this repository, the code example differs https://github.com/google/cel-go/blob/master/codelab/solution/codelab.go#L247

How

  1. Change the code example to match codelab and change comment into AttributeContext.Request OR
  2. Change code in the codelab to cel.Container("google.rpc.context.AttributeContext")

maksymvavilov avatar Apr 24 '25 12:04 maksymvavilov