{"id":50780536,"url":"https://github.com/cnuss/golib","last_synced_at":"2026-06-12T03:01:23.802Z","repository":{"id":363328651,"uuid":"1262842309","full_name":"cnuss/golib","owner":"cnuss","description":"Go library template: thin façade over stable/alpha versioned packages, with CI, CodeQL, Scorecard + cosign releases","archived":false,"fork":false,"pushed_at":"2026-06-08T11:42:31.000Z","size":31,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T13:24:02.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cnuss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-08T11:25:23.000Z","updated_at":"2026-06-08T11:42:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cnuss/golib","commit_stats":null,"previous_names":["cnuss/golib"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/cnuss/golib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuss%2Fgolib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuss%2Fgolib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuss%2Fgolib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuss%2Fgolib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cnuss","download_url":"https://codeload.github.com/cnuss/golib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuss%2Fgolib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34226629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-12T03:00:50.659Z","updated_at":"2026-06-12T03:01:23.787Z","avatar_url":"https://github.com/cnuss.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nMade from this template? Find/replace \"golib\" → your library name across the\nrepo, update lib.go's `package golib` clause, then delete this comment.\n`make all` should stay green. (Workflows read GITHUB_REPOSITORY at runtime, so\nthey need no edits.)\n--\u003e\n\n# golib\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/cnuss/golib.svg)](https://pkg.go.dev/github.com/cnuss/golib)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cnuss/golib)](https://goreportcard.com/report/github.com/cnuss/golib)\n[![CI](https://github.com/cnuss/golib/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cnuss/golib/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/cnuss/golib/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/cnuss/golib/actions/workflows/codeql.yml)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/cnuss/golib/badge)](https://scorecard.dev/viewer/?uri=github.com/cnuss/golib)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\n`golib` is a thin, stable façade over stable/alpha versioned packages\n(`v1` stable contract, `v1alpha1` mutable implementation), with CI, CodeQL,\nOpenSSF Scorecard, cosign-signed releases, Dependabot, examples, and an e2e\nharness.\n\nThe API is a generic builder: `New[T]()` configures with `With*` methods and\nfinalizes with `Build()`.\n\n## Quick Start\n\n```sh\ngo get github.com/cnuss/golib\n```\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cnuss/golib\"\n)\n\nfunc main() {\n\tres := golib.New[string]().\n\t\tWithName(\"greeting\").\n\t\tWithValue(\"hello world\").\n\t\tBuild()\n\n\tfmt.Printf(\"%s: %s\\n\", res.Name, res.Value) // greeting: hello world\n}\n```\n\n(Full source: [`examples/basic/main.go`](./examples/basic/main.go).)\n\n## Layout\n\nThree packages, stable/alpha versioning:\n\n```\ngithub.com/cnuss/golib           — root façade. Stable surface (New).\ngithub.com/cnuss/golib/v1        — stable Builder[T] interface + Result[T].\ngithub.com/cnuss/golib/v1alpha1  — current implementation. May change\n                                   between alpha revisions.\n```\n\nApplication code imports the root (`golib.New[T]()…`). Code that needs to\ndeclare types against the interface imports `v1`. Direct access to the\n`BuilderImpl[T]` struct lives in `v1alpha1`.\n\nFor the file-by-file map, see\n[CONTRIBUTING.md → Where to find things](./CONTRIBUTING.md#where-to-find-things).\n\n## API at a glance\n\n```go\ntype Builder[T any] interface {\n    WithName(name string) Builder[T]   // display name carried into the Result\n    WithValue(v T) Builder[T]          // the payload Build produces\n    Build() Result[T]                  // terminal: assembles and returns\n    Name() string                      // configured name (empty if unset)\n}\n\ntype Result[T any] struct {\n    Name  string `json:\"name,omitempty\"`\n    Value T      `json:\"value\"`\n}\n\nfunc New[T any]() Builder[T]   // unconfigured builder\n```\n\n## Examples\n\nSelf-contained programs in [`./examples`](./examples):\n\n| Example | Demonstrates                                          |\n| ------- | ----------------------------------------------------- |\n| `basic` | Smallest wiring — `New` + `WithValue` + `Build`.      |\n| `named` | A typed struct payload carried through `WithValue`.   |\n\nRun one locally:\n\n```sh\nmake run basic\nmake run named\n```\n\n## Testing\n\n```sh\nmake test   # library unit + fuzz tests (fast, in-package)\nmake e2e    # builds and runs every example binary, asserts its output\n```\n\n`make e2e` runs `go test -count=1 -v ./e2e`. The `-count=1` defeats the test\ncache, since the harness builds the example binaries at runtime and the cache\nkey wouldn't otherwise pick up example source changes.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for the local dev loop, release\nprocess, and what makes a good example.\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnuss%2Fgolib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcnuss%2Fgolib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnuss%2Fgolib/lists"}