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:
Blake Mizerany
2024-03-15 07:14:12 -07:00
committed by GitHub
parent 703684a82a
commit 6ce37e4d96
3 changed files with 4 additions and 3 deletions

View File

@@ -113,7 +113,7 @@ func nativeInit() error {
libs, err := extractDynamicLibs(payloadsDir, "llama.cpp/build/*/*/*/lib/*")
if err != nil {
if err == payloadMissing {
if errors.Is(err, payloadMissing) {
slog.Info(fmt.Sprintf("%s", payloadMissing))
return nil
}