Full-coverage Go client for the Forgejo API (450 endpoints)
- Go 100%
Both config-based constructors now return core.Result instead of (*Forge, error). Body uses defer-recover for panic safety + explicit core.Fail/core.Ok at every branch — same shape validated in #1390 (go-webview). Validates the migration shape generalises from Options-style constructors (go-webview's New(opts ...Option)) to config-based constructors (NewFromConfig(flagURL, flagToken string)). Caller pattern at all callsites: r := forge.NewFromConfig(url, token) if !r.OK { return r } f := r.Value.(*Forge) Changes: - config.go: NewForgeFromConfig + NewFromConfig migrated; docstrings AX-tightened with Result-shape examples. - config_test.go: TestNewFromConfig_Good + TestNewForgeFromConfig_NoToken_Bad callsites migrated. - ax7_generated_test.go: 6 generator-emitted callsites migrated (3x NewFromConfig + 3x NewForgeFromConfig — Good/Bad/Ugly variants). Switched from core.AssertNoError(t, err) / core.AssertError(t, err) to core.AssertTrue(t, r.OK) / core.AssertFalse(t, r.OK). Verification: - GOWORK=off go build ./... clean (production build passes) - Test runtime verification BLOCKED by pre-existing AX7 generator output rot — see Mantis #1392 (24+ test files missing core import + generic type instantiation bugs in pagination_*_test.go). Migration is sound; test verification deferred until #1392 lands. Mantis #1391 (child of #1389). Sister: #1390 (go-webview, closed). Filed: #1392 (AX7 generator output rot blocking tests). Co-Authored-By: Virgil <virgil@lethean.io> |
||
|---|---|---|
| .core | ||
| .forgejo/workflows | ||
| .github/workflows | ||
| docs | ||
| external | ||
| go | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmodules | ||
| .golangci.yml | ||
| .woodpecker.yml | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| CONTRIBUTING.md | ||
| go.work | ||
| LICENCE | ||
| README.md | ||
| sonar-project.properties | ||