从os.Args [1]读取时,golang文件名过长错误

I'm new to golang and using ioutil.ReadFile(os.Args[1]) to fetch a file path from the cli and then processing each line using:

package main

import (
    "bufio"
    "fmt"
    "log"
    "os"
)

func main()  {

    file, err := os.Open(os.Args[1])
    if err != nil {
        log.Fatal(err)
    }
    defer file.Close()

    scanner := bufio.NewScanner(file)
    for scanner.Scan() {
        fmt.Println(scanner.Text())
    }

    if err := scanner.Err(); err != nil {
        log.Fatal(err)
    }
}

Now I can get the output at stdout. But also get the following ERROR in the end:

msg:"BRUMBRUM";reference:cve,CVE-2007-2810;reference:blah;
msg:"WAKANDA";reference:cve,CVE-2007-2810;reference:blah; file name too long
exit status 1

My file path input is data/srulz.tcl . FYI, the error message is not a part of the text file.

I need to know where is this going wrong here and how can this be improved?

UPDATE:

Provided issue reproducible code.

Go-ing with flag pkg for now until this mystery is solved

In the first line, filePath, err := ioutil.ReadFile(os.Args[1])

Above step will read the whole file contents and return slice of byte and error. filePath variable will not store the file path instead its storing the content of file in bytes. I am wondering why are you not getting compile time error as filepath variable is slice of bytes whereas os.Open(filepath) the argument to os.Open will be string.