Skip to content

proposal: text/template: detect circular imports #21914

@a8m

Description

@a8m

When working on a large template project that composed from a lot of files, and you accidentally created an import cycle, what you will get on the execution is a huge chunk that is hard to debug and figure out where was the problem.

I'm proposing to add support for circular import detection in the template package, and return an informative message in cases like this.

Also, if this proposal will be accepted, I would like to create a CL.

Here's an example that demonstrates that: https://play.golang.org/p/6moF8cH8rW

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions