Skip to content

Inconsistent codelab example #1171

@maksymvavilov

Description

@maksymvavilov

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions