mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
We already provide ByteSliceFromString and BytePtrFromString, and on Windows we provide UTF16FromString, UTF16PtrFromString, UTF16ToString, and UTF16PtrToString. So this commit fills in the remaining two Byte-oriented functions: ByteSliceToString and BytePtrToString. Since the existing two are available on windows, unix, and plan9, we add the remaining two to the same places. This helps eliminate unsafe pointer options in addition to triggering checkptr in Go 1.15, by eliminating the use of prior idioms for these types of casts. Change-Id: I85ae49f2756e142c2462fe8b2428216b6992e089 Reviewed-on: https://go-review.googlesource.com/c/sys/+/263757 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Brad Fitzpatrick <bradfitz@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com>