Documentation ¶
Overview ¶
Package sanejoin implements Join() like filepath.Join(), except when later arguments are absolute, in which case it wipes the previous path components. (Behaves like python os.path.join().)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Join ¶
Join joins path elements, but will allow absolute paths to wipe previous arguments.
input | filepath | sanejoin | different --------------+--------------+----------+----------- "a", "b" | "a/b" | "a/b" | "a/b", "../c" | "a/c" | "a/c" | "a/b", "/c" | "a/b/c" | "/c" | yes --------------+--------------+----------+-----------
Example ¶
fmt.Println("On Unix:") fmt.Println(Join("a", "b", "c")) // expected: a/b/c
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.