Categories
How to output the required line from the file?
There is a txt file, and the line number in the file is also known. How to output a string by its number?
Answer the question
In order to leave comments, you need to log in
Are you lazy to google?
configFile, err := ioutil.ReadFile("./config") if err != nil { log.Fatal(err) } configLines := strings.Split(string(configFile), "\n")
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question