pkg / sftp

SFTP support for the go.crypto/ssh package
BSD 2-Clause "Simplified" License
1.49k stars 379 forks source link

Should Seek() io.SeekStart and io.SeekCurrent do the different things? #562

Closed pgalbavy-itrs closed 8 months ago

pgalbavy-itrs commented 8 months ago

In Seek() the switch does the same for both io.SeekCurrent and io.SeekStart,

https://github.com/pkg/sftp/blob/669003cef43b4ef0da0894493b012ba9c3d7e313/client.go#L1897C2-L1900C21

Not sure this is right. I have been staring at code for too long to get my head around this right now, but having issues with the offset returned from a remote seek this is the only cause I can think of.

pgalbavy-itrs commented 8 months ago

Ignore me, I was mixing C (auto-drop though) and Go, where a case is not fallthough by default.