(s string)
| 86 | } |
| 87 | |
| 88 | func (d *dumpState) writeString(s string) { |
| 89 | ba := []byte(s) |
| 90 | size := len(s) |
| 91 | if size > 0 { |
| 92 | size++ //accounts for 0 byte at the end |
| 93 | } |
| 94 | switch header.PointerSize { |
| 95 | case 8: |
| 96 | d.write(uint64(size)) |
| 97 | case 4: |
| 98 | d.write(uint32(size)) |
| 99 | default: |
| 100 | panic(fmt.Sprintf("unsupported pointer size (%d)", header.PointerSize)) |
| 101 | } |
| 102 | if size > 0 { |
| 103 | d.write(ba) |
| 104 | d.writeByte(0) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func (d *dumpState) writeLocalVariables(p *prototype) { |
| 109 | d.writeInt(len(p.localVariables)) |
no test coverage detected