The post discusses the convention of naming boolean existence variables in Go as 'ok', and argues that it is harmful and should be replaced with a more descriptive convention such as 'exists'. It provides examples and benefits of using the new convention.

10m read time From dolthub.com
Post cover image
Table of contents
Introductionokok: Not for just mapsok Considered HarmfulA better alternative existsVariation: optional channel receivesBut I like using okAn exception: type assertionsDoesn't this apply to err as well?Conclusion
1 Comment

Sort: