I have code where I am calling filepath.Join
as described in the following program.
However, I see an error
Program:
package main
import (
"fmt"
"path/filepath"
)
func main() {
myVal := joinPath("dir1", "dir2")
fmt.Println(myVal)
}
func joinPath(dirs ...string) string {
return filepath.Join("mydir", dirs...)
}
Error:
./prog.go:16:32: too many arguments in call to filepath.Join have (string, []string) want (...string)
While I know this is a legitimate error, how do I join the path with a default parent directory using Join