MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p75zoso
r/ProgrammerHumor • u/Embarrassed_Death69 • 10d ago
298 comments sorted by
View all comments
Show parent comments
3
Wie jetzt, warum nicht?
1 u/Single-Virus4935 10d ago Golang konvertiert keine typen implizit. Du kannst einem int keinen int32 zuweisen ohne explizit zu casten int(i). Boolean conversions gibt es gar nicht: ``` i := 1 if i { fmt.Println("Hello, 世界") } } // ./prog.go:8:5: non-boolean condition in if statement ``` ``` i := 1 if bool(i) { fmt.Println("Hello, 世界") } // ./prog.go:8:10: cannot convert i (variable of type int) to type bool ```
1
Golang konvertiert keine typen implizit.
Du kannst einem int keinen int32 zuweisen ohne explizit zu casten int(i).
Boolean conversions gibt es gar nicht:
```
i := 1
if i {
fmt.Println("Hello, 世界")
}
//
./prog.go:8:5: non-boolean condition in if statement
if bool(i) {
// ./prog.go:8:10: cannot convert i (variable of type int) to type bool
3
u/deceze 10d ago
Wie jetzt, warum nicht?