Working with files and I/O / File path operations / Essential Go
package main
import (
"fmt"
"path/filepath"
)
func main() {
path := filepath.Join("dir", "file.txt")
dir, file := filepath.Split(path)
fmt.Printf("dir: %s, file: %s\n", dir, file)
}INFO