func getSizeInLinesFromFile(file string) int {
	f, err := os.Open(file)
	defer f.Close()
	res := 0
	if err != nil {
		return res
	}
	scanner := bufio.NewScanner(f)
	for scanner.Scan() {
		res++
	}
	return res
}
Get amount of lines of file
package grafsy
import (
	"bufio"
	"os"
)
type metricData struct {
	value  float64
	amount int64
}
func readMetricsFromFile(file string) ([]string, error) {
	var resultsList []string
	f, err := os.OpenFile(file, os.O_RDONLY, os.ModePerm)
	if err != nil {
		return resultsList, err
	}
	defer os.Remove(file)
	scanner := bufio.NewScanner(f)
	for scanner.Scan() {
		resultsList = append(resultsList, scanner.Text())
	}
	return resultsList, f.Close()
}