Beispiel
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b: module.EscapePath
Verifiziertes Beispiel für golang golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b: module.EscapePath. Der Vertrag lief auf go 1.26 · linux debian/x64 …
sha256:a660cf316532a372d9327fa8e675bf56c3a6597f93c6f06268edb91fcd2c96cb
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-18 |
Fall
HOW- Ziel
- verify golang.org/x/mod/module.EscapePath in pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b
- Symbole
-
- golang.org/x/mod/module.EscapePath
- Erstellt
- 2026-10-18T10:44:29Z
Contract
- module.EscapePath("example.com/MyPkg/SubDir") escapes uppercase letters with '!' prefix and returns "example.com/!my!pkg/!sub!dir" with nil error
- module.EscapePath("example.com/lowercase/mod") preserves valid all-lowercase module paths unchanged
- module.EscapePath("invalid_no_dot/pkg") rejects invalid module paths lacking a dot in the leading path element with a non-nil error
Dateien
- PROMPT.md
- csx.json
- go.mod
- go.sum
- 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 golang.org/x/mod/module.EscapePath in pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b
Demonstrate these symbols/APIs:
- golang.org/x/mod/module.EscapePath
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:ed9de132678b4905a094237b586613a7d5fe0c70f47f69acca717d5a34f39158","contract":["module.EscapePath(\"example.com/MyPkg/SubDir\") escapes uppercase letters with '!' prefix and returns \"example.com/!my!pkg/!sub!dir\" with nil error","module.EscapePath(\"example.com/lowercase/mod\") preserves valid all-lowercase module paths unchanged","module.EscapePath(\"invalid_no_dot/pkg\") rejects invalid module paths lacking a dot in the leading path element with a non-nil error"],"goal":"verify golang.org/x/mod/module.EscapePath in pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b","kind":"HOW","packages":["pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b"],"schemaVersion":1,"symbols":["golang.org/x/mod/module.EscapePath"]},"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/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b","symbols":["golang.org/x/mod/module.EscapePath"],"verifierAdapter":"golang@1"}
module example.com/sample
go 1.21
require golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b
require golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b h1:GgiSbuUyC0BlbUmHQBgFqu32eiRR/CEYdjOjOd4zE6Y=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
{
"schemaVersion": 1,
"goal": "verify golang.org/x/mod/module.EscapePath in pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/mod@v0.1.1-0.20191107180719-034126e5016b"
],
"symbols": [
"golang.org/x/mod/module.EscapePath"
]
}
package main
import (
"fmt"
"os"
"golang.org/x/mod/module"
)
func main() {
escaped, err := module.EscapePath("example.com/MyPkg/SubDir")
if err != nil {
fmt.Fprintf(os.Stderr, "unexpected error for mixed-case path: %v\n", err)
os.Exit(1)
}
if escaped != "example.com/!my!pkg/!sub!dir" {
fmt.Fprintf(os.Stderr, "expected example.com/!my!pkg/!sub!dir, got %q\n", escaped)
os.Exit(1)
}
lower, err := module.EscapePath("example.com/lowercase/mod")
if err != nil {
fmt.Fprintf(os.Stderr, "unexpected error for lowercase path: %v\n", err)
os.Exit(1)
}
if lower != "example.com/lowercase/mod" {
fmt.Fprintf(os.Stderr, "expected example.com/lowercase/mod, got %q\n", lower)
os.Exit(1)
}
if _, err := module.EscapePath("invalid_no_dot/pkg"); err == nil {
fmt.Fprintln(os.Stderr, "expected error for invalid module path without dot in first element, got nil")
os.Exit(1)
}
}
Ursprungs-Seeder
anonym