在golang中,reflect包,8g错误“undefined: reflect.NewValue”

huangapple go评论75阅读模式
英文:

in golang, reflect pkg, 8g error "undefined: reflect.NewValue"

问题

对于reflect包有点困惑

所有的例子都使用reflect.NewValue()来获取变量的reflect.Value,但是

  • func NewValue在http://golang.org/pkg/reflect/中没有记录

  • 8g编译器返回“undefined: reflect.NewValue”

NewValue()还被支持吗?如果不支持,如何从变量中获取reflect.Value


Typeof和NewValue函数已被重命名为TypeOf和ValueOf。

英文:

little confused with reflect pkg

all of the examples us reflect.NewValue() to get the reflect.Value of a var, but

is NewValue() still supported? if not, how does one get reflect.Value from a var?

<hr />

the Typeof and NewValue functions have been renamed to TypeOf and ValueOf.

答案1

得分: 0

Go reflect packageweekly.2011-04-13 及之后的版本中进行了重大修订。详细信息请参见 revision 843855f3c026

英文:

The Go reflect package was substantially revised for the weekly.2011-04-13 and subsequent releases. For details, see revision 843855f3c026.

huangapple
  • 本文由 发表于 2011年6月17日 19:04:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/6384824.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定