You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kyle@eros-ubuntu-vm /tmp/go $ go version
go version go1.6 linux/amd64
kyle@eros-ubuntu-vm /tmp/go $ go test -test.v .
=== RUN TestReflect
--- PASS: TestReflect (0.00s)
reflect_test.go:25: Field(0) ("Exported").PkgPath = "" [OK]
reflect_test.go:25: Field(1) ("unexported").PkgPath = "_/tmp/go" [OK]
PASS
ok _/tmp/go 0.002s
(notice that the unexported field has a non-zero PkgPath)
Here is the behavior at tip:
kyle@eros-ubuntu-vm /tmp/go $ ~/gotip/bin/go version
go version devel +897dcdb Wed Mar 30 06:56:25 2016 +0000 linux/amd64
kyle@eros-ubuntu-vm /tmp/go $ ~/gotip/bin/go test -test.v .
=== RUN TestReflect
--- FAIL: TestReflect (0.00s)
reflect_test.go:25: Field(0) ("Exported").PkgPath = "" [OK]
reflect_test.go:23: Field(1) ("unexported").PkgPath = "", want "_/tmp/go"
FAIL
exit status 1
FAIL _/tmp/go 0.001s
(notice that the unexported field has a zero PkgPath)
It works fine for named structs even at tip. So far a quick skim of the changes to the reflect library didn't turn up any likely suspects, though there are quite a number of them.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
[reflect] StructField.PkgPath is not correctly set for unnamed struct fields
cmd/compile, reflect: StructField.PkgPath is not correctly set for unnamed struct fields
Mar 30, 2016
In FreeBSD when run Go proc under a given sub-list of processors(e.g. 'cpuset -l 0 ./goutil' in multicore system),
runtime.NumCPU() still return all actived CPUs instead of the number of sub-list.
Fix by use syscall cpuset_getaffinity to account the number of sub-list.
Fixesgolang#15026
Tested on:
FreeBSD amd64 10/11/12
FreeBSD i386 10/11/12
FreeBSD arm 10/11/12
This is inspired by golang@4f308ed
(runtime: use sched_getaffinity for runtime.NumCPU() on Linux)
go version
)?go version devel +897dcdb Wed Mar 30 06:56:25 2016 +0000 linux/amd64
go env
)?linux/amd64
This is a regression at tip. Here is a short repro:
Here is the behavior at head:
(notice that the unexported field has a non-zero PkgPath)
Here is the behavior at tip:
(notice that the unexported field has a zero PkgPath)
It works fine for named structs even at tip. So far a quick skim of the changes to the reflect library didn't turn up any likely suspects, though there are quite a number of them.
The text was updated successfully, but these errors were encountered: