Join
Overview
Join joins path segments (path.join).
If you are coming from Node.js, the closest pattern is path.join(...).
Signature
go
func Join(elem ...string) stringCompare: Node.js · Standard Go · gox
js
path.join('a', 'b', 'c');go
filepath.Join("a", "b", "c")go
import "github.com/sahilkhaire/gox/path"
p := path.Join("a", "b", "c")Example
go
import "github.com/sahilkhaire/gox/path"
p := path.Join("a", "b", "c")Tips
Uses OS-specific separators via filepath underneath.
Standard library alternative
Use the standard library directly:
go
filepath.Join("a", "b", "c")