Skip to content

Commit 1523bb4

Browse files
committed
internal/lsp: fix time.Duration hover name check
Change-Id: I30a0e9848e5578b66628e055f6125d2a352dc6d5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/300189 Trust: Rebecca Stambler <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
1 parent bcb2d7b commit 1523bb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/lsp/source/hover.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func objectString(obj types.Object, qf types.Qualifier) string {
241241
break
242242
}
243243
pkg := typ.Obj().Pkg()
244-
if pkg.Path() == "time" && pkg.Scope().Lookup("Duration") != nil {
244+
if pkg.Path() == "time" && typ.Obj().Name() == "Duration" {
245245
if d, ok := constant.Int64Val(obj.Val()); ok {
246246
str += " // " + time.Duration(d).String()
247247
}

0 commit comments

Comments
 (0)