CodeSampleX

Exemplo

github.com/gin-gonic/gin v1.12.0: Enable ContextWithFallback on gin.Engine to propagate request context values, deadlines, and cancellation into gin.Context

Amostra verificada para golang github.com/gin-gonic/gin v1.12.0: Enable ContextWithFallback on gin.Engine to propagate request context values, deadlines, and…

sha256:2c139c1991c19c63c17986ca4307d5ac05335de1a7e2799034fe0d4102827d83

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
2
Chaves de assinatura que o compilaram
2
Ambiente declarado go 1.26 linux x64 go 1.26 go go

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-17
go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-18

Caso

HOW
Objetivo
Enable ContextWithFallback on gin.Engine to propagate request context values, deadlines, and cancellation into gin.Context
Pacotes
Símbolos
  • Engine.ContextWithFallback
  • gin.New
  • Engine.ServeHTTP
  • Context.Value
  • Context.Done
  • Context.Deadline
  • Context.Err
  • Context.Get
  • Context.GetString
  • Context.Set
Ambiente
go 1.26
Criado
2026-08-17T11:45:39Z

Contrato

  1. By default gin.Engine has ContextWithFallback disabled, causing gin.Context to return nil for all http.Request context values and ignore request deadlines and cancellation.
  2. assert setting ContextWithFallback to true enables gin.Context.Value to resolve values from http.Request.Context while preserving Gin local key overrides
  3. assert setting ContextWithFallback to true enables gin.Context to propagate cancellation and deadlines from http.Request.Context via Done, Deadline, and Err
  4. assert Context.Get and Context.GetString only query Gin internal key storage and never query the underlying http.Request.Context even when ContextWithFallback is enabled
  5. assert all router requests execute through httptest and Engine.ServeHTTP in memory without binding network listeners

Arquivos

  • NOTES.md
  • csx.json
  • fallback.go
  • fallback_test.go
  • go.mod
  • go.sum

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed