The other day I was messing around with go-audio/wav which expects an io.WriteSeeker. Unwilling to use an os.File and an unfruitful attempt to use mattetti/filebuffer I ended up implementing the io.WriteSeeker interface on a slice: corticph/slicewriteseek Feedback welcome!
评论:
jrwren:
glaslos:Its fine, but pointless as bytes.Buffer is in the standard library.
jrwren:bytes.Buffer does not implement io.WriteSeeker
nhooyr:TIL.
glaslos:
Thanks for the link. The issue references https://github.com/orcaman/writerseeker which is very similar to my implementation except the Read() method doesn't update the position.
