From 44e4eb1dfea8e5f1b01a2cd224cd40cc6db58a20 Mon Sep 17 00:00:00 2001 From: jotapero Date: Mon, 17 Oct 2022 17:26:42 +0100 Subject: [PATCH] docs(sliceAdd): fix subject - fix indentation - fix grammar - fix packages and import --- subjects/sliceadd/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/subjects/sliceadd/README.md b/subjects/sliceadd/README.md index 4974053ff..03df17534 100644 --- a/subjects/sliceadd/README.md +++ b/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 @@ -15,22 +15,24 @@ func SliceAdd(slice []int , num 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(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)) } ``` -And its output : +And its output: ```console $ go run .