Hello and welcome to the Golden Programming Languages course in the previous session.
We talked about creating slides using already existing slice and indecision.
We want to talk about the others as nice concepts.
Create this slice using main function.
You can also create this nice using the made function, which is provided by the Go library.
This function takes three parameters time, lengths and capacity here.
Capacity values Optionally, it assigns an underlying array with a size that is equal to the given capacity
and returns.
A slice which refers to the underlying array.
Generally, make function is used to create an entire slice here into slices on those slices that contain
a.re France.
You can see the syntax.
Then you use make function.
One option you have is to specify the length of this slice.
Then you just specify the length.
The capacity of the slice is the same.
Now go to this school to illustrate how to create a slice unique main function.
First, create PSNI's by Len four and capacity seven by make function for the example via the slice
one equals make function first, set the tight end and set the land full and set the capacity.
Seven.
Now, display this nice warm weather, this nice one equal.
First, and the lower case and legislative lengths include first and De Palma backslash T and capacity
include first and the lower case brackets that end and sets the radiator first, slice one and then
land of its lifespan by the learned function land slice, warm and then capacity of this nice by the
function chat and set this list long.
And create this list by just Lin seven.
Go to the next line and create another slice that just slice two equals make function and type is in
length is seven.
Go to the next line and display this very area if if it's nice to equal first and the lower case back
is less tea length equal two percent.
The lower case come back is and check a city equal two percent the back end and sets the very idea a
slice too.
And length of this nice to by the function land.
This nice, too, and capacity of this guys to buy the phones and chat and set the slice.
If automatic to save the project and execute, they could.
Now we can see the output for this, like swan length is full and capacity is seven.
And for the lies, two lengths is set in and the capacities sit in.
It's nice is an abstraction over array.
It actually uses arrays as an underlying structure.
The land function returns the element present in their size, their chat function returns.
The capacity of this slice means how many elements it can accommodate in order not to prolong the time
of decision.
We will finish it and we will continue the content in the next session.
Goodbye.