serializer.New   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nop 0
dl 0
loc 6
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
package serializer
2
3
type Serializer interface {
4
	Serialize(data interface{}, format string) ([]byte, error)
5
}
6
7
func New() Serializer {
8 1
	return &coordinatingSerializer{
9
		formatSerializers: map[string]Serializer{
10
			"raw":  &rawSerializer{},
11
			"json": &jsonSerializer{},
12
			"xml":  &xmlSerializer{rootTag: "root"},
13
		},
14
	}
15
}
16