Hello and welcome to the Golang programming language course in the previous session, we talked about,
if pained, if function and indecision, we want to talk about the other F.A. package concept.
If preened and fonctionne.
The FBI and fonctionne in go language formats using the different formats for its operations and rise
to I o dot writer.
It's exactly the same as if print function.
One extra point in print at end is that a new line is appended.
The formatted input string will then be written into dimension.
With the help of the writer here, as spaces are always added between the specified options and the
new line is appended at the end.
More on the function is defined under this empty package.
So you need to import this empty package in order to use this function.
Now you can see the syntax parameters.
This function accepts two parameters, which are lists it below.
First, W type is on auto writer.
That is, they specify the standard input or output and a three dot interface.
This is containing some strings and constant variables used in the code and return value.
It returns the number of buys written and any write error encountered.
Now, let's go to the school program to illustrate the uses of the FP and function.
First, learning some history variables, for the example that name common value and initialize them
go and programming language
now calling FP and function first defined too many of the likes number and verbal column equals from
the package F.A. Select FP and function.
First is to the art from the OST package will start to the out and set the other variable name.
It is a and value
and and that is the statements at the point now printing the number of mines written if empty dots print.
No.
Wise leader dropped like a sledgehammer and printing, if any, at all encountered if empty lots preen.
We sit is separate for FP brackets closed and.
Go to the next line and declaring other missing variables like there is still a long comma or two and
comma is the artery and initialized, then A,
B and C now calling f print and function, which returns number as the number of by 310 and error as
any and all encounters.
So we write number and you are equals from the package of empty synik, FP and function and first set
out from the always package.
And set the other variables like SDR one and SDR two and SDR three now printing number of by three to
infinity dots print No.
Bites of Rita
and printing, if any raw encounter, if found to the print he off work reformat, they could save the
project and execute the program.
Now we can see the output for first time that we have go is the programming language and 33 by 310 and
no error.
And for second bad a b c six miles of written and no error in the first code.
It can be seen that in print and function, no new line was added.
Still, it prints the new line and in the second coat it can be seen that in print and function, no
space was added.
Still, it prints, including a space in this sandpit.
First, we create a string value of it and using the print and function.
Then we assign the retained value inside to variables like number and IRR.
And finally, the print the number of by 310 as no variable.
And if there is an error, we will display it as it already would.
Now we could use from if print and function in order not to prolong the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.