Skip to content

No ERROR reported when a wrong type given in function's variable argument in specified code #2785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Littlefisher619 opened this issue May 26, 2023 · 5 comments
Assignees
Labels
FrozenDueToAge gopls gopls related issues NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Littlefisher619
Copy link

Littlefisher619 commented May 26, 2023

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    go version go1.20.3 linux/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    Build info
    ----------
    golang.org/x/tools/gopls v0.11.0
        golang.org/x/tools/[email protected] h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=
        github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
        github.com/google/[email protected] h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
        github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
        golang.org/x/[email protected] h1:QfTh0HpN6hlw6D3vu8DAwC8pBIwikq0AI1evdm+FksE=
        golang.org/x/exp/[email protected] h1:fl8k2zg28yA23264d82M4dp+YlJ3ngDcpuB1bewkQi4=
        golang.org/x/[email protected] h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
        golang.org/x/[email protected] h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
        golang.org/x/[email protected] h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
        golang.org/x/[email protected] h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
        golang.org/x/[email protected] h1:7/HkGkN/2ktghBCSRRgp31wAww4syfsW52tj7yirjWk=
        golang.org/x/[email protected] h1:qptQiQwEpETwDiz85LKtChqif9xhVkAm8Nhxs0xnTww=
        honnef.co/go/[email protected] h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
        mvdan.cc/[email protected] h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
        mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
    go: go1.20.3
    
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    1.78.2
    b3e4e68a0bc097f0ae7907b217c1119af9e03435
    x64
    
  • Check your installed extensions to get the version of the VS Code Go extension
    Name: Go
    Id: golang.go
    Description: Rich Go language support for Visual Studio Code
    Version: 0.38.0
    Publisher: Go Team at Google
    VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=golang.Go
    
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    Checking configured tools....
    GOBIN: /data/go/bin
    toolsGopath: 
    gopath: /data/go
    GOROOT: /root/sdk/go1.20.3
    PATH: /root/sdk/go1.20.3/bin:/root/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/data/go/bin:/root/.local/bin
    PATH (vscode launched with): /root/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/data/go/bin:/root/.local/bin
    
        go:	/root/sdk/go1.20.3/bin/go: go version go1.20.3 linux/amd64
    
        gotests:	/data/go/bin/gotests	(version: v1.6.0 built with go: go1.20.3)
        gomodifytags:	/data/go/bin/gomodifytags	(version: v1.16.0 built with go: go1.20.3)
        impl:	/data/go/bin/impl	(version: v1.1.0 built with go: go1.20.3)
        goplay:	/data/go/bin/goplay	(version: v1.0.0 built with go: go1.20.3)
        dlv:	/data/go/bin/dlv	(version: v1.20.2 built with go: go1.20.3)
        golint:	/data/go/bin/golint	(version: v0.0.0-20210508222113-6edffad5e616 built with go: go1.20.3)
        gopls:	/data/go/bin/gopls	(version: v0.11.0 built with go: go1.20.3)
    
    go env
    Workspace Folder (bugtest): /data/devhome/bugtest
        GO111MODULE="on"
        GOARCH="amd64"
        GOBIN="/data/go/bin"
        GOCACHE="/root/.cache/go-build"
        GOENV="/root/.config/go/env"
        GOEXE=""
        GOEXPERIMENT=""
        GOFLAGS=""
        GOHOSTARCH="amd64"
        GOHOSTOS="linux"
        GOINSECURE="<private>"
        GOMODCACHE="/data/go/pkg/mod"
        GONOPROXY=""
        GONOSUMDB=""
        GOOS="linux"
        GOPATH="/data/go"
        GOPRIVATE=""
        GOPROXY="https://<private>,direct"
        GOROOT="/root/sdk/go1.20.3"
        GOSUMDB="<private>"
        GOTMPDIR=""
        GOTOOLDIR="/root/sdk/go1.20.3/pkg/tool/linux_amd64"
        GOVCS=""
        GOVERSION="go1.20.3"
        GCCGO="gccgo"
        GOAMD64="v1"
        AR="ar"
        CC="gcc"
        CXX="g++"
        CGO_ENABLED="1"
        GOMOD="/data/devhome/bugtest/go.mod"
        GOWORK=""
        CGO_CFLAGS="-O2 -g"
        CGO_CPPFLAGS=""
        CGO_CXXFLAGS="-O2 -g"
        CGO_FFLAGS="-O2 -g"
        CGO_LDFLAGS="-O2 -g"
        PKG_CONFIG="pkg-config"
        GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build203008646=/tmp/go-build -gno-record-gcc-switches"
    

Share the Go related settings you have added/edited

{
    "go.autocompleteUnimportedPackages": true,
    "go.lintTool": "golint"
}

Describe the bug

A clear and concise description of what the bug:

  • When put a mismatched type into the variable argument, there are no error shown on the editor.

A clear and concise description of what you expected to happen:

  • An error report should be shown includes a syntax error on mismatched type given in function's variable argument
  • The expected error message like this should be output: cannot use "test" (constant of type string) as MeterOption value in argument to x.(MeterProvider).Meter: string does not implement MeterOption (missing method applyMeter) with hint complier(InvalidIfaceAssign)
image

I know it is really looks odd. But it does. And I asked my friends to reproduce with my code. All of them reproduced.

Steps to reproduce the behavior:

  1. Init the environment the version info given above.
  2. Put the code to editor as main.go.
package main

import "go.opentelemetry.io/otel/metric"

type MeterProvider interface {
    Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter
}

func main() {
    var x interface{} = 1

    x.(MeterProvider).Meter("test", "bla")
                                // bug --^---
                                // error should be reported here
}
  1. Reproduced. Check your problems output in vscode. You see there are no errors.
No errors in problems

Other ways to reproduce the bug:

Other ways to reproduce
Code
package main

