Skip to content

[golang] The methods of a struct can be a subtree of the struct ? #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tenfyzhong opened this issue Jan 15, 2023 · 1 comment
Closed

Comments

@tenfyzhong
Copy link

image

A method is a root node, but it should be a subtree of the struct it belongs to.

@stevearc
Copy link
Owner

There has been more discussion of this in #81, but the summary is:

  • Golang is somewhat unique among languages in that the structural layout of the code does not match the hierarchical layout of the concepts. Methods are not nested under structs, and indeed are not guaranteed to be defined below the struct or even in the same file.
  • Aerial was built with the assumption that the hierarchical structure matches the code structure
  • Making aerial represent the hierarchical structure of Go would require a lot of custom code, and would still be janky. Some of aerial's features would straight up not work, or would have unexpected results.

If this is something you need, you'll have to use a golang-specific plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants