Hello and welcome to the Golang programming language course.
Independent musician, we talked about how to redefine and indecision.
We want to talk about the other files and directories concept.
How to ride.
Define.
Go Lang offers a vast, in-built library that can be used to perform, read and write operations.
Enfance will be right the string in the fine using old start writing string function writers, doing
functions, write the contents of this string and it returns the number of bytes written and it all
is in.
Now you can see the syntax.
Let's go to the school program to write, define,
first, create the font and name it to start text by the create function.
This function takes the foreign name as an argument and creates it.
The return value of this function is defined and and the rules in case an error is thrown, it received
by the IRR variable, and that's all a function of luck.
So first, define two variable like fine and you are calling equals in the create function from always
the package and set a fine then like test the tasty prints, the error message and stops program execution.
If we are not equals to need, so call fatal function from like package but a function and sets a message
like failed to create a fine person s and set our message.
The author is used for purpose of clean up like closing running fine after the fine has been written
and main function has completed execution.
So right, write the author finds that close.
Now read the text and defined by Connie write a string function.
This function will return to values for the example in variable chapters.
The length of this and written to define and error variable.
So define two variable like Len and E are calling equals call write issing function from Phi Phi Dart,
write a string function and set a value like hello.
And then from.
To practice medicine,
go.
Programming
language.
Prince, the error message and the staff's program execution is a road not equals need.
So go to what is statement of if and right message from on Earth of light package Lord God, Father
Earth and sit in the sage failed writing to find cursed is and said a raw message.
Now we use name function that returns the name of define as presented, created middle and display length
of the file by following codes for the example that if backslash and forehead name calling persons is.
And since he finds that name function and go to the next line if batches and lengths
persons, the bonds assets lend value.
OK, reformat the code, save the project and execute the program.
Now we can see the output first, fine test, the text we created and we can see fine main test, the
text and length is four or five bytes, so we were able to say the setup is strings inside the file
in order not to prolong the time of decision.
We'll finish it and we will continue the content in the next session.
Goodbye.