()
| 86 | } |
| 87 | |
| 88 | func (e *ulReqEncoder) encodeShallows() stateFn { |
| 89 | plumbing.HashesSort(e.data.Shallows) |
| 90 | |
| 91 | var last plumbing.Hash |
| 92 | for _, s := range e.data.Shallows { |
| 93 | if bytes.Equal(last[:], s[:]) { |
| 94 | continue |
| 95 | } |
| 96 | |
| 97 | if err := e.pe.Encodef("shallow %s\n", s); err != nil { |
| 98 | e.err = fmt.Errorf("encoding shallow %q: %s", s, err) |
| 99 | return nil |
| 100 | } |
| 101 | |
| 102 | last = s |
| 103 | } |
| 104 | |
| 105 | return e.encodeDepth |
| 106 | } |
| 107 | |
| 108 | func (e *ulReqEncoder) encodeDepth() stateFn { |
| 109 | switch depth := e.data.Depth.(type) { |
nothing calls this directly
no test coverage detected