Browse Source

docs(sliceAdd): fix subject

- fix indentation
- fix grammar
- fix packages and import
pull/1526/head
jotapero 2 years ago committed by José Rosendo
parent
commit
44e4eb1dfe
  1. 10
      subjects/sliceadd/README.md

10
subjects/sliceadd/README.md

@ -2,8 +2,8 @@
### Instructions
- Write a function that takes a slice of integers and int and adds integer in the slice then returns the slice
- If the slice is empty, return a slice with the new value
Write a function that takes a slice of integers and an `int` as arguments, adds the `int` to the slice and returns it.
- If the slice is empty, return a slice with the new value.
### Expected function
@ -22,11 +22,13 @@ package main
import (
"fmt"
"piscine"
)
func main() {
fmt.Println(SliceAdd([]int{1, 2, 3}, 4))
fmt.Println(SliceAdd([]int{}, 4))
fmt.Println(piscine.SliceAdd([]int{1, 2, 3}, 4))
fmt.Println(piscine.SliceAdd([]int{}, 4))
}
```

Loading…
Cancel
Save