go article quote update
This commit is contained in:
parent
fa13e5dc10
commit
edff86e524
|
@ -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
|
```go
|
||||||
str := "yeah"
|
str := "yeah"
|
||||||
|
|
Loading…
Reference in New Issue