import "go.opentelemetry.io/otel/metric"

type MeterProvider interface {
	Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter
}
type MyProvider interface {
	Reproduce(xxx string, opts ...metric.MeterOption) metric.Meter
}
type VariableFuncInterface interface {
	Func(xxx string, opts ...int) string
}

func main() {
	var x interface{} = 1

	x.(MeterProvider).Meter("test", "test")
    x.(metric.MeterProvider).Meter("test", 123)
    x.(MyProvider).Reproduce("test", 123)
                                // bug --^---
                                // error shoud be reported here
	x.(VariableFuncInterface).Func("", "")
                                // not produced here
}

Note:

  • I reproduced this bug only when import the go.opentelemetry.io/otel/metric package. Whatever the function is, the point is that choose a variadic function and call it. For me, I tried to call Meter() func to a metric.MeterProvider and call Float64Histogram the metric.Meter. All of them can produce the bug.
  • When all the related code had copied from the source package into my project's code, the bug was not happened. Maybe I missed somewhere matters.
Code & Screenshot
Not Produced
package main

import (
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/metric"
)

type MeterProvider interface {
	Meter(instrumentationName string, opts MeterOption) metric.Meter
}

// MeterConfig contains options for Meters.
type MeterConfig struct {
	instrumentationVersion string
	schemaURL              string
	attrs                  attribute.Set

	// Ensure forward compatibility by explicitly making this not comparable.
	noCmp [0]func() //nolint: unused  // This is indeed used.
}

// InstrumentationVersion returns the version of the library providing
// instrumentation.
func (cfg MeterConfig) InstrumentationVersion() string {
	return cfg.instrumentationVersion
}

// InstrumentationAttributes returns the attributes associated with the library
// providing instrumentation.
func (cfg MeterConfig) InstrumentationAttributes() attribute.Set {
	return cfg.attrs
}

// SchemaURL is the schema_url of the library providing instrumentation.
func (cfg MeterConfig) SchemaURL() string {
	return cfg.schemaURL
}

// MeterOption is an interface for applying Meter options.
type MeterOption interface {
	// applyMeter is used to set a MeterOption value of a MeterConfig.
	applyMeter(MeterConfig) MeterConfig
}

// NewMeterConfig creates a new MeterConfig and applies
// all the given options.
func NewMeterConfig(opts ...MeterOption) MeterConfig {
	var config MeterConfig
	for _, o := range opts {
		config = o.applyMeter(config)
	}
	return config
}

type meterOptionFunc func(MeterConfig) MeterConfig

func (fn meterOptionFunc) applyMeter(cfg MeterConfig) MeterConfig {
	return fn(cfg)
}

// WithInstrumentationVersion sets the instrumentation version.
func WithInstrumentationVersion(version string) MeterOption {
	return meterOptionFunc(func(config MeterConfig) MeterConfig {
		config.instrumentationVersion = version
		return config
	})
}

// WithInstrumentationAttributes sets the instrumentation attributes.
//
// The passed attributes will be de-duplicated.
func WithInstrumentationAttributes(attr ...attribute.KeyValue) MeterOption {
	return meterOptionFunc(func(config MeterConfig) MeterConfig {
		config.attrs = attribute.NewSet(attr...)
		return config
	})
}

// WithSchemaURL sets the schema URL.
func WithSchemaURL(schemaURL string) MeterOption {
	return meterOptionFunc(func(config MeterConfig) MeterConfig {
		config.schemaURL = schemaURL
		return config
	})
}


func main() {
	var x interface{} = 1

	x.(MeterProvider).Meter("test", "test")
}

Screenshots or recordings

Simple POC
@gopherbot gopherbot added this to the Untriaged milestone May 26, 2023
@Littlefisher619
Copy link
Author

Littlefisher619 commented May 26, 2023

