Beispiel
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409: code.Code_OUT_OF_RANGE
Verifiziertes Beispiel für golang google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409: code.Code_OUT_OF_RANGE. Der Vertrag lief auf…
sha256:99c1e84c993268e100d4275504ec1a0d7c49b9fc01f2af58f10513ab8832ddd4
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
linux 24 · ubuntu · glibc 2.39 x64 go
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-10-12 |
Fall
HOW- Ziel
- verify google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409
- Symbole
-
- google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE
- Erstellt
- 2026-10-12T07:20:52Z
Contract
- code.Code_OUT_OF_RANGE equals 11
- code.Code_OUT_OF_RANGE is a code.Code enum value
- code.Code_OUT_OF_RANGE String() returns "OUT_OF_RANGE"
- code.Code_name maps 11 to "OUT_OF_RANGE"
- code.Code_value maps "OUT_OF_RANGE" to 11
- IsOutOfRange returns true for Code_OUT_OF_RANGE and false for Code_OK
- GetOutOfRangeCode returns Code_OUT_OF_RANGE
Dateien
- PROMPT.md
- csx.json
- go.mod
- go.sum
- out_of_range.go
- spec.json
- test/contract.go
Quelltext
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409
Demonstrate these symbols/APIs:
- google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:d7f796ae4e1d4dda6918a3fe4f008df0dc80d57252b7ea16a600d32b4f578e1a","contract":["code.Code_OUT_OF_RANGE equals 11","code.Code_OUT_OF_RANGE is a code.Code enum value","code.Code_OUT_OF_RANGE String() returns \"OUT_OF_RANGE\"","code.Code_name maps 11 to \"OUT_OF_RANGE\"","code.Code_value maps \"OUT_OF_RANGE\" to 11","IsOutOfRange returns true for Code_OUT_OF_RANGE and false for Code_OK","GetOutOfRangeCode returns Code_OUT_OF_RANGE"],"goal":"verify google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409","kind":"HOW","packages":["pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409"],"schemaVersion":1,"symbols":["google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE"]},"contractCommand":["go","run","./test"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"golang","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409"],"schemaVersion":1,"subject":"pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409","symbols":["google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE"],"verifierAdapter":"golang@1"}
module sample
go 1.26.6
require google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409
require google.golang.org/protobuf v1.36.11 // indirect
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
package sample
import (
"google.golang.org/genproto/googleapis/rpc/code"
)
// IsOutOfRange returns true if the given code is Code_OUT_OF_RANGE.
func IsOutOfRange(c code.Code) bool {
return c == code.Code_OUT_OF_RANGE
}
// GetOutOfRangeCode returns the Code_OUT_OF_RANGE enum value.
func GetOutOfRangeCode() code.Code {
return code.Code_OUT_OF_RANGE
}
// GetOutOfRangeName returns the string representation of Code_OUT_OF_RANGE.
func GetOutOfRangeName() string {
return code.Code_OUT_OF_RANGE.String()
}
// GetOutOfRangeNumber returns the integer value of Code_OUT_OF_RANGE.
func GetOutOfRangeNumber() int32 {
return int32(code.Code_OUT_OF_RANGE)
}
{
"schemaVersion": 1,
"goal": "verify google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409",
"kind": "HOW",
"packages": [
"pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260128011058-8636f8732409"
],
"symbols": [
"google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE"
]
}
package main
import (
"fmt"
"os"
"google.golang.org/genproto/googleapis/rpc/code"
"sample"
)
func main() {
// Assertion 1: code.Code_OUT_OF_RANGE equals 11
if code.Code_OUT_OF_RANGE != 11 {
fmt.Fprintf(os.Stderr, "expected code.Code_OUT_OF_RANGE to equal 11, got %d\n", int32(code.Code_OUT_OF_RANGE))
os.Exit(1)
}
// Assertion 2: code.Code_OUT_OF_RANGE is a code.Code enum value
var c code.Code = code.Code_OUT_OF_RANGE
if c != code.Code_OUT_OF_RANGE {
fmt.Fprintf(os.Stderr, "type mismatch for code.Code\n")
os.Exit(1)
}
// Assertion 3: code.Code_OUT_OF_RANGE String() returns "OUT_OF_RANGE"
if code.Code_OUT_OF_RANGE.String() != "OUT_OF_RANGE" {
fmt.Fprintf(os.Stderr, "expected String() to return \"OUT_OF_RANGE\", got %q\n", code.Code_OUT_OF_RANGE.String())
os.Exit(1)
}
// Assertion 4: code.Code_name maps 11 to "OUT_OF_RANGE"
if name, ok := code.Code_name[int32(code.Code_OUT_OF_RANGE)]; !ok || name != "OUT_OF_RANGE" {
fmt.Fprintf(os.Stderr, "expected Code_name[11] to be \"OUT_OF_RANGE\", got %q\n", name)
os.Exit(1)
}
// Assertion 5: code.Code_value maps "OUT_OF_RANGE" to 11
if val, ok := code.Code_value["OUT_OF_RANGE"]; !ok || val != int32(code.Code_OUT_OF_RANGE) {
fmt.Fprintf(os.Stderr, "expected Code_value[\"OUT_OF_RANGE\"] to be 11, got %d\n", val)
os.Exit(1)
}
// Assertion 6: IsOutOfRange returns true for Code_OUT_OF_RANGE and false for Code_OK
if !sample.IsOutOfRange(code.Code_OUT_OF_RANGE) {
fmt.Fprintf(os.Stderr, "expected IsOutOfRange(Code_OUT_OF_RANGE) to be true\n")
os.Exit(1)
}
if sample.IsOutOfRange(code.Code_OK) {
fmt.Fprintf(os.Stderr, "expected IsOutOfRange(Code_OK) to be false\n")
os.Exit(1)
}
// Assertion 7: GetOutOfRangeCode returns Code_OUT_OF_RANGE
if sample.GetOutOfRangeCode() != code.Code_OUT_OF_RANGE {
fmt.Fprintf(os.Stderr, "expected GetOutOfRangeCode() to return Code_OUT_OF_RANGE\n")
os.Exit(1)
}
fmt.Println("All google.golang.org/genproto/googleapis/rpc/code.Code_OUT_OF_RANGE contract assertions passed.")
}
Ursprungs-Seeder
anonym