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")
file := filepath.Base(path)
fmt.Printf("path: %s, file: %s\n", path, file)
}INFO