CodeSampleX

Ejemplo

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

Muestra 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 red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
2
Entorno declarado go 1.26 linux x64 go 1.26 go go

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
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
Paquetes
Símbolos
  • Engine.ContextWithFallback
  • gin.New
  • Engine.ServeHTTP
  • Context.Value
  • Context.Done
  • Context.Deadline
  • Context.Err
  • Context.Get
  • Context.GetString
  • Context.Set
Entorno
go 1.26
Creado
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

Archivos

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

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed