Skip to content

docs: Document usage of new go tools feature in go1.24.0 #1067

@joerdav

Description

@joerdav

With the release of go1.24.0, there is a new feature allowing tools to be tracked in the go.mod.

You can run go get -tool github.com/a-h/templ/cmd/templ@latest to add the latest templ version as a tool.

Then you can run templ as normal using go tool templ. For example go tool templ generate.

This links the generator version to the runtime version specified in the go.mod. So you reduce the likelihood of generated code that is incompatible with the runtime version.

There should be a docs section outlining this, or at least that links to the go docs as a recommended way of tracking templ versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions