サンプル
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0: errdetails.BadRequest_FieldViolation
検証済みサンプル — golang google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0: errdetails.BadRequest_FieldViolation. go 1.26 · linux…
sha256:13d3168b7bbe8b46ba9770b9821d4f390a1441ad898a3a179b005cb296b40821
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
go 1.26 linux 24 · ubuntu · glibc 2.39 x64 go 1.26 go go 1
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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-09-20 |
ケース
HOW- ゴール
- verify google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0
- シンボル
-
- google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation
- 環境
- go 1.26.6
- 作成日
- 2026-09-20T05:35:35Z
コントラクト
- BadRequest_FieldViolation struct instantiates with Field and Description fields
- GetField returns the configured field name
- GetDescription returns the violation description
- BadRequest message accepts a slice of BadRequest_FieldViolation pointers
ファイル
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
ソース
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/errdetails.BadRequest_FieldViolation in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0
Demonstrate these symbols/APIs:
- google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation
Required runtime conditions:
- ecosystem: golang
- language: go
- packageManager: go@1.26.6
- runtime: go@1.26.6
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:92a0125906015104df0ef8021f43b1ef655c4907e278a1ca9497f6fb23bb176d","contract":["BadRequest_FieldViolation struct instantiates with Field and Description fields","GetField returns the configured field name","GetDescription returns the violation description","BadRequest message accepts a slice of BadRequest_FieldViolation pointers"],"goal":"verify google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0","kind":"HOW","packages":["pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0"],"schemaVersion":1,"symbols":["google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation"]},"contractCommand":["go","run","./test"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"golang","language":"go","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","packageManagerVersion":"1.26.6","runtime":"go","runtimeVersion":"1.26.6","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0"],"schemaVersion":1,"subject":"pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0","symbols":["google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation"],"verifierAdapter":"golang@1"}
module sample
go 1.26.6
require google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0
require google.golang.org/protobuf v1.36.6 // indirect
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 h1:MAKi5q709QWfnkkpNQ0M12hYJ1+e8qYVDyowc4U1XZM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
package main
import (
"fmt"
"google.golang.org/genproto/googleapis/rpc/errdetails"
)
func main() {
fv := &errdetails.BadRequest_FieldViolation{
Field: "username",
Description: "username must not be empty",
}
br := &errdetails.BadRequest{
FieldViolations: []*errdetails.BadRequest_FieldViolation{fv},
}
fmt.Printf("BadRequest with violation: %s: %s\n", br.GetFieldViolations()[0].GetField(), br.GetFieldViolations()[0].GetDescription())
}
{
"schemaVersion": 1,
"goal": "verify google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0",
"kind": "HOW",
"packages": [
"pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20250728155136-f173205681a0"
],
"symbols": [
"google.golang.org/genproto/googleapis/rpc/errdetails.BadRequest_FieldViolation"
],
"runtimeConditions": {
"ecosystem": "golang",
"language": "go",
"packageManager": "go@1.26.6",
"runtime": "go@1.26.6"
}
}
package main
import (
"fmt"
"os"
"google.golang.org/genproto/googleapis/rpc/errdetails"
)
func main() {
fv := &errdetails.BadRequest_FieldViolation{
Field: "username",
Description: "username must not be empty",
}
if fv.GetField() != "username" {
fmt.Fprintf(os.Stderr, "assertion failed: expected field 'username', got '%s'\n", fv.GetField())
os.Exit(1)
}
if fv.GetDescription() != "username must not be empty" {
fmt.Fprintf(os.Stderr, "assertion failed: expected description 'username must not be empty', got '%s'\n", fv.GetDescription())
os.Exit(1)
}
br := &errdetails.BadRequest{
FieldViolations: []*errdetails.BadRequest_FieldViolation{fv},
}
if len(br.GetFieldViolations()) != 1 {
fmt.Fprintf(os.Stderr, "assertion failed: expected 1 violation, got %d\n", len(br.GetFieldViolations()))
os.Exit(1)
}
if br.GetFieldViolations()[0].GetField() != "username" {
fmt.Fprintf(os.Stderr, "assertion failed: expected violation field 'username', got '%s'\n", br.GetFieldViolations()[0].GetField())
os.Exit(1)
}
if br.GetFieldViolations()[0].GetDescription() != "username must not be empty" {
fmt.Fprintf(os.Stderr, "assertion failed: expected violation description 'username must not be empty', got '%s'\n", br.GetFieldViolations()[0].GetDescription())
os.Exit(1)
}
}
オリジンシーダー
匿名