Browse Source

docs(concatslice): fix subject

- add missing import 'piscine'
- format exercise title
- upgrade instructions
- fix white-spaces and indentation
DEV-3183-new-go-exercise-concatslice
Tiago Collot 2 years ago
parent
commit
1a86e0c886
  1. 17
      subjects/concatslice/README.md

17
subjects/concatslice/README.md

@ -1,36 +1,37 @@
## Concat-Slice
## concatslice
### Instructions
- Write a function that takes two slices of integers and returns the concatenation of the two slices.
Write a function `ConcatSlice()` that takes two slices of integers as arguments and returns the concatenation of the two slices.
### Expected function
```go
func ConcatSlice(slice1,slice2 []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(ConcatSlice([]int{1,2,3},[]int{4,5,6}))
fmt.Println(ConcatSlice([]int{},[]int{4,5,6,7,8,9}))
fmt.Println(ConcatSlice([]int{1,2,3},[]int{}))
fmt.Println(piscine.ConcatSlice([]int{1, 2, 3}, []int{4, 5, 6}))
fmt.Println(piscine.ConcatSlice([]int{}, []int{4, 5, 6, 7, 8, 9}))
fmt.Println(piscine.ConcatSlice([]int{1, 2, 3}, []int{}))
}
```
And its output :
And its output:
```console
$ go run .

Loading…
Cancel
Save