Hello and welcome to the Golang programming language course.
In the previous session, we talked about time, assertions and indecision.
We want to talk about the other interface concept.
Type suits.
In going Ingo Face plant sewage is used to compare the concrete type of an interface with the multiple
times pool wise in the case of statements.
It is similar to time assertions with only one difference i.e. Chase is testifying at times, not the
values.
You can also compare it tied to the interface type.
Let's go to this school program to illustrate how to use pipes which.
First, define a function that accept an argument as an entire face, for the example, following this
play, this a variable like a as any a face.
Now define Switch keyboard and a tie for using time switch.
Switch
A.
Don't open and close branches this time.
Now set different cases for type of a variable, for the example case in Cologne and set a statement
for this case, for example, display type and value of a very that if air time
person to operate case dash, dash and value color person, the legislation and and set forth time a
and set for the value a dot or an enclosed prances is and set into value.
Save the project.
Now do these for a few other data types.
For the example that Chase S1
Cologne said the message copied this line and paste for S3 and sets the time for a to just ring
and said another case.
Case load 64 color and again paste the message and set time for a two float and sixty four and define
default for the case.
Then none of the data types are available.
Different color and set a message type not.
Now go to main function and involve the display function and send different values of different data
times to the missile, as our units say, if the project go to main launcher called display function
and set an integer value as arguing and first display, a hundred and twenty three go to the next line.
And the other case that the string value as argument display sit and let you go through training language,
go to the next line.
And the other case that the floats 64 value as argument display a hundred point fifty five and go to
the next line.
And the other case that the bool value as argument display set true value, reformat the code and save
the project, then execute the program.
Now we can see the output time and value one hundred and twenty three time history, value go programming,
language and time floats 64 in value is one hundred point fifty five for the fourth case means bullion.
When we call the display unit to missing the value of Boolean to the of the an argument since no case
is performed for the Boolean data time.
So the default case is call and see type, not found message.
In order not to prolong the time of decision, we will finish it and we will continue the content in
the next session.
Goodbye.