You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,27 @@ if a < 5 {
36
36
}
37
37
```
38
38
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
+
casefalse:
54
+
// Do something.
55
+
default:
56
+
// Do something else.
57
+
}
58
+
```
59
+
39
60
```golang
40
61
// For-loop.
41
62
for {
@@ -194,7 +215,7 @@ panic(err)
194
215
195
216
## Caveats
196
217
### 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.
0 commit comments