Skip to content

rewrite if-else chain as switch statement#2121

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
quasilyte:quasilyte/ifElseChain
Oct 7, 2018
Merged

rewrite if-else chain as switch statement#2121
jinzhu merged 1 commit intogo-gorm:masterfrom
quasilyte:quasilyte/ifElseChain

Conversation

@quasilyte
Copy link

From effective Go: https://golang.org/doc/effective_go.html#switch

It's therefore possible—and idiomatic—to write an if-else-if-else chain as a switch.

From effective Go: https://golang.org/doc/effective_go.html#switch

> It's therefore possible—and idiomatic—to write an if-else-if-else chain as a switch.
@jinzhu jinzhu merged commit 742154b into go-gorm:master Oct 7, 2018
@quasilyte quasilyte deleted the quasilyte/ifElseChain branch October 7, 2018 06:38
xuyang2 pushed a commit to easyops-cn/gorm that referenced this pull request Dec 11, 2018
From effective Go: https://golang.org/doc/effective_go.html#switch

> It's therefore possible—and idiomatic—to write an if-else-if-else chain as a switch.
blefevre pushed a commit to blefevre/gorm that referenced this pull request Feb 17, 2020
From effective Go: https://golang.org/doc/effective_go.html#switch

> It's therefore possible—and idiomatic—to write an if-else-if-else chain as a switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments