mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-05 18:57:30 +03:00
20 lines
300 B
Go
20 lines
300 B
Go
package sudoku
|
|
|
|
import "io"
|
|
|
|
func writeAllChunks(w io.Writer, chunks ...[]byte) error {
|
|
for _, chunk := range chunks {
|
|
for len(chunk) > 0 {
|
|
n, err := w.Write(chunk)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if n == 0 {
|
|
return io.ErrShortWrite
|
|
}
|
|
chunk = chunk[n:]
|
|
}
|
|
}
|
|
return nil
|
|
}
|