mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 18:36:41 +02:00
llm,readline: use errors.Is instead of simple == check (#3161)
This fixes some brittle, simple equality checks to use errors.Is. Since go1.13, errors.Is is the idiomatic way to check for errors. Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
parent
703684a82a
commit
6ce37e4d96
3 changed files with 4 additions and 3 deletions
|
@ -62,7 +62,7 @@ func (h *History) Init() error {
|
|||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
if errors.Is(err, io.EOF) {
|
||||
break
|
||||
}
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue