fix: remove print in history handler

windows-fixes
TorchedSammy 2022-03-05 15:23:17 -04:00
parent 058d6ac456
commit a0dff5babf
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 4 additions and 5 deletions

View File

@ -19,12 +19,11 @@ func newFileHistory() (*fileHistory, error) {
return nil, err return nil, err
} }
} }
itms := []string{""} itms := []string{""}
lines := strings.Split(string(data), "\n") lines := strings.Split(string(data), "\n")
for i, l := range lines { for i, l := range lines {
if i == len(lines) - 1 { if i == len(lines) - 1 {
println(i, l)
continue continue
} }
itms = append(itms, l) itms = append(itms, l)
@ -33,12 +32,12 @@ func newFileHistory() (*fileHistory, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
fh := &fileHistory{ fh := &fileHistory{
items: itms, items: itms,
f: f, f: f,
} }
return fh, nil return fh, nil
} }
@ -52,7 +51,7 @@ func (h *fileHistory) Write(line string) (int, error) {
return 0, err return 0, err
} }
h.f.Sync() h.f.Sync()
h.items = append(h.items, line) h.items = append(h.items, line)
return len(h.items), nil return len(h.items), nil
} }