From 7aff61a58aab2d3d269ec89f64a3ff061d7f1093 Mon Sep 17 00:00:00 2001 From: Hariom Verma Date: Sat, 20 Jan 2024 20:58:59 +0530 Subject: [PATCH] Ignore error if failed to update cache --- internal/lsp/cache.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/lsp/cache.go b/internal/lsp/cache.go index d255345..29e11d2 100644 --- a/internal/lsp/cache.go +++ b/internal/lsp/cache.go @@ -30,8 +30,7 @@ func NewCache() *Cache { func (s *server) UpdateCache(pkgPath string) { pkg, err := PackageFromDir(pkgPath, false) - if err != nil { - panic(err) + if err == nil { + s.cache.pkgs.Set(pkgPath, pkg) } - s.cache.pkgs.Set(pkgPath, pkg) }