added syntax

adding syntax to code for easiness
This commit is contained in:
Shariq Ahmed Khan 2020-10-08 19:03:40 +05:30 committed by GitHub
parent 7d87b1b9f0
commit 838e16d236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,13 @@ package main
import "fmt"
func main() {
/*
slice is built on arrays (internally), its syntax is:
slice := make([]T, l, c) T is type, l is length and c is capacity
*/
// Unlike arrays, slices are typed only by the
// elements they contain (not the number of elements).
// To create an empty slice with non-zero length, use