mirror of
https://github.com/golang/go.git
synced 2025-11-07 20:21:01 +00:00
clean up the code, flow errors out to decoder.
R=rsc DELTA=99 (32 added, 22 deleted, 45 changed) OCL=31759 CL=31759
This commit is contained in:
parent
1737157189
commit
be2cf952a8
4 changed files with 71 additions and 61 deletions
|
|
@ -372,7 +372,7 @@ func encOpFor(rt reflect.Type) (encOp, int) {
|
|||
}
|
||||
}
|
||||
if op == nil {
|
||||
panicln("encode can't handle type", rt.String());
|
||||
panicln("can't happen: encode type", rt.String());
|
||||
}
|
||||
return op, indir
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ func encOpFor(rt reflect.Type) (encOp, int) {
|
|||
func compileEnc(rt reflect.Type) *encEngine {
|
||||
srt, ok := rt.(*reflect.StructType);
|
||||
if !ok {
|
||||
panicln("TODO: can't handle non-structs");
|
||||
panicln("can't happen: non-struct");
|
||||
}
|
||||
engine := new(encEngine);
|
||||
engine.instr = make([]encInstr, srt.NumField()+1); // +1 for terminator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue