Hello and welcome to the Golang programming language course.
In the previous session, we talked about if Alan function and in this session we want to talk about
the other half empty package concept.
Error is a function.
The error, a function in good language, allow us use formatting features to create descriptive error
messages.
Error formats, according to the mentioned format, is it and assigns this format of this string to
a variable.
This is the error message.
This function allows you to print customized error messages as per the user's veal and preened into
council as an error message.
Moreover, this function is defined under this empty package.
Here, you'll need to import this empty package in order to use this function.
Now you can see this syntax.
Parameters, these function, access to parameters which are illustrated below.
Format type is extreme.
This is your error message with placeholder values such as per cent S. Forest Ring and person for an
integer a three that interface.
This is either constant variable name used in the code or any inbuilt function and return value.
It returns the string as a value that satisfies a rule.
Now, let's go to this school with program to illustrate the uses of it or if function.
Now, calling it a function of impersonate the string formatting, which is used for printing extracts
first define a variable like e r common equals from F A. Package B inward or F function and set the
message.
Arrows are cute at first and v lowercase and set time dot now.
Now printing dare go to the next line.
FP.
And it all happened
and set the raw message, reformat the code, save the project and execute the, you know.
Now we can see the output, and it all happened around IQ and this time.
Now we were able to get the variables value from using error.
If function and preened, then we have reached the end of decision.
I hope you have taken full advantage of decision onto next edition.
Goodbye.