append possibly assigns to a wrong variable CRT-D0001
Bug risk
Minor
6 months agoa year old
append result not assigned to the same slice
61	if len(lines) > h.maxSize {
62		lines = lines[len(lines)-h.maxSize:]
63	}
64	h.lines = append(lines, "")65	return ioutil.WriteFile(h.path, []byte(strings.Join(h.lines, "\n")), 0600)
66}
67
append result not assigned to the same slice
57		return nil
58	}
59
60	lines := append(h.lines[:len(h.lines)-1], line)61	if len(lines) > h.maxSize {
62		lines = lines[len(lines)-h.maxSize:]
63	}