Skip to content

Commit

Permalink
remove redundant error returns
Browse files Browse the repository at this point in the history
  • Loading branch information
mcy committed Jan 22, 2025
1 parent ba90fa1 commit 1d03bfd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions experimental/report/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,24 @@ func (w *writer) Write(data []byte) (int, error) {
return len(data), nil
}

func (w *writer) WriteByte(b byte) error {
func (w *writer) WriteByte(b byte) {

Check failure on line 39 in experimental/report/writer.go

View workflow job for this annotation

GitHub Actions / ci (1.23.x)

method WriteByte(b byte) should have signature WriteByte(byte) error
w.WriteString(string(b))
return nil
}

func (w *writer) WriteBytes(b byte, n int) error {
func (w *writer) WriteBytes(b byte, n int) {
for i := 0; i < n; i++ {
w.buf = append(w.buf, b)
}
return nil
}

func (w *writer) WriteString(data string) error {
func (w *writer) WriteString(data string) {
// Break the input along newlines; each time we're about to append a
// newline, discard all trailing whitespace that isn't a newline.
for {
nl := strings.IndexByte(data, '\n')
if nl < 0 {
w.buf = append(w.buf, data...)
return nil
return
}

line := data[:nl]
Expand Down

0 comments on commit 1d03bfd

Please sign in to comment.