... | ... | @@ -129,6 +129,25 @@ rather than: |
|
|
func (subnet *Subnet) ID(int64)
|
|
|
```
|
|
|
|
|
|
## Continue/Label abd Goto Statements
|
|
|
|
|
|
It is allowed to use the `continue to label` statements to simplify the code containing nested loops. The labels should be all upper case with underscores to separate the words. For example:
|
|
|
|
|
|
```
|
|
|
OUTER_LOOP:
|
|
|
for _, item := range list.Items {
|
|
|
for _, reserved := range reserved.Items {
|
|
|
if reserved.ID == item.ID {
|
|
|
continue OUTER_LOOP
|
|
|
}
|
|
|
... do some other work ...
|
|
|
}
|
|
|
... do some other work ...
|
|
|
}
|
|
|
```
|
|
|
|
|
|
The `goto` statements MUST NOT be used as they generally make the code flow harder to follow, and there are alternative ways to achieve the same behavior.
|
|
|
|
|
|
# TypeScript Style
|
|
|
|
|
|
Used by UI. Details TBD
|
... | ... | |