I have to write a simple program in go which takes some words separated from (,.: /n )and stores these words in a slice, from keyboard or command line or a .txt/xlsx/docx file (one program for each kind of input). Here on SO I have found these solutions:
How to fill a slice with scan values Reading a file line by line in Go How to read/write from/to a file using Go
But I'd like to know if there are some easier/most efficient ways to do this, especially without having to return all these nil values. And I have the same problem with files. What is the most efficient/clean way to do this? Thanks for your help.