mirror of https://github.com/Hilbis/Hilbish
fix: remove print in history handler
parent
058d6ac456
commit
a0dff5babf
|
@ -19,12 +19,11 @@ func newFileHistory() (*fileHistory, error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
itms := []string{""}
|
||||
lines := strings.Split(string(data), "\n")
|
||||
for i, l := range lines {
|
||||
if i == len(lines) - 1 {
|
||||
println(i, l)
|
||||
continue
|
||||
}
|
||||
itms = append(itms, l)
|
||||
|
@ -33,12 +32,12 @@ func newFileHistory() (*fileHistory, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
fh := &fileHistory{
|
||||
items: itms,
|
||||
f: f,
|
||||
}
|
||||
|
||||
|
||||
return fh, nil
|
||||
}
|
||||
|
||||
|
@ -52,7 +51,7 @@ func (h *fileHistory) Write(line string) (int, error) {
|
|||
return 0, err
|
||||
}
|
||||
h.f.Sync()
|
||||
|
||||
|
||||
h.items = append(h.items, line)
|
||||
return len(h.items), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue