filepath.Join() Function in Golang With Examples
In Go language, path package used for paths separated by forwarding slashes, such as the paths in URLs. The filepath.Join() function in Go language used to join any number of the specified path elements into a single path, adding a Separator if necessary. This function calls Clean on the result and all empty strings are ignored. Moreover, this function is defined under the path package. Here, you need to import the “path/filepath” package in order to use these functions.
func Join(elem ...string) string
Here, ‘elem’ is the specified path elements.
Return Value: It returns the joined single path.
G/F/G G/F/G gfg/GFG Geeks/for/Geeks
/ a/b/c 5/10 .