This commit is contained in:
Unknwon
2015-09-21 09:36:26 -04:00
parent 1ec25611bc
commit e62f886e92
2 changed files with 4 additions and 4 deletions

View File

@@ -113,9 +113,9 @@ type Interval struct {
初始化方式:
```go
intr := Interval(0, 3) (A)
intr := Interval(end:5, start:1) (B)
intr := Interval(end:5) (C)
intr := Interval{0, 3} (A)
intr := Interval{end:5, start:1} (B)
intr := Interval{end:5} (C)
```
A值必须以字段在结构体定义时的顺序给出**&** 不是必须的。B显示了另一种方式字段名加一个冒号放在值的前面这种情况下值的顺序不必一致并且某些字段还可以被忽略掉就像C中那样。