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 all: remove newline characters after return statements 2023-12-14 17:22:18 +00:00
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 cmd/go: add GORISCV64 environment variable 2024-01-24 07:25:25 +00:00
chacha8rand math/rand, math/rand/v2: use ChaCha8 for global rand 2023-12-05 20:34:30 +00:00
coverage runtime: migrate internal/syscall to internal/runtime 2024-02-21 21:28:32 +00:00
cpu all: fix typos 2024-01-30 20:09:45 +00:00
dag
diff internal/diff: add missing 'as' in comment 2023-11-08 14:13:04 +00:00
fmtsort internal/fmtsort: makeChans pin pointer 2023-10-30 21:00:16 +00:00
fuzz all: make more use of the new atomic integer types 2023-11-17 16:39:52 +00:00
goarch
godebug runtime: add race annotations in IncNonDefault 2023-12-15 20:30:44 +00:00
godebugs Revert "os: make FindProcess use pidfd on Linux" 2024-02-23 18:29:45 +00:00
goexperiment runtime: add execution tracer v2 behind GOEXPERIMENT=exectracer2 2023-11-10 15:49:59 +00:00
goos
goroot internal/goroot: in IsStandardPackage check for go source files 2024-02-08 18:16:28 +00:00
gover go/version: add new package 2023-11-06 23:20:32 +00:00
goversion internal/goversion: update Version to 1.23 2024-01-19 19:23:40 +00:00
intern all: use built-in clear to clear maps 2023-07-27 22:07:13 +00:00
itoa internal/itoa, os: move os.uitox to itoa.Uitox 2023-08-11 02:53:50 +00:00
lazyregexp
lazytemplate
msan internal/msan: add new package 2024-02-20 20:50:21 +00:00
nettrace internal/nettrace: fix comment typo 2023-10-19 11:57:14 +00:00
obscuretestdata
oserror
pkgbits
platform cmd/dist,internal/platform,runtime: add cgo support for openbsd/riscv64 port 2024-01-25 09:19:16 +00:00
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 all: drop old +build lines 2023-10-19 23:33:27 +00:00
reflectlite internal/reflectlite: delete TODO pass safe to packEface don't need to copy if safe==true 2024-01-23 17:20:01 +00:00
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 all: rewrite internal/saferio.SliceCap using generics and add func SliceCapWithSize 2023-08-31 00:34:05 +00:00
singleflight
syscall Revert "os: make use of pidfd on linux" 2024-02-23 18:31:19 +00:00
sysinfo internal/sysinfo: print cpu type from cpuinfo when internal cpu name is empty on Linux 2023-08-17 21:40:36 +00:00
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 internal/zstd: avoid panic when windowSize is negative 2024-01-30 04:10:45 +00:00