always return the expected number of bytes written
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
emptyEveryWrite was returning the wrong number, so it ignores the real value and just returns the expected value (len(bytes in)). For #4 again.
This commit is contained in:
parent
fe851278f4
commit
8340ef1f20
8
main.go
8
main.go
@ -530,7 +530,9 @@ type dataWrite struct {
|
|||||||
|
|
||||||
func (w dataWrite) Write(p []byte) (n int, err error) {
|
func (w dataWrite) Write(p []byte) (n int, err error) {
|
||||||
line := toData(&player{w.Players.mpris2.List[w.Players.mpris2.Current], true})
|
line := toData(&player{w.Players.mpris2.List[w.Players.mpris2.Current], true})
|
||||||
return w.emptyEveryWrite.Write([]byte(line))
|
_, err = w.emptyEveryWrite.Write([]byte(line))
|
||||||
|
n = len(p)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type emptyEveryWrite struct {
|
type emptyEveryWrite struct {
|
||||||
@ -542,7 +544,9 @@ func (w emptyEveryWrite) Write(p []byte) (n int, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
return w.file.WriteAt(p, offset)
|
_, err = w.file.WriteAt(p, offset)
|
||||||
|
n = len(p)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user