Reader and writer a low level, if you need to use them then go here to watch the lecture on these or look in the readers demo or exercises in the ztm directory
Here I’ll leave some reference for using the bufio package which makes reading and writing much easier
// bufio new readerreader := strings.NewReader("SAMPLE")buffered := bufio.NewReader(reader)newString, err := buffered.ReadString('\n') // reads into newstring up to \nif err == io.EOF { fmt.Println(newString)} else { fmt.Println("Something went wrong when reading")}// bufio new scannerscan := bufio.NewScanner(os.Stdin)lines := make([]string, 0, 5)for scan.Scan() { lines = append(lines, scan.Text())}if scanner.Err() != nil { // error with scanner}for _, line := range lines { fmt.Println(line)}