aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2023-09-30 10:38:01 -0700
committerDamien Neil <dneil@google.com>2024-02-26 18:08:14 +0000
commite596e8831885ad057a7f1db1391fddfd53f06431 (patch)
tree0e5893682f270732c95e823e3623c49ae87d98ec /doc
parent7b583fd1a1aeda98daa5a9d485b35786c031e941 (diff)
downloadgo-e596e8831885ad057a7f1db1391fddfd53f06431.tar.gz
go-e596e8831885ad057a7f1db1391fddfd53f06431.zip
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>
Diffstat (limited to 'doc')
-rw-r--r--doc/next/6-stdlib/99-minor/path/filepath/57151.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/next/6-stdlib/99-minor/path/filepath/57151.md b/doc/next/6-stdlib/99-minor/path/filepath/57151.md
new file mode 100644
index 0000000000..67e84894fe
--- /dev/null
+++ b/doc/next/6-stdlib/99-minor/path/filepath/57151.md
@@ -0,0 +1,2 @@
+The new [`Localize`](/path/filepath#Localize) function safely converts
+a slash-separated path into an operating system path.