Skip to content

docs: mark Service Injection code examples as illustrative with template references - #278

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-270
Jul 14, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-270

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #270

Summary

Audited the "Service Injection & Configuration Management" section in README.md against the actual Go templates in internal/templates/languages/go/. The code examples differed significantly from what the templates actually generate - wrong package names (skills/ vs tools/), wrong struct names (Skill vs Tool), wrong constructor signatures, and fields that don't exist in the templates. Rather than updating the examples to match the current template output (which would drift again), each code block is now clearly marked as "illustrative" with a note pointing to the actual template file.

Changes

  • Added a prominent callout at the top of the "Service Injection & Configuration Management" section noting that code examples are illustrative and referencing the actual Go templates
  • Updated the "Generated Configuration" example to remove the non-existent Environment field and added an illustrative note pointing to config.go.tmpl
  • Updated the "Generated Tool Code" section to use correct Tool naming, server.NewBasicTool pattern, and tools/ package path, with illustrative notes pointing to tool.go.tmpl
  • Updated the "Main Registration" example to use tools.NewExportReportTool instead of skills.NewExportReportSkill, with illustrative note pointing to main.go.tmpl
  • Updated the "Generated Service Code" example to match the actual service.go.tmpl output (TODO-comment style interface, Impl struct, logger.Info in constructor), with illustrative note
  • Updated the "Skill Integration" example to use Tool naming and server.NewBasicTool pattern, with illustrative note pointing to tool.go.tmpl

…ate references

Audited the Service Injection and Configuration Management section in README.md against the actual Go templates in internal/templates/languages/go/. The code examples (config.go.tmpl, service.go.tmpl, tool.go.tmpl, main.go.tmpl) differed significantly from what the templates actually generate - wrong package names (skills/ vs tools/), wrong struct names (Skill vs Tool), wrong constructor signatures, and fields that don't exist in the templates (Environment field, concrete interface methods).

Rather than updating the examples to match the current template output (which would drift again), each code block is now marked as 'illustrative' with a note pointing to the actual template file. The examples were also updated to more closely reflect the template patterns (Tool naming, server.NewBasicTool usage, service.go.tmpl's TODO-comment style) while keeping the disclaimer that actual output may vary.
@edenreich
edenreich marked this pull request as ready for review July 14, 2026 19:34
@edenreich
edenreich requested a review from a team as a code owner July 14, 2026 19:34
@edenreich
edenreich merged commit 69b9806 into main Jul 14, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-270 branch July 14, 2026 19:35
inference-gateway-releaser Bot added a commit that referenced this pull request Jul 14, 2026
## [0.48.0](v0.47.1...v0.48.0) (2026-07-14)

### ✨ Features

* bump Go version to 1.26.4 ([#279](#279)) ([4945a28](4945a28))
* generate OTel-aligned telemetry configuration from extended spec.telemetry ([#281](#281)) ([47c5b3d](47c5b3d))

### 🐛 Bug Fixes

* quote boolean and numeric env values in compose template ([#267](#267)) ([6198824](6198824))

### 📚 Documentation

* add missing CLI flags to README generate/init flag tables ([#275](#275)) ([db0a842](db0a842))
* document spec.telemetry OpenTelemetry generation ([#277](#277)) ([bd75c08](bd75c08)), references [#259](#259)
* fix project structure diagrams and universal files section ([#274](#274)) ([17bad1b](17bad1b)), closes [#272](#272)
* mark Service Injection code examples as illustrative with template references ([#278](#278)) ([69b9806](69b9806))
* remove missing example ref, document all examples ([#273](#273)) ([4e30aff](4e30aff)), closes [#268](#268)
* update Template System and Architecture section with accurate Context struct and file mapping ([#276](#276)) ([352d084](352d084))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.48.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Service Injection and Configuration Management code examples may not match actual templates

1 participant