vim-go icon indicating copy to clipboard operation
vim-go copied to clipboard

After updating go.mod to 1.23 error highlighting and completion doesn't work

Open pendar747 opened this issue 1 year ago • 3 comments

What did you do? (required: The issue will be closed when not provided)

  1. update go.mod to 1.23
  2. trying error highlighting or completion

What did you expect to happen?

See error highlighting or completion

What happened instead?

No action

Configuration (MUST fill this out):

vim-go version: ac1fb9611de435d80a6badcf8482cb1428449b10

vimrc you used to reproduce:

vimrc
call plug#begin()
" This is where we will add plugins to install

Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'

Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'preservim/nerdcommenter'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'dkprice/vim-easygrep' 
Plug 'jparise/vim-graphql'
Plug 'prettier/vim-prettier'
Plug 'tpope/vim-rhubarb'
Plug 'vim-test/vim-test'
Plug 'tpope/vim-dispatch'
Plug 'airblade/vim-gitgutter'
Plug 'leafgarland/typescript-vim'
Plug 'ruanyl/vim-gh-line'

" Everforest theme
Plug 'sainnhe/everforest'

Plug 'neoclide/coc.nvim', {'branch': 'release'}

Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'sebdah/vim-delve'
Plug 'idanarye/vim-merginal'
Plug 'tpope/vim-dadbod'
Plug 'tpope/vim-dotenv'

Plug 'hashivim/vim-terraform'
Plug 'itmammoth/doorboy.vim'
Plug 'github/copilot.vim'
Plug 'chrisbra/csv.vim'
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && npm install' }
Plug 'vim-test/vim-test'
Plug 'kburdett/vim-nuuid'

" These plugins only work with neovim
if has('nvim')
  Plug 'nvim-tree/nvim-web-devicons'
  Plug 'nvim-lua/plenary.nvim'
  Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
  Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
  Plug 'sindrets/diffview.nvim'
  Plug 'rmagatti/auto-session'
  Plug 'kevinhwang91/nvim-bqf'
  Plug 'pwntester/octo.nvim'
end

""" Set the coc-nvim settings location
let g:coc_config_home = expand('~/.vim/')

call plug#end()

""""" COC-NVIM config
let g:coc_global_extensions = ['coc-json', 'coc-snippets', 'coc-emmet', 'coc-tsserver', 'coc-go', 'coc-css', 'coc-eslint', 'coc-pyright', 'coc-swagger', 'coc-spell-checker']

Vim version (first three lines from :version):

nvim --version
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1725453128
Run "nvim -V1 -v" for more info

Go version (go version):

1.23

Go environment

go env Output:

GO111MODULE='on'
GOARCH='arm64'
GOBIN='/Users/pendar/go/bin/'
GOCACHE='/Users/pendar/Library/Caches/go-build'
GOENV='/Users/pendar/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS='-mod=mod'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/pendar/go/pkg/mod'
GONOPROXY='***'
GONOSUMDB='***'
GOOS='darwin'
GOPATH='/Users/pendar/go'
GOPRIVATE='****'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/pendar/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='***'
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/zd/sdcyyqyn2wnbtm7yg8pl4mn40000gn/T/go-build1958750560=/tmp/go-build -gno-record-gcc-switches -fno-common'

gopls version

gopls version Output:

golang.org/x/tools/gopls v0.16.2

GOLSP_LOG

===== sent =====
Content-Length: 2140

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 2}}}
===== received =====
Content-Length: 188

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":2,"diagnostics":[]}}
===== sent =====
Content-Length: 2146

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt.\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 5}}}
===== received =====
Content-Length: 1312

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":5,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":26,"character":2}},"severity":1,"code":"BadDecl","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#BadDecl"},"source":"compiler","message":"non-name t.c on left side of :="},{"range":{"start":{"line":26,"character":1},"end":{"line":26,"character":2}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"t.c undefined (type *testing.T has no field or method c)"},{"range":{"start":{"line":31,"character":21},"end":{"line":31,"character":22}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"},{"range":{"start":{"line":36,"character":57},"end":{"line":36,"character":58}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"}]}}
===== sent =====
Content-Length: 2150

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt.\n\t\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 6}}}
===== received =====
Content-Length: 1312

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":6,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":27,"character":2}},"severity":1,"code":"BadDecl","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#BadDecl"},"source":"compiler","message":"non-name t.c on left side of :="},{"range":{"start":{"line":27,"character":1},"end":{"line":27,"character":2}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"t.c undefined (type *testing.T has no field or method c)"},{"range":{"start":{"line":32,"character":21},"end":{"line":32,"character":22}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"},{"range":{"start":{"line":37,"character":57},"end":{"line":37,"character":58}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"}]}}
===== sent =====
Content-Length: 2146

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt.\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 9}}}
===== received =====
Content-Length: 1312

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":9,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":26,"character":2}},"severity":1,"code":"BadDecl","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#BadDecl"},"source":"compiler","message":"non-name t.c on left side of :="},{"range":{"start":{"line":26,"character":1},"end":{"line":26,"character":2}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"t.c undefined (type *testing.T has no field or method c)"},{"range":{"start":{"line":31,"character":21},"end":{"line":31,"character":22}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"},{"range":{"start":{"line":36,"character":57},"end":{"line":36,"character":58}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"}]}}
===== sent =====
Content-Length: 2146

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 10}}}
===== received =====
Content-Length: 476

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":10,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":24,"character":2}},"severity":1,"code":"UnusedExpr","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UnusedExpr"},"source":"compiler","message":"t (variable of type *testing.T) is not used"}]}}
===== sent =====
Content-Length: 2146

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 12}}}
===== received =====
Content-Length: 476

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":12,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":24,"character":2}},"severity":1,"code":"UnusedExpr","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UnusedExpr"},"source":"compiler","message":"t (variable of type *testing.T) is not used"}]}}
===== sent =====
Content-Length: 2146

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 14}}}
===== received =====
Content-Length: 476

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":14,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":24,"character":2}},"severity":1,"code":"UnusedExpr","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UnusedExpr"},"source":"compiler","message":"t (variable of type *testing.T) is not used"}]}}
===== sent =====
Content-Length: 2147

