Skip to content

Inconsistent codelab example #1171

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

Open
maksymvavilov opened this issue Apr 24, 2025 · 0 comments
Open

Inconsistent codelab example #1171

maksymvavilov opened this issue Apr 24, 2025 · 0 comments

Comments

@maksymvavilov
Copy link

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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant