What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Artificial Amateur\AppData\Local\go-build
set GOENV=C:\Users\Artificial Amateur\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Artificial Amateur\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Artificial Amateur\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=Z:\go-netstat\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ARTIFI~1\AppData\Local\Temp\go-b
uild667920362=/tmp/go-build -gno-record-gcc-switches
What did you do?
Ran windows syscall of GetAdaptersAddresses and printed the value of IpAdapterAddresses.FirstUnicastAddress.Address.Sockaddr.Addr.Data
What did you expect to see?
[0 0 172 16 19 129 0 0 0 0 0 0 0 0]
What did you see instead?
[0 0 -84 16 19 -127 0 0 0 0 0 0 0 0]
This is a minor issue with a simple change of making the Data field of type uint8 or byte.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It should as it's still written as is here.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran windows syscall of
GetAdaptersAddresses
and printed the value ofIpAdapterAddresses.FirstUnicastAddress.Address.Sockaddr.Addr.Data
What did you expect to see?
[0 0 172 16 19 129 0 0 0 0 0 0 0 0]
What did you see instead?
[0 0 -84 16 19 -127 0 0 0 0 0 0 0 0]
This is a minor issue with a simple change of making the
Data
field of typeuint8
orbyte
.