{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package budgets\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb\"\n\t\"github.com/aws/aws-sdk-go-v2/service/dynamodb/types\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/deliveroo/apm-go\"\n\n\t\"github.com/deliveroo/internal/testingutil\"\n)\n\nconst (\n\ttableName = \"ad-budgets\"\n)\n\nfunc SetupTestDB(t *testing.T) Repository {\n\tt.Helper()\n\tctx := context.Background()\n\tt.\n\n\tc, err := testingutil.SetupDynamoTestContainer(ctx)\n\tif err != nil {\n\t\tt.Fatalf(\"error initiating container for dynamodb: %v\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif containerErr := c.Terminate(ctx); containerErr != nil {\n\t\t\tt.Logf(\"error terminating container: %v\", containerErr)\n\t\t}\n\t})\n\n\tclient, err := testingutil.SetupTestDynamodbClient(ctx, c)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup ddb client: %v\", err)\n\t}\n\n\terr = setupTestTable(ctx, client)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to setup budgets table: %v\", err)\n\t}\n\n\tmockApm := apm.NewMockService(t)\n\trepo, _ := New(client, tableName, mockApm)\n\trequire.NoError(t, err)\n\treturn repo\n}\n\nfunc setupTestTable(ctx context.Context, client *dynamodb.Client) error {\n\t_, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []types.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tAttributeType: types.ScalarAttributeTypeS,\n\t\t\t},\n\t\t},\n\t\tKeySchema: []types.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(\"campaign_id\"),\n\t\t\t\tKeyType:       types.KeyTypeHash,\n\t\t\t},\n\t\t},\n\t\tBillingMode: types.BillingModePayPerRequest,\n\t\tTableName:   aws.String(tableName),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating the dynamodb table: %w\", err)\n\t}\n\n\treturn nil\n}\n"}], "textDocument": {"uri": "file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go", "version": 15}}}
===== received =====
Content-Length: 1313

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/pendar/dev/internal/repo/budgets/repo_test_helpers.go","version":15,"diagnostics":[{"range":{"start":{"line":24,"character":1},"end":{"line":26,"character":2}},"severity":1,"code":"BadDecl","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#BadDecl"},"source":"compiler","message":"non-name t.c on left side of :="},{"range":{"start":{"line":26,"character":1},"end":{"line":26,"character":2}},"severity":1,"code":"MissingFieldOrMethod","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#MissingFieldOrMethod"},"source":"compiler","message":"t.c undefined (type *testing.T has no field or method c)"},{"range":{"start":{"line":31,"character":21},"end":{"line":31,"character":22}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"},{"range":{"start":{"line":36,"character":57},"end":{"line":36,"character":58}},"severity":1,"code":"UndeclaredName","codeDescription":{"href":"https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"},"source":"compiler","message":"undefined: c"}]}}

pendar747 avatar Oct 14 '24 18:10 pendar747

Have you rebuilt gopls with :GoUpdateBinaries gopls since you updated your system's version of Go to 1.23?

bhcleek avatar Oct 14 '24 20:10 bhcleek

Have you rebuilt gopls with :GoUpdateBinaries gopls since you updated your system's version of Go to 1.23?

Yea I did that a few times and tried it with both deleting the go cache (go clean -cache and go clean -modcache) but didn't work.

I ran into a similar issue when I upgrade one project from 1.20 to 1.21. I'm guessing it might have something to do with the fact that I have some projects using go 1.22 and one that is using 1.23

I tried installing the project dependancies into a separate GOPATH for 1.23 but that didn't work either. For now I'm just changing the go version to 1.22 in go.mod without committing it

pendar747 avatar Oct 15 '24 09:10 pendar747

Can you duplicate this on your system with a small project? I'd love to see a clear duplication path. Also, can you try duplicating this without all the other plugins you have configured. i.e. Duplicating this with a small module and with only vim-go being the only plugin in your vimrc will allow us to figure out what's going on as fast as possible.

bhcleek avatar Oct 15 '24 15:10 bhcleek

Actually it looks like the features that are broken for me are coming from coc-go not vim-go. vim-go is working as before with go 1.23. There is currently an issue open with vim-go and go 1.23 https://github.com/josa42/coc-go/issues/222.

pendar747 avatar Nov 01 '24 14:11 pendar747