unix: remove duplicate comment regarding sockaddr conversions

Change-Id: Ib916857732274ec4a7e425a9038b8435bccd5d9a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/248779
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
Matt Layher
2020-08-17 11:45:17 -04:00
parent cc1be6b9e0
commit 9781c653f4

View File

@@ -576,15 +576,10 @@ func sockaddrL2TPIP6ToAny(in RawSockaddrL2TPIP6) *RawSockaddrAny {
func sockaddrUnixToAny(in RawSockaddrUnix) *RawSockaddrAny {
var out RawSockaddrAny
// Explicitly copy the contents of in into out to produce the correct
// sockaddr structure, without relying on unsafe casting to a type of a
// larger size.
copy(
(*(*[SizeofSockaddrAny]byte)(unsafe.Pointer(&out)))[:],
(*(*[SizeofSockaddrUnix]byte)(unsafe.Pointer(&in)))[:],
)
return &out
}