Quick actions

cmd+k|ctrl+k

Navigation

Languages

Working with files and I/O / File path operations / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T10:15:40Z

Updated

2019-03-26T10:15:40Z

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