Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(694)

Unified Diff: src/pkg/net/dnsmsg.go

Issue 4301043: update tree for reflect changes (Closed)
Patch Set: diff -r f692a5e90f6f https://go.googlecode.com/hg/ Created 13 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/json/encode.go ('k') | src/pkg/netchan/export.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/net/dnsmsg.go
===================================================================
--- a/src/pkg/net/dnsmsg.go
+++ b/src/pkg/net/dnsmsg.go
@@ -380,7 +380,7 @@
// and other (often anonymous) structs.
func packStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int, ok bool) {
for i := 0; i < val.NumField(); i++ {
- f := val.Type().(*reflect.StructType).Field(i)
+ f := val.Type().Field(i)
switch fv := val.Field(i).(type) {
default:
BadType:
@@ -451,7 +451,7 @@
// Same restrictions as packStructValue.
func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int, ok bool) {
for i := 0; i < val.NumField(); i++ {
- f := val.Type().(*reflect.StructType).Field(i)
+ f := val.Type().Field(i)
switch fv := val.Field(i).(type) {
default:
BadType:
@@ -523,7 +523,7 @@
if i > 0 {
s += ", "
}
- f := val.Type().(*reflect.StructType).Field(i)
+ f := val.Type().Field(i)
if !f.Anonymous {
s += f.Name + "="
}
« no previous file with comments | « src/pkg/json/encode.go ('k') | src/pkg/netchan/export.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b