Commits

Anonymous committed 0d708f1 Draft

bug fix

R=rsc
OCL=32563
CL=32563

Comments (0)

Files changed (1)

src/pkg/template/template.go

 	if s == "@" {
 		return st.data
 	}
-	data := reflect.Indirect(st.data);
+	data := st.data;
 	elems := strings.Split(s, ".", 0);
 	for i := 0; i < len(elems); i++ {
 		// Look up field; data must be a struct.
+		data = reflect.Indirect(data);
 		typ, ok := data.Type().(*reflect.StructType);
 		if !ok {
 			return nil
 		if !ok {
 			return nil
 		}
-		data = reflect.Indirect(data.(*reflect.StructValue).Field(field.Index));
+		data = data.(*reflect.StructValue).Field(field.Index);
 	}
 	return data
 }