You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope that the switch statement in the new version of go language will be as easy to use as the switch language in Java 13 version.Thank you for hoping that the official will accept my opinion!
4.Of course, these are my personal needs and opinions, and do not represent everyone's thoughts. I just have this idea. I hope you can consider it, thank you😄🤝~
Go is a statement oriented language. It does not currently support any expressions that contain blocks. It would be odd to permit switch expressions and not also permit if expressions, or select expressions, or perhaps even for expressions.
Also, in my opinion, supporting complex expressions that contain blocks does not make a program easier to read and understand. What is the corresponding benefit that is worth that cost in readability?
1.My proposals and needs:
I hope that the switch statement in the new version of go language will be as easy to use as the switch language in Java 13 version.Thank you for hoping that the official will accept my opinion!
This is how we currently write switch statements:
<T>
Is generic & I think it can also support function return💡2.The version of go I currently use is:
go version go1.13 darwin/amd64
3.What did you expect to see?
4.Of course, these are my personal needs and opinions, and do not represent everyone's thoughts. I just have this idea. I hope you can consider it, thank you😄🤝~
The text was updated successfully, but these errors were encountered: