We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57e2566 commit bbed3edCopy full SHA for bbed3ed
1.14/signal_based_preemption.md
@@ -137,13 +137,35 @@ sigaction 的三个参数:
137
goto 虽然看起来无所不能,但实际上高级语言的 goto 是跳不出函数作用域的,比如下面这样的代码就没法通过编译:
138
139
```go
140
-TODO
+package main
141
+
142
+func xx() {
143
+xx:
144
+}
145
146
+func main() {
147
+ goto yy
148
+ goto xx
149
+yy:
150
151
```
152
153
+goto yy,没有问题,但是 goto xx 是不行的。
154
155
在其它语言里也一样:
156
157
```c
158
+#include <stdio.h>
159
160
+void xx() {
161
+XX:
162
+ printf("hello world");
163
164
165
+int main() {
166
+ goto XX;
167
+ return 0;
168
169
170
171
### non-local goto
0 commit comments