Open a file question - Handling error

Hi, I have a question. I tried to finish this program but the exercise asks to check if there is no command line argument. I dont have any idea how to handle this kind of error because I tried a lot of things.
The program open a file and reads every line and gives for each line the the maximum string in terms of length. If I try to do a check before opening the File the program gives me “index out of range”.

Args hold the command-line arguments, starting with the program name, so os.Args have length of 1 but in Go, arrays starts from zero, so if you specify Args[1] you will get an index out range error.
Just check len of os.Args less than 2

if len(os.Args) < 2 {