()
| 505 | } |
| 506 | |
| 507 | func ExampleList_Append() { |
| 508 | l := NewList[string]() |
| 509 | l = l.Append("foo") |
| 510 | l = l.Append("bar") |
| 511 | l = l.Append("baz") |
| 512 | |
| 513 | fmt.Println(l.Get(0)) |
| 514 | fmt.Println(l.Get(1)) |
| 515 | fmt.Println(l.Get(2)) |
| 516 | // Output: |
| 517 | // foo |
| 518 | // bar |
| 519 | // baz |
| 520 | } |
| 521 | |
| 522 | func ExampleList_Prepend() { |
| 523 | l := NewList[string]() |