go/src/internal
Damien Neil e596e88318 path/filepath: add Localize
Add the Localize function, which takes an io/fs slash-separated path
and returns an operating system path.

Localize returns an error if the path cannot be represented on
the current platform.

Replace internal/safefile.FromFS with Localize,
which serves the same purpose as this function.

The internal/safefile package remains separate from path/filepath
to avoid a dependency cycle with the os package.

Fixes #57151

Change-Id: I75c88047ddea17808276761da07bf79172c4f6fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/531677
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-02-26 18:08:14 +00:00
..
abi cmd/compile/internal/reflectdata,reflect: merge MaxPtrmaskBytes const into internal/abi 2024-02-20 16:10:05 +00:00
asan internal/asan: add new package 2024-02-13 20:39:58 +00:00
bisect
buildcfg cmd: remove support for GOROOT_FINAL 2024-02-21 22:16:54 +00:00
bytealg strings: make use of sizeclasses in (*Builder).Grow 2024-02-19 19:51:15 +00:00
cfg
chacha8rand
coverage runtime: migrate internal/syscall to internal/runtime 2024-02-21 21:28:32 +00:00
cpu
dag
diff
fmtsort
fuzz
goarch
godebug
godebugs Revert "os: make FindProcess use pidfd on Linux" 2024-02-23 18:29:45 +00:00
goexperiment
goos
goroot internal/goroot: in IsStandardPackage check for go source files 2024-02-08 18:16:28 +00:00
gover
goversion
intern
itoa
lazyregexp
lazytemplate
msan internal/msan: add new package 2024-02-20 20:50:21 +00:00
nettrace
obscuretestdata
oserror
pkgbits
platform
poll internal/poll: revise the determination about [handled] and improve the code readability for SendFile 2024-02-23 05:06:03 +00:00
profile internal/pprof: remove unused code 2024-02-08 17:57:40 +00:00
race
reflectlite
runtime/syscall runtime: migrate internal/syscall to internal/runtime 2024-02-21 21:28:32 +00:00
safefilepath path/filepath: add Localize 2024-02-26 18:08:14 +00:00
saferio
singleflight
syscall Revert "os: make use of pidfd on linux" 2024-02-23 18:31:19 +00:00
sysinfo
testenv cmd: remove support for GOROOT_FINAL 2024-02-21 22:16:54 +00:00
testlog
testpty
trace internal/trace/v2: make readBatch param more permissive 2024-02-22 22:21:26 +00:00
txtar
types go/types, types2: handle Alias types in substitution 2024-02-21 21:26:51 +00:00
unsafeheader
xcoff internal/xcoff: change zeroReaderAt to nobitsSectionReader for .bss with all 0s 2024-02-12 14:42:29 +00:00
zstd