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-26T09:42:41Z

Updated

2019-03-26T09:42:41Z

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