Skip to content
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

Modify node type to interface{}. Add go module. #2

Closed
wants to merge 1 commit into from

Conversation

cxt90730
Copy link

No description provided.

@vedhavyas
Copy link
Owner

Apologies for the delay.
Any specific usecase for string to interface{}?

@cxt90730
Copy link
Author

cxt90730 commented Dec 6, 2019

I consider that in some specific cases, more node information needs to be stored, and type struct or interface{} may be used.

@vedhavyas
Copy link
Owner

Since we use it as key for the map, the key type has to satisfy the equality else it won't work. I think it is best to keep the string as is and the caller can map the string to spcific object

@cxt90730
Copy link
Author

cxt90730 commented Dec 6, 2019

I know. In fact, as you said, I can maintain another map to achieve the same effect. I just personally think that the type interface{} can be more concise. Thank you for your reply.

@cxt90730 cxt90730 closed this Dec 6, 2019
@vedhavyas
Copy link
Owner

@cxt90730 would you still like to give a PR with modules ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants