krzysztofreczek / go-structurizr

A library for auto-generating C4 diagrams from Go applications
MIT License
310 stars 18 forks source link

Recursive types cannot be seen twice #155

Closed DanielHoffmann-BO closed 1 week ago

DanielHoffmann-BO commented 1 month ago

If I have a type that reads as recursive, like a logger from the zap package, or a connection pool from pgx, it will only be seen as a child of a single type, even if it is in multiple parents. I have several types that have a logger, but only the first one shows a connection to zap.Logger, and I have multiple Store types that share the same pgxpool.Pool, but again, only the first one shows a connection in the graph.

krzysztofreczek commented 3 weeks ago

Hi @DanielHoffmann-BO, thank you for raising this issue. Let me try to recreate that and check if this can be fixed.

I remember there is a piece of code that prevents the generation an infinite graph with a recursive loop. I need to revisit that.

krzysztofreczek commented 1 week ago

@DanielHoffmann-BO, can you pleas check if the latest version fixes the issue on your side?

DanielHoffmann-BO commented 1 week ago

Hey, just checked and it works! Thanks so much!