Hello and welcome to the golden programming language course in the previous session, we talked about
how to read and write a following and go line and indecision.
We want to talk about the other fines and directories concept.
How to delete or remove the file and the folder and go blank in the go language, you're allowed to
remove the existing file and folder with the help of the remove function.
This method removes the specified font from the director, or it also removes empty directories.
If the given pass is incorrect, then it will through and the roar of time pass through, it is defined
under the Otis package.
So you have to import or is packaging your program for accessing premium function.
Now you can see the syntax.
Let's go to this school program to illustrate how to remove, file and folder from the default directory.
First, firstly, create the file named test that takes the encoded directory, test the T60 and create
a folder named tent in common directory.
OK.
The file and folder are created now, go to main function to remove the created file and folder.
First, removing file from the current directory using renal function of oboist package.
Remove function.
Get defined name as arguement and remove the name fine.
If there is an error, it will be off time past or so.
First, define a variable like find a roll call and equals invoke remove function from OS package.
Go to remove and said Test the this argument test T60.
Now we take the printed message if the error is not, and so is file or not equal to need.
So the message log got cleaned and set fire at all.
OK, now removing folder from the current directory using remove function of OS package.
So define another variable like folder or call an equals and remove function from this package.
And said folder name 10.
Now we check to print a message if the arrow is not empty folder or not equal mean.
So set the error message call in from like high case
and set folder or reformat the code, save the project and execute the program.
Now we can see the output first, we created the fund named Test to expand the folder name tent in the
current pass and then using the remote function from the office package, and we were able to delete
the created finance folder.
Now we can go to the current directory and see the finance folders by the comment.
The IRR.
Now we can see by name, the text and folder team does not exist here.
In order not to pronounce the time of decision, we will finish it and we will continue the content
in the next session.
Goodbye.