though still cannot comprehend why go allows to access promoted ommiting inner type name 2:32, while requires it in composite literal, when we creating such variable 2:17.
Could you please clarify your question? If you are talking about why internal fields are not promoted, it is because by doing so, it would break the whole concept of exported and internal only field as that would mean we are leaking out internal implementation via composition.
No difference. The Go compiler is smart enough to use the passed value as needed. If you pass a value when a pointer is required, it can derive the pointer from passed in value.
Excellent as always 👍
though still cannot comprehend why go allows to access promoted ommiting inner type name 2:32, while requires it in composite literal, when we creating such variable 2:17.
Could you please clarify your question? If you are talking about why internal fields are not promoted, it is because by doing so, it would break the whole concept of exported and internal only field as that would mean we are leaking out internal implementation via composition.
what is the diffrence passing directly struct type and passing using & ? i tied it seems same result
No difference. The Go compiler is smart enough to use the passed value as needed. If you pass a value when a pointer is required, it can derive the pointer from passed in value.
@@codeandlearnwithlove Thanks for the clarification, i am new to golang ,can you make a series on dsa using golang ? it will be very helpful
@@somyaranjandas4599 I have plans for it, but first I want to complete the Go course.