diff --git a/content/post/2021/04/exploring-go.md b/content/post/2021/04/exploring-go.md index d3e1d9c9..03180bea 100644 --- a/content/post/2021/04/exploring-go.md +++ b/content/post/2021/04/exploring-go.md @@ -205,7 +205,12 @@ Now, the bad parts. Go is not a functional language, but easily lends itself to }) ``` -Is impossible without calling in external packages with unclear APIs and incomplete documentation. Furthermore, I wanted to chain two string replace methods together, which is simply `"bla".replace(...).replace(...)` in any language - except Python perhaps. And Go. In Go, many utility functions reside in packages instead of as methods on the string type, resulting in something awkward as: +Is impossible without calling in external packages with unclear APIs and incomplete documentation. As Fumitoshi Ukai said in his [When in Go, do as Gophers do](https://talks.golang.org/2014/readability.slide#1) talk: + +> Don't write Go code as you write code in C++/Java/Python. +Write Go code as Gophers write code. + +So I complied simply wrote a for loop. Next, I wanted to chain two string replace methods together, which is simply `"bla".replace(...).replace(...)` in any language - except Python perhaps. And Go. In Go, many utility functions reside in packages instead of as methods on the string type, resulting in something awkward as: ```go str := "yeah"