strategy/standart/default.go   A
last analyzed

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 11
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A standart.*Strategy.Write 0 3 1
A standart.Get 0 2 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