aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/pierrec/lz4/lz4_go1.10.go
blob: 9a0fb00709d569ae3475c264feef1fd9109eaf26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//+build go1.10

package lz4

import (
	"fmt"
	"strings"
)

func (h Header) String() string {
	var s strings.Builder

	s.WriteString(fmt.Sprintf("%T{", h))
	if h.BlockChecksum {
		s.WriteString("BlockChecksum: true ")
	}
	if h.NoChecksum {
		s.WriteString("NoChecksum: true ")
	}
	if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 {
		s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs))
	}
	if l := h.CompressionLevel; l != 0 {
		s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l))
	}
	s.WriteByte('}')

	return s.String()
}