standart.*Strategy.Write   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
nop 1
1
////////////////////////////////////////////////////////////////////////////////
2
// Author:   Nikita Koryabkin
3
// Email:    [email protected]
4
// Telegram: https://t.me/Apologiz
5
////////////////////////////////////////////////////////////////////////////////
6
7
package standart
8
9
import (
10
	"io"
11
	"log"
12
)
13
14
// Strategy logging strategy in the console
15
type Strategy struct {
16
	_ io.Writer
17
}
18
19
// Get console write strategy
20
func Get() io.Writer {
21
	return &Strategy{}
22
}
23
24
func (s *Strategy) Write(p []byte) (n int, err error) {
25
	log.Println(string(p))
26
	return len(p), nil
27
}
28