From 838e16d236231cdac2a653b477274ddf61525e67 Mon Sep 17 00:00:00 2001 From: Shariq Ahmed Khan Date: Thu, 8 Oct 2020 19:03:40 +0530 Subject: [PATCH] added syntax adding syntax to code for easiness --- examples/slices/slices.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/slices/slices.go b/examples/slices/slices.go index 914a327..05f5232 100644 --- a/examples/slices/slices.go +++ b/examples/slices/slices.go @@ -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