Skip to content

Commit 032cfa4

Browse files
committed
Update README.md
1 parent 2a1aa47 commit 032cfa4

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ if a < 5 {
3636
}
3737
```
3838

39+
```golang
40+
a := "b"
41+
42+
// Switch-statement.
43+
switch a {
44+
case "a":
45+
// Do something.
46+
case "b":
47+
// Do something.
48+
default:
49+
// Do something else.
50+
}
51+
52+
switch {
53+
case false:
54+
// Do something.
55+
default:
56+
// Do something else.
57+
}
58+
```
59+
3960
```golang
4061
// For-loop.
4162
for {
@@ -194,7 +215,7 @@ panic(err)
194215

195216
## Caveats
196217
### Condition evaluation
197-
In contrast to many other programming languages, TypeShell evaluates all conditions before the actual statement. This is done to handle the limitations of Batch/Bash.
218+
In contrast to many other programming languages, TypeShell evaluates all conditions before the actual statement. This is done to handle the limitations of Batch/Bash. HINT: This is also true for switch-evaluations since switchs is internally converted to ifs.
198219

199220
```golang
200221
if a == 1 && b == 1 {

0 commit comments

Comments
 (0)