pkg/sftp — pull request #11 by streadway (2014-06-11 19:52:08+00:00)
Title: Implement io.Seeker for *sftp.File

This PR intends to enable parallel loads from different byte ranges over multiple connections in order compensate for 32K maximum read size over higher latency links.

It tests that reads at the seeked offset of `sftp.File` are consistent with the reads of offset of `os.File` for the same file.

Error conditions and undefined seeks are not tested.

Open:

* `readAtTests` table - removed because they were no longer referenced. I guessed you wanted to implement the io.ReadAt interface but hit a snag at the concurrent safe read constraint.
* `testing/quick` - ensuring the same read properties between `sftp` and `os` felt like a natural fit. It's an intrusive change to the integration tests and can be converted easily to a table driven test if needed.
* seek/write/read - I didn't come up with a satisfactory way of comparing the write properties of `os.File` and `sftp.File`. This is open for discussion, or writes can lean on the read tests for correctness of writes since they share the same `offset`.
* `unimplementedSeekWhence` - this was added in lieu of a panic or an implementation of `error`.

I'm happy to iterate on any suggestions to improve this PR.