Sample
golang.org/x/text v0.29.0: convert text to title case using language-specific casing rules
Verified sample for golang golang.org/x/text v0.29.0: convert text to title case using language-specific casing rules. The contract ran on go 1.26 · linux…
sha256:079bfb2fc9d31f602acef8190a9f811a66f16b3d90669ea382523971c749fa7b
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
windows 11 x64 go
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-19 |
Case
HOW- Goal
- convert text to title case using language-specific casing rules
- Packages
- Symbols
-
- golang.org/x/text/cases.Title
- golang.org/x/text/language.Tag
- Created
- 2026-08-18T17:21:02Z
Contract
- cases.Title(language.English).String("the lord of the rings") == "The Lord Of The Rings"
- cases.Title(language.Turkish).String("istanbul") == "İstanbul"
- cases.Title(language.Dutch).String("ijsselmeer") == "IJsselmeer"
- cases.Upper(language.Turkish).String("diyarbakır") == "DİYARBAKIR"
Files
- PROMPT.md
- casing.go
- csx.json
- go.mod
- go.sum
- spec.json
- test/contract.go
Source
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: convert text to title case using language-specific casing rules
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/text@v0.29.0
Demonstrate these symbols/APIs:
- golang.org/x/text/cases.Title
- golang.org/x/text/language.Tag
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.
package casing
import (
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
// ToTitle converts a string to title case using the specified language tag rules.
func ToTitle(tag language.Tag, s string) string {
c := cases.Title(tag)
return c.String(s)
}
// ToUpper converts a string to upper case using the specified language tag rules.
func ToUpper(tag language.Tag, s string) string {
c := cases.Upper(tag)
return c.String(s)
}
// ToLower converts a string to lower case using the specified language tag rules.
func ToLower(tag language.Tag, s string) string {
c := cases.Lower(tag)
return c.String(s)
}
{"case":{"caseId":"case:sha256:328701b1b5d5733033474f331bc1a028be2daffa952977c23d5acfdd7b4f77d3","contract":["cases.Title(language.English).String(\"the lord of the rings\") == \"The Lord Of The Rings\"","cases.Title(language.Turkish).String(\"istanbul\") == \"İstanbul\"","cases.Title(language.Dutch).String(\"ijsselmeer\") == \"IJsselmeer\"","cases.Upper(language.Turkish).String(\"diyarbakır\") == \"DİYARBAKIR\""],"goal":"convert text to title case using language-specific casing rules","kind":"HOW","packages":["pkg:golang/golang.org/x/text@v0.29.0"],"schemaVersion":1,"symbols":["golang.org/x/text/cases.Title","golang.org/x/text/language.Tag"]},"contractCommand":["go","run","./test"],"environment":{"arch":"x64","ecosystem":"golang","os":"windows","osVersionBucket":"11","packageManager":"go","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/golang.org/x/text@v0.29.0"],"schemaVersion":1,"symbols":["golang.org/x/text/cases.Title","golang.org/x/text/language.Tag"],"verifierAdapter":"golang@1"}
module example.com/casing
go 1.24.0
require golang.org/x/text v0.29.0
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
{
"schemaVersion": 1,
"goal": "convert text to title case using language-specific casing rules",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/text@v0.29.0"
],
"symbols": [
"golang.org/x/text/cases.Title",
"golang.org/x/text/language.Tag"
]
}
package main
import (
"fmt"
"os"
"example.com/casing"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
func assertEqual(got, want, context string) {
if got != want {
fmt.Fprintf(os.Stderr, "Assertion failed for %s: got %q, want %q\n", context, got, want)
os.Exit(1)
}
}
func main() {
// English title casing
enTitle := casing.ToTitle(language.English, "the lord of the rings")
assertEqual(enTitle, "The Lord Of The Rings", "English title casing")
// Direct cases.Title with language.English
enDirect := cases.Title(language.English).String("hello world")
assertEqual(enDirect, "Hello World", "Direct cases.Title with English")
// Turkish title casing: 'i' becomes dotted capital 'İ'
trTitle := casing.ToTitle(language.Turkish, "istanbul")
assertEqual(trTitle, "İstanbul", "Turkish title casing for 'istanbul'")
// Dutch title casing: 'ij' digraph capitalized together as 'IJ'
nlTitle := casing.ToTitle(language.Dutch, "ijsselmeer")
assertEqual(nlTitle, "IJsselmeer", "Dutch title casing for 'ijsselmeer'")
// English upper casing
enUpper := casing.ToUpper(language.English, "hello")
assertEqual(enUpper, "HELLO", "English upper casing")
// Turkish upper casing: 'i' becomes 'İ'
trUpper := casing.ToUpper(language.Turkish, "diyarbakır")
assertEqual(trUpper, "DİYARBAKIR", "Turkish upper casing for 'diyarbakır'")
fmt.Println("All contract assertions passed.")
}
Origin Seeder
anonymous