Browse Source

fix some sintax errors in the readme proposed function and program

content-update
Augusto 5 years ago
parent
commit
c2ebaccdda
  1. 13
      subjects/listpushfront.en.md

13
subjects/listpushfront.en.md

@ -17,7 +17,7 @@ type List struct {
Tail *Node
}
func ListPushFront(l *list, data interface{}) {
func ListPushFront(l *List, data interface{}) {
}
```
@ -29,21 +29,22 @@ Here is a possible [program](TODO-LINK) to test your function :
package main
import (
"fmt"
piscine ".."
"fmt"
)
func main() {
link := &list{}
link := &piscine.List{}
piscine.ListPushFront(link, "Hello")
piscine.ListPushFront(link, "man")
piscine.ListPushFront(link, "how are you")
for link.head != nil {
fmt.Println(link.head.data)
link.head = link.head.next
it := link.Head
for it != nil {
fmt.Println(it.Data)
it = it.Next
}
}
```

Loading…
Cancel
Save