Private (unexported) method #9498
KilianVounckx
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
Both functions and methods are private by default. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I see it right now (I could be wrong), a function is private by default and is has to be made public with the pub keyword. Methods however seem to be public. Is there a reason for this? And is there a way to make them private?
I would think that having them behave like functions is the most logical.
The method above can be called by any other module. However I think it would be more logical to have that method be private and have the developer explicitly make them public, like functions:
Beta Was this translation helpful? Give feedback.
All reactions