![]() ![]() bufio.NewReader(os.Stdin) : This method returns a new Reader whose buffer has the default size(4096 bytes).The argument passed to panic() will be printed when the program terminates. ![]() Panicln is equivalent to Println() followed by a call to panic(). log.Panicf : Panic is just like an exception that may arise at runtime.It is equivalent to Printf() followed by a call to os.Exit(1). log.Fatalf : Fatalf will cause the program to terminate after printing the log message.The WriteFile() method takes in 3 different parameters, the first is the location of the file we wish to write to, the second is the data object, and the third is the FileMode, which represents the file’s mode and permission bits. ioutil.WriteFile() : The ioutil.WriteFile() is used to write data to a file.This method returns either the data of the file or an error. ioutil.ReadFile() : The ioutil.ReadFile() method takes the path to the file to be read as it’s the only parameter.If a file with the same name already exists, then the create function truncates the file. os.Create() : The os.Create() method is used to creates a file with the desired name.The bufio module implements buffered I/O which helps to improve the CPU performance. The os module provides the ability to access native operating-system features. It defines a type, Logger, with methods for formatting the output. The log module implements simple logging package. The fmt module implements formatted I/O with functions to read input from the stdin and print output to the stdout. The io/ioutil module is also used to write content to the file. In order to read from files on the local system, the io/ioutil module is put to use. Golang offers a vast inbuilt library that can be used to perform read and write operations on files. ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.DevOps Engineering - Planning to Production.Python Backend Development with Django(Live).Android App Development with Kotlin(Live).Full Stack Development with React & Node JS(Live). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |