Hello and welcome to the goal and programming language course in the previous session, we talked about
print function and indecision.
We want to talk about the authors this empty package concept.
This print Earth function.
The sprint function in go language formats, according to a format, is specified and returns the resulting
estrange.
This sprint, it functions the same way as print.
If that's the only difference is that Sprint is free to the format at the input string instead of printing
on the output council.
Moreover, this function is defined under the empty package.
Here, you need to import this empty package in order to use this function.
Now you can see the syntax.
Parameter dysfunction accepts two parameters which are illustrated below first.
Format Typekit this room, this includes some verbs along with some strings and second, a triggered
interface.
This is the specified constant variables and return value.
It returns the resulting string.
Now let's go to this good program to illustrate the use age offspring f function first, declaring some
string variables that name Croma value equals, he said.
Where do you go?
And for value visa programming language now calling its print function?
First, define a variable like resolved calling equals f empty package dot s preened f function first
and s lowercase for S2 variable and is a and percent is lowercase dot bank slashed and set a string
variable name and value.
Now calling write a string function from i o package to write the contents of the S10 result to oldest
city out.
So Ryan i o dot rather history and set arguments as to the outfrom OS package or s dot this p the out
and search results and save the project.
Now, go to the next line and define some other variables.
For the example, VI number one, number two and number three initialized in five, 10 and 15 and calling
your sprint function again resolved equals if emptied out as plaintiff and set variable first in the
class percent the equals first, then the and set variables for these converging characters.
Number one and number two and set number three now calling write a string function to write the contents
of this and result to all.
Statistically, the again i o dot write the string history the are front always package and set result
variable.
Reformat the code, save the project and execute the program.
Now we can see the output go is a programming language and five plus 10 equals 15.
First, we create this string variable and using the ESP function to four months, according to a format
specified.
Then we assign the return value inside the recent event.
And finally, we bring the value of the result variable inside the standard output in order not to prolong
the time of decision.
We will finish sheet and we will continue the content in the next session.
Goodbye.