Skip to content

Commit f384392

Browse files
committed
Group path implementation together
1 parent 0b557cf commit f384392

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

ox.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,6 @@ var (
250250
// DefaultRateUnit is the default [Rate] unit used to display the rate, if
251251
// none is specified or when precision is negative.
252252
DefaultRateUnit = time.Second
253-
// DefaultMaxPathLinks are the max symlinks to follow in [Path].
254-
DefaultMaxPathLinks = 16
255-
// DefaultGetwd is the func used to read the working directory by [Path].
256-
// Normally [os.Getwd].
257-
DefaultGetwd = os.Getwd
258-
// DefaultLstat is the func used to lstat a path by [Path]. Normally
259-
// [os.Lstat].
260-
DefaultLstat = os.Lstat
261-
// DefaultReadlink is the func used to read a link by [Path]. Normally
262-
// [os.Readlink].
263-
DefaultReadlink = os.Readlink
264253
)
265254

266255
// RunContext creates a [Context] and builds a execution [Context] and root

path.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ import (
66
"path/filepath"
77
)
88

9+
var (
10+
// DefaultMaxPathLinks are the max symlinks to follow in [Path].
11+
DefaultMaxPathLinks = 16
12+
// DefaultGetwd is the func used to read the working directory by [Path].
13+
// Normally [os.Getwd].
14+
DefaultGetwd = os.Getwd
15+
// DefaultLstat is the func used to lstat a path by [Path]. Normally
16+
// [os.Lstat].
17+
DefaultLstat = os.Lstat
18+
// DefaultReadlink is the func used to read a link by [Path]. Normally
19+
// [os.Readlink].
20+
DefaultReadlink = os.Readlink
21+
)
22+
923
// Path resolves a path to a fully qualified ("real") path on disk.
1024
func Path(path string) (string, error) {
1125
switch {

0 commit comments

Comments
 (0)