Showing 2 of 6 files from the diff.

@@ -229,7 +229,7 @@
Loading
229 229
			}
230 230
		}
231 231
		if er != nil {
232 -
			if errors.Is(er, io.EOF) {
232 +
			if !errors.Is(er, io.EOF) {
233 233
				err = er
234 234
				log.Errf("copy: %+v -> %+v read error: %v", src, dst, er)
235 235
			}
@@ -472,3 +472,21 @@
Loading
472 472
	}
473 473
	return nil
474 474
}
475 +
476 +
// EscapeBytes returns printable string. Same as %q format without the
477 +
// surrounding/extra "".
478 +
func EscapeBytes(buf []byte) string {
479 +
	e := fmt.Sprintf("%q", buf)
480 +
	return e[1 : len(e)-1]
481 +
}
482 +
483 +
// DebugSummary returns a string with the size and escaped first max/2 and
484 +
// last max/2 bytes of a buffer (or the whole escaped buffer if small enough).
485 +
func DebugSummary(buf []byte, max int) string {
486 +
	l := len(buf)
487 +
	if l <= max+3 { // no point in shortening to add ... if we could return those 3
488 +
		return EscapeBytes(buf)
489 +
	}
490 +
	max /= 2
491 +
	return fmt.Sprintf("%d: %s...%s", l, EscapeBytes(buf[:max]), EscapeBytes(buf[l-max:]))
492 +
}

@@ -17,7 +17,6 @@
Loading
17 17
import (
18 18
	"encoding/base64"
19 19
	"flag"
20 -
	"fmt"
21 20
	"html/template"
22 21
	"io"
23 22
	"math/rand"
@@ -182,22 +181,11 @@
Loading
182 181
	}
183 182
}
184 183
185 -
// EscapeBytes returns printable string. Same as %q format without the
186 -
// surrounding/extra "".
187 -
func EscapeBytes(buf []byte) string {
188 -
	e := fmt.Sprintf("%q", buf)
189 -
	return e[1 : len(e)-1]
190 -
}
191 -
192 184
// DebugSummary returns a string with the size and escaped first max/2 and
193 185
// last max/2 bytes of a buffer (or the whole escaped buffer if small enough).
194 186
func DebugSummary(buf []byte, max int) string {
195 -
	l := len(buf)
196 -
	if l <= max+3 { // no point in shortening to add ... if we could return those 3
197 -
		return EscapeBytes(buf)
198 -
	}
199 -
	max /= 2
200 -
	return fmt.Sprintf("%d: %s...%s", l, EscapeBytes(buf[:max]), EscapeBytes(buf[l-max:]))
187 +
	// moved to fnet package
188 +
	return fnet.DebugSummary(buf, max)
201 189
}
202 190
203 191
// -- server utils
Files Coverage
dflag 82.2%
fgrpc 88.1%
fhttp 84.6%
fnet/network.go 86.9%
log/logger.go 86.7%
periodic/periodic.go 96.9%
stats/stats.go 96.5%
tcprunner/tcprunner.go 70.2%
Project Totals (25 files) 86.4%
1
coverage:
2
  range: 60..99
3
  precision: 1         # how many decimal places to display in the UI: 0 <= value <= 4
4
  round: nearest       # how coverage is rounded: down/up/nearest
5
  ignore:              # files and folders that will be removed during processing
6
    - "**.pb.go"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading