Browse Source

docs(bezero): fix subject

- upgrade instructions
- add missing import 'piscine'
- fix indentation
DEV-3202-new-go-exercicse-be-zero-fix
Tiago Collot 2 years ago
parent
commit
9864691922
  1. 13
      subjects/bezero/README.md

13
subjects/bezero/README.md

@ -2,7 +2,7 @@
### Instructions
- Write a function that takes a slice of integers and returns the same slice by initializing all the elements to 0.
Write a function that takes a slice of integers as an argument and returns the same slice by initializing all the elements to 0.
- If the slice is empty, return an empty slice.
### Expected function
@ -15,26 +15,27 @@ func BeZero(slice []int) []int {
### Usage
Here is a possible program to test your function :
Here is a possible program to test your function:
```go
package main
import (
"fmt"
"piscine"
)
func main() {
fmt.Println(BeZero([]int{1,2,3,4,5,6}))
fmt.Println(BeZero([]int{}))
fmt.Println(piscine.BeZero([]int{1, 2, 3, 4, 5, 6}))
fmt.Println(piscine.BeZero([]int{}))
}
```
And its output :
And its output:
```console
$ go run .
[0 0 0 0 0 0]
[]
```

Loading…
Cancel
Save