Beispiel
github.com/mattn/go-isatty v0.0.17
Verifiziertes Beispiel für golang github.com/mattn/go-isatty v0.0.17. Der Vertrag lief auf go 1.26 · linux alpine/x64 · docker und bestand.
sha256:7c295929bdcf2e630fd157ce2047cb0fa8621073302e217e7b57139e3ee67a34
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
go 1.26 linux 24 · ubuntu · glibc 2.39 x64 go 1.26 go go 1
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-20 |
Fall
HOW- Ziel
- verify pkg:golang/github.com/mattn/go-isatty@v0.0.17
- Umgebung
- go 1.26.6
- Erstellt
- 2026-08-19T23:38:15Z
Contract
- isatty.IsTerminal returns false for regular file descriptors
- isatty.IsTerminal returns false for invalid file descriptors
- isatty.IsCygwinTerminal returns false for regular file descriptors
- isatty.IsCygwinTerminal returns false for invalid file descriptors
Dateien
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.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 pkg:golang/github.com/mattn/go-isatty@v0.0.17
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/mattn/go-isatty@v0.0.17
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:93d6e78e85efd3b47d77510d3bb1a14079c65b6a32afbb6d35ec908eceaf5f44","contract":["isatty.IsTerminal returns false for regular file descriptors","isatty.IsTerminal returns false for invalid file descriptors","isatty.IsCygwinTerminal returns false for regular file descriptors","isatty.IsCygwinTerminal returns false for invalid file descriptors"],"goal":"verify pkg:golang/github.com/mattn/go-isatty@v0.0.17","kind":"HOW","packages":["pkg:golang/github.com/mattn/go-isatty@v0.0.17"],"schemaVersion":1},"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/github.com/mattn/go-isatty@v0.0.17"],"schemaVersion":1,"verifierAdapter":"golang@1"}
module example.com/isattysample
go 1.26.6
require github.com/mattn/go-isatty v0.0.17
require golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
package main
import (
"fmt"
"os"
"github.com/mattn/go-isatty"
)
// CheckTerminal demonstrates checking whether standard streams are terminal devices.
func CheckTerminal(fd uintptr) (isTerminal bool, isCygwin bool) {
return isatty.IsTerminal(fd), isatty.IsCygwinTerminal(fd)
}
func main() {
term, cygwin := CheckTerminal(os.Stdout.Fd())
fmt.Printf("Stdout - isTerminal: %t, isCygwin: %t\n", term, cygwin)
}
{
"schemaVersion": 1,
"goal": "verify pkg:golang/github.com/mattn/go-isatty@v0.0.17",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/mattn/go-isatty@v0.0.17"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
package main
import (
"fmt"
"os"
"github.com/mattn/go-isatty"
)
func main() {
// Assertion 1: isatty.IsTerminal returns false for regular file descriptors
tmpFile, err := os.CreateTemp("", "isatty_contract_*.tmp")
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: failed to create temporary file: %v\n", err)
os.Exit(1)
}
defer os.Remove(tmpFile.Name())
defer tmpFile.Close()
if isatty.IsTerminal(tmpFile.Fd()) {
fmt.Fprintf(os.Stderr, "FAIL: isatty.IsTerminal returned true for regular file descriptor\n")
os.Exit(1)
}
// Assertion 2: isatty.IsTerminal returns false for invalid file descriptors
invalidFd := ^uintptr(0)
if isatty.IsTerminal(invalidFd) {
fmt.Fprintf(os.Stderr, "FAIL: isatty.IsTerminal returned true for invalid file descriptor\n")
os.Exit(1)
}
// Assertion 3: isatty.IsCygwinTerminal returns false for regular file descriptors
if isatty.IsCygwinTerminal(tmpFile.Fd()) {
fmt.Fprintf(os.Stderr, "FAIL: isatty.IsCygwinTerminal returned true for regular file descriptor\n")
os.Exit(1)
}
// Assertion 4: isatty.IsCygwinTerminal returns false for invalid file descriptors
if isatty.IsCygwinTerminal(invalidFd) {
fmt.Fprintf(os.Stderr, "FAIL: isatty.IsCygwinTerminal returned true for invalid file descriptor\n")
os.Exit(1)
}
fmt.Println("PASS: go-isatty contracts verified")
}
Ursprungs-Seeder
anonym