Golang - 條件式與迴圈



if-else

if condition {
    ...
} else {
    ...
}

switch

switch condition {
case c1:
    ...
case c2:
    ...
default:
    ...
}

for

for i := 0; i < count; i++ {
    ...
}

while

for {
    ...
}
#golang #GO







你可能感興趣的文章

不可不知的小工具-REST Client

不可不知的小工具-REST Client

[JS Behind The Scene] 從簡單例子了解 hoisting 的運作機制

[JS Behind The Scene] 從簡單例子了解 hoisting 的運作機制

JavaScript 程式執行原理:Closure

JavaScript 程式執行原理:Closure






留言討論