Logs of gopls (server)
```log [Info - 1:23:05 PM] 2023/05/26 13:23:05 go env for /data/devhome/bugtest (root /data/devhome/bugtest) (go version go version go1.20.3 linux/amd64) (valid build configuration = true) (build flags: []) GOCACHE=/root/.cache/go-build GO111MODULE=on GONOSUMDB= GOPATH=/data/go GOPRIVATE= GOSUMDB= GONOPROXY= GOROOT=/root/sdk/go1.20.3 GOPROXY= GOMOD=/data/devhome/bugtest/go.mod GOWORK= GOFLAGS= GOINSECURE= GOMODCACHE=/data/go/pkg/mod

[Info - 1:23:05 PM] 2023/05/26 13:23:05 go/packages.Load #1: updating metadata for 1 packages

[Info - 1:23:05 PM] 2023/05/26 13:23:05 go/packages.Load #1
snapshot=0
directory=file:///data/devhome/bugtest
query=[builtin example.com/bug/...]
packages=2

[Error - 1:23:05 PM] 2023/05/26 13:23:05 tidy: diagnosing file:///data/devhome/bugtest/go.mod: err: exit status 1: stderr: go: finding module for package go.opentelemetry.io/otel/metric
example.com/bug imports
go.opentelemetry.io/otel/metric: cannot find module providing package go.opentelemetry.io/otel/metric: module lookup disabled by GOPROXY=off

[Error - 1:23:05 PM] 2023/05/26 13:23:05 tidy: diagnosing file:///data/devhome/bugtest/go.mod: err: exit status 1: stderr: go: finding module for package go.opentelemetry.io/otel/metric
example.com/bug imports
go.opentelemetry.io/otel/metric: cannot find module providing package go.opentelemetry.io/otel/metric: module lookup disabled by GOPROXY=off

[Error - 1:23:05 PM] 2023/05/26 13:23:05 tidy: diagnosing file:///data/devhome/bugtest/go.mod: err: exit status 1: stderr: go: finding module for package go.opentelemetry.io/otel/metric
example.com/bug imports
go.opentelemetry.io/otel/metric: cannot find module providing package go.opentelemetry.io/otel/metric: module lookup disabled by GOPROXY=off

[Info - 1:23:18 PM] 2023/05/26 13:23:18 go/packages.Load #2
snapshot=2
directory=file:///data/devhome/bugtest
query=[builtin example.com/bug/...]
packages=2

[Info - 1:23:18 PM] 2023/05/26 13:23:18 go/packages.Load #2: updating metadata for 55 packages

[Info - 1:24:30 PM] 2023/05/26 13:24:30 background imports cache refresh starting

[Info - 1:24:30 PM] 2023/05/26 13:24:30 background refresh finished after 146.719381ms

[Info - 1:28:17 PM] 2023/05/26 13:28:17 background imports cache refresh starting

[Info - 1:28:17 PM] 2023/05/26 13:28:17 background refresh finished after 50.45597ms

[Info - 1:28:58 PM] 2023/05/26 13:28:58 background imports cache refresh starting

[Info - 1:28:58 PM] 2023/05/26 13:28:58 background refresh finished after 47.214546ms

[Info - 1:39:07 PM] 2023/05/26 13:39:07 background imports cache refresh starting

[Info - 1:39:07 PM] 2023/05/26 13:39:07 background refresh finished after 48.461615ms

[Info - 1:44:15 PM] 2023/05/26 13:44:15 background imports cache refresh starting

[Info - 1:44:15 PM] 2023/05/26 13:44:15 background refresh finished after 46.101723ms

[Info - 1:45:00 PM] 2023/05/26 13:45:00 background imports cache refresh starting

[Info - 1:45:00 PM] 2023/05/26 13:45:00 background refresh finished after 48.175514ms

[Info - 1:54:03 PM] 2023/05/26 13:54:03 background imports cache refresh starting

[Info - 1:54:03 PM] 2023/05/26 13:54:03 background refresh finished after 48.145919ms

[Info - 2:02:03 PM] 2023/05/26 14:02:03 background imports cache refresh starting

[Info - 2:02:03 PM] 2023/05/26 14:02:03 background refresh finished after 45.840085ms

[Info - 2:05:53 PM] 2023/05/26 14:05:53 background imports cache refresh starting

[Info - 2:05:53 PM] 2023/05/26 14:05:53 background refresh finished after 46.027145ms

[Error - 2:06:23 PM] 2023/05/26 14:06:23 no signature help: cannot find an enclosing function
position=8:1

[Error - 2:06:23 PM] 2023/05/26 14:06:23 imports fixes: AllImportsFixes: /data/devhome/bugtest/main.go:9:1: expected declaration, found ',' (and 1 more errors)
file="/data/devhome/bugtest/main.go"

[Error - 2:06:26 PM] 2023/05/26 14:06:26 imports fixes: AllImportsFixes: /data/devhome/bugtest/main.go:9:1: expected declaration, found metric (and 1 more errors)
file="/data/devhome/bugtest/main.go"

[Error - 2:06:26 PM] 2023/05/26 14:06:26 imports fixes: AllImportsFixes: /data/devhome/bugtest/main.go:9:1: expected declaration, found metric (and 1 more errors)
file="/data/devhome/bugtest/main.go"

[Info - 2:06:59 PM] 2023/05/26 14:06:59 background imports cache refresh starting

[Info - 2:06:59 PM] 2023/05/26 14:06:59 background refresh finished after 49.062313ms

[Info - 2:08:33 PM] 2023/05/26 14:08:33 background imports cache refresh starting

[Info - 2:08:33 PM] 2023/05/26 14:08:33 background refresh finished after 48.725928ms

[Info - 2:25:51 PM] 2023/05/26 14:25:51 background imports cache refresh starting

[Info - 2:25:51 PM] 2023/05/26 14:25:51 background refresh finished after 46.251641ms

[Info - 2:27:17 PM] 2023/05/26 14:27:17 background imports cache refresh starting

[Info - 2:27:17 PM] 2023/05/26 14:27:17 background refresh finished after 46.006942ms

[Error - 2:29:34 PM] Request textDocument/definition failed.
Message: no identifier found
Code: 0
[Error - 2:29:34 PM] Request textDocument/definition failed.
Message: no identifier found
Code: 0
[Error - 2:29:34 PM] Request textDocument/definition failed.
Message: no object found for ident MeterConfig
Code: 0
[Error - 2:29:35 PM] Request textDocument/definition failed.
Message: no identifier found
Code: 0
[Error - 2:29:35 PM] Request textDocument/definition failed.
Message: no object found for ident MeterConfig
Code: 0
[Error - 2:29:35 PM] Request textDocument/definition failed.
Message: no object found for ident MeterConfig
Code: 0
[Info - 2:29:45 PM] 2023/05/26 14:29:45 background imports cache refresh starting

[Info - 2:29:45 PM] 2023/05/26 14:29:45 background refresh finished after 44.672486ms

[Info - 2:30:26 PM] 2023/05/26 14:30:26 background imports cache refresh starting

[Info - 2:30:26 PM] 2023/05/26 14:30:26 background refresh finished after 49.93638ms

[Info - 2:30:53 PM] 2023/05/26 14:30:53 go/packages.Load #3
snapshot=76
directory=file:///data/devhome/bugtest
query=[file=/data/devhome/bugtest/main.go]
packages=1

[Info - 2:30:53 PM] 2023/05/26 14:30:53 go/packages.Load #3
snapshot=76
directory=file:///data/devhome/bugtest
package="example.com/bug"
files=[/data/devhome/bugtest/main.go]

[Info - 2:30:53 PM] 2023/05/26 14:30:53 go/packages.Load #3: updating metadata for 1 packages

[Error - 2:31:13 PM] 2023/05/26 14:31:13 imports fixes: AllImportsFixes: /data/devhome/bugtest/main.go:9:8: mixed named and unnamed parameters
file="/data/devhome/bugtest/main.go"

[Error - 2:31:14 PM] 2023/05/26 14:31:14 imports fixes: AllImportsFixes: /data/devhome/bugtest/main.go:9:8: mixed named and unnamed parameters
file="/data/devhome/bugtest/main.go"

[Info - 2:31:14 PM] 2023/05/26 14:31:14 background imports cache refresh starting

[Info - 2:31:14 PM] 2023/05/26 14:31:14 background refresh finished after 50.430987ms

[Info - 2:31:44 PM] 2023/05/26 14:31:44 background imports cache refresh starting

[Info - 2:31:44 PM] 2023/05/26 14:31:44 background refresh finished after 49.652011ms

[Info - 2:32:57 PM] 2023/05/26 14:32:57 background imports cache refresh starting

[Info - 2:32:57 PM] 2023/05/26 14:32:57 background refresh finished after 48.3669ms

[Info - 2:37:17 PM] 2023/05/26 14:37:17 background imports cache refresh starting

[Info - 2:37:17 PM] 2023/05/26 14:37:17 background refresh finished after 48.041176ms

[Info - 2:49:40 PM] 2023/05/26 14:49:40 background imports cache refresh starting

[Info - 2:49:40 PM] 2023/05/26 14:49:40 background refresh finished after 48.554291ms

</details>

@Littlefisher619
Copy link
Author

A more verbose log using the code above after restart language server:

package main

import "go.opentelemetry.io/otel/metric"

type MeterProvider interface {
	Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter
}
type MyProvider interface {
	Reproduce(xxx string, opts ...metric.MeterOption) metric.Meter
}
type VariableFuncInterface interface {
	Func(xxx string, opts ...int) string
}

func main() {
	var x interface{} = 1

	x.(MeterProvider).Meter("test", "test")
    x.(metric.MeterProvider).Meter("test", 123)
    x.(MyProvider).Reproduce("test", 123)
                                // bug --^---
                                // error shoud be reported here
	x.(VariableFuncInterface).Func("", "")
                                // not produced here
}
Log

[Info  - 3:04:51 PM] 2023/05/26 15:04:51 Shutdown session
	shutdown_session=1

[Trace - 15:04:51.099 PM] Sending notification 'exit'.
Params: 


[Trace - 15:04:51.215 PM] Sending request 'initialize - (0)'.
Params: {"processId":4182513,"clientInfo":{"name":"Visual Studio Code","version":"1.78.2"},"locale":"en","rootPath":"/data/devhome/bugtest","rootUri":"file:///data/devhome/bugtest","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["location.range"]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"didChangeConfiguration":{"dynamicRegistration":true},"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true},"inlineValue":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true},"insertTextMode":2,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode"]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true,"foldingRangeKind":{"valueSet":["comment","imports","region"]},"foldingRange":{"collapsedText":false}},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false,"serverCancelSupport":true,"augmentsSyntaxTokens":true},"linkedEditingRange":{"dynamicRegistration":true},"typeHierarchy":{"dynamicRegistration":true},"inlineValue":{"dynamicRegistration":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":false}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"},"positionEncodings":["utf-16"]},"notebookDocument":{"synchronization":{"dynamicRegistration":true,"executionSummarySupport":true}}},"initializationOptions":{"verboseOutput":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"},"trace":"off","workspaceFolders":[{"uri":"file:///data/devhome/bugtest","name":"bugtest"}]}


[Trace - 15:04:51.217 PM] Received response 'initialize - (0)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.apply_fix","gopls.check_upgrades","gopls.edit_go_directive","gopls.fetch_vulncheck_result","gopls.gc_details","gopls.generate","gopls.generate_gopls_mod","gopls.go_get_package","gopls.list_imports","gopls.list_known_packages","gopls.regenerate_cgo","gopls.remove_dependency","gopls.reset_go_mod_diagnostics","gopls.run_govulncheck","gopls.run_tests","gopls.start_debugging","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor"]},"callHierarchyProvider":true,"inlayHintProvider":{},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"},"fileOperations":{}}},"serverInfo":{"name":"gopls","version":"{\"GoVersion\":\"go1.20.3\",\"Path\":\"golang.org/x/tools/gopls\",\"Main\":{\"Path\":\"golang.org/x/tools/gopls\",\"Version\":\"v0.11.0\",\"Sum\":\"h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=\",\"Replace\":null},\"Deps\":[{\"Path\":\"github.com/BurntSushi/toml\",\"Version\":\"v1.2.1\",\"Sum\":\"h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=\",\"Replace\":null},{\"Path\":\"github.com/google/go-cmp\",\"Version\":\"v0.5.9\",\"Sum\":\"h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=\",\"Replace\":null},{\"Path\":\"github.com/sergi/go-diff\",\"Version\":\"v1.1.0\",\"Sum\":\"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\",\"Replace\":null},{\"Path\":\"golang.org/x/exp\",\"Version\":\"v0.0.0-20221031165847-c99f073a8326\",\"Sum\":\"h1:QfTh0HpN6hlw6D3vu8DAwC8pBIwikq0AI1evdm+FksE=\",\"Replace\":null},{\"Path\":\"golang.org/x/exp/typeparams\",\"Version\":\"v0.0.0-20221031165847-c99f073a8326\",\"Sum\":\"h1:fl8k2zg28yA23264d82M4dp+YlJ3ngDcpuB1bewkQi4=\",\"Replace\":null},{\"Path\":\"golang.org/x/mod\",\"Version\":\"v0.7.0\",\"Sum\":\"h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=\",\"Replace\":null},{\"Path\":\"golang.org/x/sync\",\"Version\":\"v0.1.0\",\"Sum\":\"h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=\",\"Replace\":null},{\"Path\":\"golang.org/x/sys\",\"Version\":\"v0.2.0\",\"Sum\":\"h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=\",\"Replace\":null},{\"Path\":\"golang.org/x/text\",\"Version\":\"v0.4.0\",\"Sum\":\"h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=\",\"Replace\":null},{\"Path\":\"golang.org/x/tools\",\"Version\":\"v0.3.1-0.20221213193459-ca17b2c27ca8\",\"Sum\":\"h1:7/HkGkN/2ktghBCSRRgp31wAww4syfsW52tj7yirjWk=\",\"Replace\":null},{\"Path\":\"golang.org/x/vuln\",\"Version\":\"v0.0.0-20221109205719-3af8368ee4fe\",\"Sum\":\"h1:qptQiQwEpETwDiz85LKtChqif9xhVkAm8Nhxs0xnTww=\",\"Replace\":null},{\"Path\":\"honnef.co/go/tools\",\"Version\":\"v0.3.3\",\"Sum\":\"h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=\",\"Replace\":null},{\"Path\":\"mvdan.cc/gofumpt\",\"Version\":\"v0.4.0\",\"Sum\":\"h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=\",\"Replace\":null},{\"Path\":\"mvdan.cc/xurls/v2\",\"Version\":\"v2.4.0\",\"Sum\":\"h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=\",\"Replace\":null}],\"Settings\":[{\"Key\":\"-buildmode\",\"Value\":\"exe\"},{\"Key\":\"-compiler\",\"Value\":\"gc\"},{\"Key\":\"CGO_ENABLED\",\"Value\":\"1\"},{\"Key\":\"CGO_CFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_CPPFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_CXXFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_LDFLAGS\",\"Value\":\"\"},{\"Key\":\"GOARCH\",\"Value\":\"amd64\"},{\"Key\":\"GOOS\",\"Value\":\"linux\"},{\"Key\":\"GOAMD64\",\"Value\":\"v1\"}],\"Version\":\"v0.11.0\"}"}}


[Trace - 15:04:51.218 PM] Sending notification 'initialized'.
Params: {}


[Trace - 15:04:51.218 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"7672560210552282361"}


[Trace - 15:04:51.221 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go","languageId":"go","version":1,"text":"\npackage main\n\nimport \"go.opentelemetry.io/otel/metric\"\n\ntype MeterProvider interface {\n\tMeter(instrumentationName string, opts ...metric.MeterOption) metric.Meter\n}\ntype MyProvider interface {\n\tReproduce(xxx string, opts ...metric.MeterOption) metric.Meter\n}\ntype VariableFuncInterface interface {\n\tFunc(xxx string, opts ...int) string\n}\n\nfunc main() {\n\tvar x interface{} = 1\n\n\tx.(MeterProvider).Meter(\"test\", \"test\")\n    x.(metric.MeterProvider).Meter(\"test\", 123)\n    x.(MyProvider).Reproduce(\"test\", 123)\n                                // bug --^---\n                                // error shoud be reported here\n\tx.(VariableFuncInterface).Func(\"\", \"\")\n                                // not produced here\n}\n"}}


[Trace - 15:04:51.222 PM] Sending response 'window/workDoneProgress/create - (1)' in 4ms.
Result: 


[Trace - 15:04:51.222 PM] Received notification '$/progress'.
Params: {"token":"7672560210552282361","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}


[Trace - 15:04:51.222 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///data/devhome/bugtest","section":"gopls"}]}


[Trace - 15:04:51.226 PM] Sending response 'workspace/configuration - (2)' in 4ms.
Result: [{"verboseOutput":true,"ui.inlayhint.hints":{"assignVariableTypes":false,"compositeLiteralFields":false,"compositeLiteralTypes":false,"constantValues":false,"functionTypeParameters":false,"parameterNames":false,"rangeVariableTypes":false},"ui.vulncheck":"Off"}]


[Trace - 15:04:51.242 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 go env for /data/devhome/bugtest\n(root /data/devhome/bugtest)\n(go version go version go1.20.3 linux/amd64)\n(valid build configuration = true)\n(build flags: [])\nGONOPROXY=\nGOPROXY=<private>,direct\nGOROOT=/root/sdk/go1.20.3\nGOWORK=\nGOMOD=/data/devhome/bugtest/go.mod\nGOFLAGS=\nGOINSECURE=<private>\nGOSUMDB=<private>\nGO111MODULE=on\nGOMODCACHE=/data/go/pkg/mod\nGOPRIVATE=\nGOPATH=/data/go\nGOCACHE=/root/.cache/go-build\nGONOSUMDB=\n\n"}


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 go env for /data/devhome/bugtest
(root /data/devhome/bugtest)
(go version go version go1.20.3 linux/amd64)
(valid build configuration = true)
(build flags: [])
GONOPROXY=
GOPROXY=<private>,direct
GOROOT=/root/sdk/go1.20.3
GOWORK=
GOMOD=/data/devhome/bugtest/go.mod
GOFLAGS=
GOINSECURE=<private>
GOSUMDB=<private>
GO111MODULE=on
GOMODCACHE=/data/go/pkg/mod
GOPRIVATE=
GOPATH=/data/go
GOCACHE=/root/.cache/go-build
GONOSUMDB=


[Trace - 15:04:51.243 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 4.042633ms for GOROOT= GOPATH=/data/go GO111MODULE=off GOPROXY=<private>,direct PWD=/data/devhome/bugtest go list -e -f {{context.ReleaseTags}} -- unsafe\n"}


[Trace - 15:04:51.243 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 4.234228ms for GOROOT= GOPATH=/data/go GO111MODULE=on GOPROXY=<private>,direct PWD=/data/devhome/bugtest go list -modfile=/tmp/go.55a376b10bebbfad47143de3b5ed178556d1bb85f4fe16e1f2ecebac707ea87d.908788606.mod -mod=readonly -f \"{{context.GOARCH}} {{context.Compiler}}\" -- unsafe\n"}


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 4.042633ms for GOROOT= GOPATH=/data/go GO111MODULE=off GOPROXY=<private>,direct PWD=/data/devhome/bugtest go list -e -f {{context.ReleaseTags}} -- unsafe

[Info  - 3:04:51 PM] 2023/05/26 15:04:51 4.234228ms for GOROOT= GOPATH=/data/go GO111MODULE=on GOPROXY=<private>,direct PWD=/data/devhome/bugtest go list -modfile=/tmp/go.55a376b10bebbfad47143de3b5ed178556d1bb85f4fe16e1f2ecebac707ea87d.908788606.mod -mod=readonly -f "{{context.GOARCH}} {{context.Compiler}}" -- unsafe

[Trace - 15:04:51.306 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 62.901015ms for GOROOT= GOPATH=/data/go GO111MODULE=on GOPROXY=<private>,direct PWD=/data/devhome/bugtest go list -modfile=/tmp/go.55a376b10bebbfad47143de3b5ed178556d1bb85f4fe16e1f2ecebac707ea87d.908788606.mod -mod=readonly -e -json=Name,ImportPath,Error,Dir,GoFiles,IgnoredGoFiles,IgnoredOtherFiles,CFiles,CgoFiles,CXXFiles,MFiles,HFiles,FFiles,SFiles,SwigFiles,SwigCXXFiles,SysoFiles,TestGoFiles,XTestGoFiles,CompiledGoFiles,Export,DepOnly,Imports,ImportMap,TestImports,XTestImports,ForTest,DepsErrors,Module -compiled=true -test=true -export=false -deps=true -find=false -- builtin example.com/bug/...\n"}


[Trace - 15:04:51.306 PM] Sending request 'textDocument/documentSymbol - (1)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"}}


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 62.901015ms for GOROOT= GOPATH=/data/go GO111MODULE=on GOPROXY=<private>,direct PWD=/data/devhome/bugtest go list -modfile=/tmp/go.55a376b10bebbfad47143de3b5ed178556d1bb85f4fe16e1f2ecebac707ea87d.908788606.mod -mod=readonly -e -json=Name,ImportPath,Error,Dir,GoFiles,IgnoredGoFiles,IgnoredOtherFiles,CFiles,CgoFiles,CXXFiles,MFiles,HFiles,FFiles,SFiles,SwigFiles,SwigCXXFiles,SysoFiles,TestGoFiles,XTestGoFiles,CompiledGoFiles,Export,DepOnly,Imports,ImportMap,TestImports,XTestImports,ForTest,DepsErrors,Module -compiled=true -test=true -export=false -deps=true -find=false -- builtin example.com/bug/...

[Trace - 15:04:51.306 PM] Sending request 'textDocument/codeAction - (2)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"},"range":{"start":{"line":18,"character":40},"end":{"line":18,"character":40}},"context":{"diagnostics":[],"triggerKind":2}}


[Trace - 15:04:51.309 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 go/packages.Load #1\n\tsnapshot=0\n\tdirectory=file:///data/devhome/bugtest\n\tquery=[builtin example.com/bug/...]\n\tpackages=2\n"}


[Trace - 15:04:51.309 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 go/packages.Load #1\n\tsnapshot=0\n\tdirectory=file:///data/devhome/bugtest\n\tpackage=\"builtin\"\n\tfiles=[/root/sdk/go1.20.3/src/builtin/builtin.go]\n"}


[Trace - 15:04:51.309 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 go/packages.Load #1\n\tsnapshot=0\n\tdirectory=file:///data/devhome/bugtest\n\tpackage=\"example.com/bug\"\n\tfiles=[/data/devhome/bugtest/main.go]\n"}


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 go/packages.Load #1
	snapshot=0
	directory=file:///data/devhome/bugtest
	query=[builtin example.com/bug/...]
	packages=2

[Info  - 3:04:51 PM] 2023/05/26 15:04:51 go/packages.Load #1
	snapshot=0
	directory=file:///data/devhome/bugtest
	package="builtin"
	files=[/root/sdk/go1.20.3/src/builtin/builtin.go]

[Trace - 15:04:51.310 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 go/packages.Load #1: updating metadata for 55 packages\n"}


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 go/packages.Load #1
	snapshot=0
	directory=file:///data/devhome/bugtest
	package="example.com/bug"
	files=[/data/devhome/bugtest/main.go]

[Info  - 3:04:51 PM] 2023/05/26 15:04:51 go/packages.Load #1: updating metadata for 55 packages

[Trace - 15:04:51.328 PM] Sending request 'textDocument/documentLink - (3)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"}}


[Trace - 15:04:51.329 PM] Sending request 'textDocument/inlayHint - (4)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":26,"character":0}}}


[Trace - 15:04:51.353 PM] Received notification '$/progress'.
Params: {"token":"7672560210552282361","value":{"kind":"end","message":"Finished loading packages."}}


[Trace - 15:04:51.355 PM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum,work}","kind":7}]}}]}


[Trace - 15:04:51.356 PM] Sending response 'client/registerCapability - (3)' in 1ms.
Result: 


[Trace - 15:04:51.356 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}


[Trace - 15:04:51.357 PM] Sending response 'client/registerCapability - (4)' in 1ms.
Result: 


[Trace - 15:04:51.360 PM] Received response 'textDocument/documentSymbol - (1)' in 53ms.
Result: [{"name":"MeterProvider","detail":"interface{...}","kind":11,"range":{"start":{"line":5,"character":5},"end":{"line":7,"character":1}},"selectionRange":{"start":{"line":5,"character":5},"end":{"line":5,"character":18}},"children":[{"name":"Meter","detail":"func(instrumentationName string, opts ...metric.MeterOption) metric.Meter","kind":6,"range":{"start":{"line":6,"character":1},"end":{"line":6,"character":75}},"selectionRange":{"start":{"line":6,"character":1},"end":{"line":6,"character":6}}}]},{"name":"MyProvider","detail":"interface{...}","kind":11,"range":{"start":{"line":8,"character":5},"end":{"line":10,"character":1}},"selectionRange":{"start":{"line":8,"character":5},"end":{"line":8,"character":15}},"children":[{"name":"Reproduce","detail":"func(xxx string, opts ...metric.MeterOption) metric.Meter","kind":6,"range":{"start":{"line":9,"character":1},"end":{"line":9,"character":63}},"selectionRange":{"start":{"line":9,"character":1},"end":{"line":9,"character":10}}}]},{"name":"VariableFuncInterface","detail":"interface{...}","kind":11,"range":{"start":{"line":11,"character":5},"end":{"line":13,"character":1}},"selectionRange":{"start":{"line":11,"character":5},"end":{"line":11,"character":26}},"children":[{"name":"Func","detail":"func(xxx string, opts ...int) string","kind":6,"range":{"start":{"line":12,"character":1},"end":{"line":12,"character":37}},"selectionRange":{"start":{"line":12,"character":1},"end":{"line":12,"character":5}}}]},{"name":"main","detail":"func()","kind":12,"range":{"start":{"line":15,"character":0},"end":{"line":25,"character":1}},"selectionRange":{"start":{"line":15,"character":5},"end":{"line":15,"character":9}}}]


[Trace - 15:04:51.361 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 fixImports(filename=\"/data/devhome/bugtest/main.go\"), abs=\"/data/devhome/bugtest/main.go\", srcDir=\"/data/devhome/bugtest\" ...\n"}


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 fixImports(filename="/data/devhome/bugtest/main.go"), abs="/data/devhome/bugtest/main.go", srcDir="/data/devhome/bugtest" ...

[Trace - 15:04:51.556 PM] Sending request 'textDocument/codeLens - (5)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"}}


[Trace - 15:04:51.559 PM] Sending request 'textDocument/foldingRange - (6)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"}}


[Trace - 15:04:51.611 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///data/devhome/bugtest/main.go","version":1,"diagnostics":[{"range":{"start":{"line":23,"character":36},"end":{"line":23,"character":38}},"severity":1,"code":"IncompatibleAssign","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#IncompatibleAssign"},"source":"compiler","message":"cannot use \"\" (untyped string constant) as int value in argument to x.(VariableFuncInterface).Func"}]}


[Trace - 15:04:51.611 PM] Received response 'textDocument/codeAction - (2)' in 304ms.
Result: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":1,"uri":"file:///data/devhome/bugtest/main.go"},"edits":[{"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"newText":""}]}]}}]


[Trace - 15:04:51.612 PM] Received response 'textDocument/documentLink - (3)' in 283ms.
Result: [{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":39}},"target":"https://pkg.go.dev/go.opentelemetry.io/otel/[email protected]"}]


[Trace - 15:04:51.612 PM] Received response 'textDocument/inlayHint - (4)' in 283ms.
Result: null


[Trace - 15:04:51.612 PM] Received response 'textDocument/codeLens - (5)' in 56ms.
Result: null


[Trace - 15:04:51.612 PM] Received response 'textDocument/foldingRange - (6)' in 52ms.
Result: [{"startLine":5,"startCharacter":30,"endLine":6,"endCharacter":75},{"startLine":8,"startCharacter":27,"endLine":9,"endCharacter":63},{"startLine":11,"startCharacter":38,"endLine":12,"endCharacter":37},{"startLine":15,"startCharacter":13,"endLine":23,"endCharacter":39},{"startLine":21,"startCharacter":45,"endLine":22,"endCharacter":63,"kind":"comment"}]


[Trace - 15:04:51.945 PM] Sending request 'textDocument/codeAction - (7)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"},"range":{"start":{"line":18,"character":40},"end":{"line":18,"character":40}},"context":{"diagnostics":[],"triggerKind":2}}


[Trace - 15:04:51.946 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:04:51 fixImports(filename=\"/data/devhome/bugtest/main.go\"), abs=\"/data/devhome/bugtest/main.go\", srcDir=\"/data/devhome/bugtest\" ...\n"}


[Trace - 15:04:51.946 PM] Received response 'textDocument/codeAction - (7)' in 0ms.
Result: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":1,"uri":"file:///data/devhome/bugtest/main.go"},"edits":[{"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"newText":""}]}]}}]


[Info  - 3:04:51 PM] 2023/05/26 15:04:51 fixImports(filename="/data/devhome/bugtest/main.go"), abs="/data/devhome/bugtest/main.go", srcDir="/data/devhome/bugtest" ...

[Trace - 15:04:52.518 PM] Sending request 'textDocument/codeLens - (8)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"}}


[Trace - 15:04:52.518 PM] Received response 'textDocument/codeLens - (8)' in 0ms.
Result: null


[Trace - 15:04:54.473 PM] Sending request 'textDocument/inlayHint - (9)'.
Params: {"textDocument":{"uri":"file:///data/devhome/bugtest/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":26,"character":0}}}


[Trace - 15:04:54.473 PM] Received response 'textDocument/inlayHint - (9)' in 0ms.
Result: null


[Trace - 15:05:21.368 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 3.65509ms for GOROOT= GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go env -json GO111MODULE GOFLAGS GOINSECURE GOMOD GOMODCACHE GONOPROXY GONOSUMDB GOPATH GOPROXY GOROOT GOSUMDB GOWORK\n"}


[Trace - 15:05:21.368 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 background imports cache refresh starting\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 3.65509ms for GOROOT= GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go env -json GO111MODULE GOFLAGS GOINSECURE GOMOD GOMODCACHE GONOPROXY GONOSUMDB GOPATH GOPROXY GOROOT GOSUMDB GOWORK

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 background imports cache refresh starting

[Trace - 15:05:21.372 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 3.557763ms for GOROOT=/root/sdk/go1.20.3 GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go list -mod=readonly -m -f \"{{.Path}}\\n{{.Dir}}\\n{{.GoMod}}\\n{{.GoVersion}}\\n{{range context.ReleaseTags}}{{if eq . \\\"go1.14\\\"}}{{.}}{{end}}{{end}}\\n\"\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 3.557763ms for GOROOT=/root/sdk/go1.20.3 GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go list -mod=readonly -m -f "{{.Path}}\n{{.Dir}}\n{{.GoMod}}\n{{.GoVersion}}\n{{range context.ReleaseTags}}{{if eq . \"go1.14\"}}{{.}}{{end}}{{end}}\n"

[Trace - 15:05:21.375 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 3.281688ms for GOROOT=/root/sdk/go1.20.3 GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go env GOFLAGS\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 3.281688ms for GOROOT=/root/sdk/go1.20.3 GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go env GOFLAGS

[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 4.099402ms for GOROOT=/root/sdk/go1.20.3 GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go list -m -e -json ...\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 4.099402ms for GOROOT=/root/sdk/go1.20.3 GOPATH=/data/go GO111MODULE=on GOPROXY=off PWD=/data/devhome/bugtest go list -m -e -json ...

[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/devhome/bugtest\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/davecgh/[email protected]/cache: no such file or directory\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/devhome/bugtest

[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/davecgh/[email protected]\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/davecgh/[email protected] in 113.783µs\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/devhome/bugtest in 236.132µs\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected] in 135.876µs\n"}


[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/go-logr/[email protected]\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]

[Trace - 15:05:21.380 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/go-logr/[email protected] in 221.627µs\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/go-logr/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/go-logr/[email protected]\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/go-logr/[email protected]/cache: no such file or directory\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]/cache: no such file or directory

[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/go-logr/[email protected] in 148.885µs\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/google/[email protected] in 211.639µs\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/pmezard/[email protected]\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/pmezard/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/stretchr/[email protected]\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/google/[email protected]\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/google/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/pmezard/[email protected] in 87.904µs\n"}


[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/stretchr/[email protected] in 182.484µs\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/davecgh/[email protected]/cache: no such file or directory

[Trace - 15:05:21.381 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/stretchr/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected] in 108.113µs\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/go.opentelemetry.io/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/go.opentelemetry.io/[email protected]\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/gopkg.in/[email protected]\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/go.opentelemetry.io/[email protected] in 435.286µs\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/gopkg.in/[email protected]/cache: no such file or directory\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/gopkg.in/[email protected] in 156.062µs\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod\n"}


[Trace - 15:05:21.382 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 Directory added to ignore list: /data/go/pkg/mod/cache\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/davecgh/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/davecgh/[email protected] in 113.783µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/devhome/bugtest in 236.132µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected] in 135.876µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/go-logr/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/go-logr/[email protected] in 221.627µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/go-logr/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/go-logr/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/go-logr/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/go-logr/[email protected] in 148.885µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/google/[email protected] in 211.639µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/pmezard/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/pmezard/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/stretchr/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/github.com/google/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/google/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/pmezard/[email protected] in 87.904µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/github.com/stretchr/[email protected] in 182.484µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/github.com/stretchr/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/go.opentelemetry.io/otel/[email protected] in 108.113µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/go.opentelemetry.io/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/go.opentelemetry.io/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod/gopkg.in/[email protected]

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/go.opentelemetry.io/[email protected] in 435.286µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Error statting ignored directory: stat /data/go/pkg/mod/gopkg.in/[email protected]/cache: no such file or directory

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod/gopkg.in/[email protected] in 156.062µs

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanning /data/go/pkg/mod

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 Directory added to ignore list: /data/go/pkg/mod/cache

[Trace - 15:05:21.508 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 background refresh finished after 143.336188ms\n"}


[Trace - 15:05:21.508 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod in 125.604139ms\n"}


[Info  - 3:05:21 PM] 2023/05/26 15:05:21 background refresh finished after 143.336188ms

[Info  - 3:05:21 PM] 2023/05/26 15:05:21 gopathwalk: scanned /data/go/pkg/mod in 125.604139ms

@Littlefisher619
Copy link
Author

Littlefisher619 commented May 26, 2023

To be mentioned that, force type cast is not needed here when try to reproduce the bug:
image

Code
```go package main

import "go.opentelemetry.io/otel/metric"

type MeterProvider interface {
Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter
}
type MyProvider interface {
Reproduce(xxx string, opts ...metric.MeterOption) metric.Meter
}
type VariableFuncInterface interface {
Func(xxx string, opts ...int) string
}

func main() {
var (
o metric.MeterProvider
x MeterProvider
y MyProvider
z VariableFuncInterface
)
o.Meter("", 123)
x.Meter("", 123)
y.Reproduce("", 123)
z.Func("", "")
}

</details>

@jamalc jamalc added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 1, 2023
@findleyr
Copy link
Member

findleyr commented Jun 1, 2023

Hi, this should be fixed in [email protected]. Could you please try upgrading gopls and confirm?

go install golang.org/x/tools/[email protected]

Thank you.

@hyangah hyangah added the gopls gopls related issues label Jun 1, 2023
@adonovan
Copy link
Member

adonovan commented Jun 1, 2023

Thanks for reporting this bug and providing a reproducible test case. I confirm that the bug exists at v0.11.0, and also that it is fixed by v0.12.0, so I'm going to mark it as fixed.

@adonovan adonovan closed this as completed Jun 1, 2023
@golang golang locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls gopls related issues NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants