Skip to content
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

x/tools/gopls: hangs while loading the workspace #42081

Open
adityaramani opened this issue Oct 15, 2020 · 14 comments
Open

x/tools/gopls: hangs while loading the workspace #42081

adityaramani opened this issue Oct 15, 2020 · 14 comments

Comments

@adityaramani
Copy link

@adityaramani adityaramani commented Oct 15, 2020

Issue Type: Bug

As soon as I load up my remote workspace, the bottom status bar reports the above message and it does not seem to resolve itself.
Not able to use any features like find definition or cmd + click to go to def.

Strangely this is happening only in this particular workspace, on all other workspaces everything loads fine

Extension version: 0.17.2
VS Code version: Code - Insiders 1.51.0-insider (2ed16d0ce8713a5dfed9729071141be0ccf7fbec, 2020-10-14T05:48:54.391Z)
OS version: Darwin x64 18.7.0
Remote OS version: Linux x64 4.19.46-4.19.1-amd64-9cf031ffa09555f2
Remote OS version: Linux x64 4.19.46-4.19.1-amd64-9cf031ffa09555f2

System Info
Item Value
CPUs Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.13GB free)
Process Argv --crash-reporter-id 7baeac86-2290-4972-98c4-52269f5e9bbd
Screen Reader no
VM 0%
Item Value
Remote SSH: 198.18.66.201
OS Linux x64 4.19.46-4.19.1-amd64-9cf031ffa09555f2
CPUs Intel(R) Xeon(R) CPU E31270 @ 3.40GHz (8 x 1734)
Memory (System) 15.64GB (0.56GB free)
VM 0%
Item Value
Remote SSH: 198.18.66.201
OS Linux x64 4.19.46-4.19.1-amd64-9cf031ffa09555f2
CPUs Intel(R) Xeon(R) CPU E31270 @ 3.40GHz (8 x 1734)
Memory (System) 15.64GB (0.56GB free)
VM 0%
@hyangah
Copy link
Contributor

@hyangah hyangah commented Oct 15, 2020

@adityaramani I guess you are using the language server. ("go.useLanguageServer": true). Can you please share the gopls log to help investigation? Thanks!

https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#vs-code

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 16, 2020

I am also running into this issue as well. Here are the settings for my remote:

"go.autocompleteUnimportedPackages": true,
"go.gopath": "/home/myuser/go",
"go.goroot": "/home/myuser/sdk/go1.15.3",
"go.testFlags": [
    "-v"
],
"go.languageServerExperimentalFeatures":{
    "diagnostics": false,
    "documentLink": true
},
"go.languageServerFlags": [
    "serve",
    "-rpc.trace",
    "--debug=localhost:6060"
],
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.useLanguageServer": true,
"go.formatTool": "goimports",
"go.gotoSymbol.includeImports": true,
"go.gotoSymbol.includeGoroot": true,
"go.buildOnSave": "off",
"go.lintOnSave": "off",
"go.vetOnSave": "off",
"files.eol": "\n",

And here are the logs from gopls (server):

[Trace - 12:19:48.081 PM] Sending request 'initialize - (0)'.
Params: {"processId":27522,"clientInfo":{"name":"vscode","version":"1.50.1"},"rootPath":"/home/myuser/kc/bingen-file-tests","rootUri":"file:///home/myuser/kc/bingen-file-tests","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":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]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"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]}},"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]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":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},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":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},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///home/myuser/kc/bingen-file-tests","name":"bingen-file-tests"}]}


[Trace - 12:19:48.081 PM] Received response 'initialize - (0)' in 0ms.
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,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["generate","fill_struct","regenerate_cgo","test","tidy","undeclared_name","upgrade_dependency","vendor","extract_variable","extract_function","gc_details","generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"Build info\n----------\ngolang.org/x/tools/gopls v0.5.1\n    golang.org/x/tools/gopls@v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=\n    golang.org/x/sync@v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=\n    golang.org/x/tools@v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=\n    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\n    honnef.co/go/tools@v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=\n    mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n"}}


[Trace - 12:19:48.113 PM] Sending notification 'initialized'.
Params: {}


[Trace - 12:19:48.113 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}


[Trace - 12:19:48.114 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go","languageId":"go","version":1,"text":"package kc\n\nimport (\n\t\"encoding\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\tutil \"github.com/kc/bingen-file-tests/util\"\n\t\n\t\"reflect\"\n\t\"strings\"\n\t\"time\"\n)\n\n// GeneratorPackageName is the package the generator is targetting\nconst GeneratorPackageName string = \"kc\"\n\n//--------------------------------------------------------------------------\n//  Type Map\n//--------------------------------------------------------------------------\n\n// Generated type map for resolving interface implementations to\n// to concrete types\nvar typeMap map[string]reflect.Type = map[string]reflect.Type{\n\t\"Allocation\":         reflect.TypeOf((*Allocation)(nil)).Elem(),\n\t\"AllocationSet\":      reflect.TypeOf((*AllocationSet)(nil)).Elem(),\n\t\"AllocationSetRange\": reflect.TypeOf((*AllocationSetRange)(nil)).Elem(),\n\t\"Any\":                reflect.TypeOf((*Any)(nil)).Elem(),\n\t\"AssetSet\":           reflect.TypeOf((*AssetSet)(nil)).Elem(),\n\t\"AssetSetRange\":      reflect.TypeOf((*AssetSetRange)(nil)).Elem(),\n\t\"Breakdown\":          reflect.TypeOf((*Breakdown)(nil)).Elem(),\n\t\"CloudAny\":           reflect.TypeOf((*CloudAny)(nil)).Elem(),\n\t\"CloudNetwork\":       reflect.TypeOf((*CloudNetwork)(nil)).Elem(),\n\t\"ClusterManagement\":  reflect.TypeOf((*ClusterManagement)(nil)).Elem(),\n\t\"Disk\":               reflect.TypeOf((*Disk)(nil)).Elem(),\n\t\"LoadBalancer\":       reflect.TypeOf((*LoadBalancer)(nil)).Elem(),\n\t\"Node\":               reflect.TypeOf((*Node)(nil)).Elem(),\n\t\"SharedAsset\":        reflect.TypeOf((*SharedAsset)(nil)).Elem(),\n\t\"Window\":             reflect.TypeOf((*Window)(nil)).Elem(),\n}\n\n//--------------------------------------------------------------------------\n//  Type Helpers\n//--------------------------------------------------------------------------\n\n// typeToString determines the basic properties of the type, the qualifier, package path, and\n// type name, and returns the qualified type\nfunc typeToString(f interface{}) string {\n\tqual := \"\"\n\tt := reflect.TypeOf(f)\n\tif t.Kind() == reflect.Ptr {\n\t\tt = t.Elem()\n\t\tqual = \"*\"\n\t}\n\n\treturn fmt.Sprintf(\"%s%s.%s\", qual, t.PkgPath(), t.Name())\n}\n\n// resolveType uses the name of a type and returns the package, base type name, and whether\n// or not it's a pointer.\nfunc resolveType(t string) (pkg string, name string, isPtr bool) {\n\tisPtr = t[:1] == \"*\"\n\tif isPtr {\n\t\tt = t[1:]\n\t}\n\n\tslashIndex := strings.LastIndex(t, \"/\")\n\tif slashIndex >= 0 {\n\t\tt = t[slashIndex+1:]\n\t}\n\tparts := strings.Split(t, \".\")\n\tif parts[0] == GeneratorPackageName {\n\t\tparts[0] = \"\"\n\t}\n\n\tpkg = parts[0]\n\tname = parts[1]\n\treturn\n}\n\n//--------------------------------------------------------------------------\n//  Allocation\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this Allocation instance\n// into a byte array\nfunc (target *Allocation) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.Name) // write string\n\t// --- [begin][write][reference](Properties) ---\n\ta, errA := target.Properties.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][reference](Properties) ---\n\n\t// --- [begin][write][reference](time.Time) ---\n\tb, errB := target.Start.MarshalBinary()\n\tif errB != nil {\n\t\treturn nil, errB\n\t}\n\tbuff.WriteInt(len(b))\n\tbuff.WriteBytes(b)\n\t// --- [end][write][reference](time.Time) ---\n\n\t// --- [begin][write][reference](time.Time) ---\n\tc, errC := target.End.MarshalBinary()\n\tif errC != nil {\n\t\treturn nil, errC\n\t}\n\tbuff.WriteInt(len(c))\n\tbuff.WriteBytes(c)\n\t// --- [end][write][reference](time.Time) ---\n\n\tbuff.WriteFloat64(target.Minutes) // write float64\n\t// --- [begin][write][reference](time.Time) ---\n\td, errD := target.ActiveStart.MarshalBinary()\n\tif errD != nil {\n\t\treturn nil, errD\n\t}\n\tbuff.WriteInt(len(d))\n\tbuff.WriteBytes(d)\n\t// --- [end][write][reference](time.Time) ---\n\n\tbuff.WriteFloat64(target.CPUCoreHours)    // write float64\n\tbuff.WriteFloat64(target.CPUCost)         // write float64\n\tbuff.WriteFloat64(target.CPUEfficiency)   // write float64\n\tbuff.WriteFloat64(target.GPUHours)        // write float64\n\tbuff.WriteFloat64(target.GPUCost)         // write float64\n\tbuff.WriteFloat64(target.NetworkCost)     // write float64\n\tbuff.WriteFloat64(target.PVByteHours)     // write float64\n\tbuff.WriteFloat64(target.PVCost)          // write float64\n\tbuff.WriteFloat64(target.RAMByteHours)    // write float64\n\tbuff.WriteFloat64(target.RAMCost)         // write float64\n\tbuff.WriteFloat64(target.RAMEfficiency)   // write float64\n\tbuff.WriteFloat64(target.SharedCost)      // write float64\n\tbuff.WriteFloat64(target.TotalCost)       // write float64\n\tbuff.WriteFloat64(target.TotalEfficiency) // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the Allocation type\nfunc (target *Allocation) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling Allocation. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.Name = a\n\n\t// --- [begin][read][reference](Properties) ---\n\tb := &Properties{}\n\tc := buff.ReadInt()    // byte array length\n\td := buff.ReadBytes(c) // byte array\n\terrA := b.UnmarshalBinary(d)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.Properties = *b\n\t// --- [end][read][reference](Properties) ---\n\n\t// --- [begin][read][reference](time.Time) ---\n\te := &time.Time{}\n\tf := buff.ReadInt()    // byte array length\n\tg := buff.ReadBytes(f) // byte array\n\terrB := e.UnmarshalBinary(g)\n\tif errB != nil {\n\t\treturn errB\n\t}\n\ttarget.Start = *e\n\t// --- [end][read][reference](time.Time) ---\n\n\t// --- [begin][read][reference](time.Time) ---\n\th := &time.Time{}\n\tl := buff.ReadInt()    // byte array length\n\tm := buff.ReadBytes(l) // byte array\n\terrC := h.UnmarshalBinary(m)\n\tif errC != nil {\n\t\treturn errC\n\t}\n\ttarget.End = *h\n\t// --- [end][read][reference](time.Time) ---\n\n\tn := buff.ReadFloat64() // read float64\n\ttarget.Minutes = n\n\n\t// --- [begin][read][reference](time.Time) ---\n\to := &time.Time{}\n\tp := buff.ReadInt()    // byte array length\n\tq := buff.ReadBytes(p) // byte array\n\terrD := o.UnmarshalBinary(q)\n\tif errD != nil {\n\t\treturn errD\n\t}\n\ttarget.ActiveStart = *o\n\t// --- [end][read][reference](time.Time) ---\n\n\tr := buff.ReadFloat64() // read float64\n\ttarget.CPUCoreHours = r\n\n\ts := buff.ReadFloat64() // read float64\n\ttarget.CPUCost = s\n\n\tt := buff.ReadFloat64() // read float64\n\ttarget.CPUEfficiency = t\n\n\tu := buff.ReadFloat64() // read float64\n\ttarget.GPUHours = u\n\n\tw := buff.ReadFloat64() // read float64\n\ttarget.GPUCost = w\n\n\tx := buff.ReadFloat64() // read float64\n\ttarget.NetworkCost = x\n\n\ty := buff.ReadFloat64() // read float64\n\ttarget.PVByteHours = y\n\n\tz := buff.ReadFloat64() // read float64\n\ttarget.PVCost = z\n\n\taa := buff.ReadFloat64() // read float64\n\ttarget.RAMByteHours = aa\n\n\tbb := buff.ReadFloat64() // read float64\n\ttarget.RAMCost = bb\n\n\tcc := buff.ReadFloat64() // read float64\n\ttarget.RAMEfficiency = cc\n\n\tdd := buff.ReadFloat64() // read float64\n\ttarget.SharedCost = dd\n\n\tee := buff.ReadFloat64() // read float64\n\ttarget.TotalCost = ee\n\n\tff := buff.ReadFloat64() // read float64\n\ttarget.TotalEfficiency = ff\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  AllocationSet\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this AllocationSet instance\n// into a byte array\nfunc (target *AllocationSet) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tif target.allocations == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][map](map[string]*Allocation) ---\n\t\tbuff.WriteInt(len(target.allocations)) // map length\n\t\tfor k, v := range target.allocations {\n\t\t\tbuff.WriteString(k) // write string\n\t\t\tif v == nil {\n\t\t\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t\t\t} else {\n\t\t\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t\t\t// --- [begin][write][struct](Allocation) ---\n\t\t\t\ta, errA := v.MarshalBinary()\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn nil, errA\n\t\t\t\t}\n\t\t\t\tbuff.WriteInt(len(a))\n\t\t\t\tbuff.WriteBytes(a)\n\t\t\t\t// --- [end][write][struct](Allocation) ---\n\n\t\t\t}\n\t\t}\n\t\t// --- [end][write][map](map[string]*Allocation) ---\n\n\t}\n\tif target.idleKeys == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][map](map[string]bool) ---\n\t\tbuff.WriteInt(len(target.idleKeys)) // map length\n\t\tfor kk, vv := range target.idleKeys {\n\t\t\tbuff.WriteString(kk) // write string\n\t\t\tbuff.WriteBool(vv)   // write bool\n\t\t}\n\t\t// --- [end][write][map](map[string]bool) ---\n\n\t}\n\t// --- [begin][write][struct](Window) ---\n\tb, errB := target.Window.MarshalBinary()\n\tif errB != nil {\n\t\treturn nil, errB\n\t}\n\tbuff.WriteInt(len(b))\n\tbuff.WriteBytes(b)\n\t// --- [end][write][struct](Window) ---\n\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the AllocationSet type\nfunc (target *AllocationSet) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling AllocationSet. Expected 1, got %d\", version)\n\t}\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.allocations = nil\n\t} else {\n\t\t// --- [begin][read][map](map[string]*Allocation) ---\n\t\ta := make(map[string]*Allocation)\n\t\tb := buff.ReadInt() // map len\n\t\tfor i := 0; i < b; i++ {\n\t\t\tvar k string\n\t\t\tc := buff.ReadString() // read string\n\t\t\tk = c\n\n\t\t\tvar v *Allocation\n\t\t\tif buff.ReadUInt8() == uint8(0) {\n\t\t\t\tv = nil\n\t\t\t} else {\n\t\t\t\t// --- [begin][read][struct](Allocation) ---\n\t\t\t\td := &Allocation{}\n\t\t\t\te := buff.ReadInt()    // byte array length\n\t\t\t\tf := buff.ReadBytes(e) // byte array\n\t\t\t\terrA := d.UnmarshalBinary(f)\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn errA\n\t\t\t\t}\n\t\t\t\tv = d\n\t\t\t\t// --- [end][read][struct](Allocation) ---\n\n\t\t\t}\n\t\t\ta[k] = v\n\t\t}\n\t\ttarget.allocations = a\n\t\t// --- [end][read][map](map[string]*Allocation) ---\n\n\t}\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.idleKeys = nil\n\t} else {\n\t\t// --- [begin][read][map](map[string]bool) ---\n\t\tg := make(map[string]bool)\n\t\th := buff.ReadInt() // map len\n\t\tfor j := 0; j < h; j++ {\n\t\t\tvar kk string\n\t\t\tl := buff.ReadString() // read string\n\t\t\tkk = l\n\n\t\t\tvar vv bool\n\t\t\tm := buff.ReadBool() // read bool\n\t\t\tvv = m\n\n\t\t\tg[kk] = vv\n\t\t}\n\t\ttarget.idleKeys = g\n\t\t// --- [end][read][map](map[string]bool) ---\n\n\t}\n\t// --- [begin][read][struct](Window) ---\n\tn := &Window{}\n\to := buff.ReadInt()    // byte array length\n\tp := buff.ReadBytes(o) // byte array\n\terrB := n.UnmarshalBinary(p)\n\tif errB != nil {\n\t\treturn errB\n\t}\n\ttarget.Window = *n\n\t// --- [end][read][struct](Window) ---\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  AllocationSetRange\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this AllocationSetRange instance\n// into a byte array\nfunc (target *AllocationSetRange) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tif target.allocations == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][slice]([]*AllocationSet) ---\n\t\tbuff.WriteInt(len(target.allocations)) // array length\n\t\tfor i := 0; i < len(target.allocations); i++ {\n\t\t\tif target.allocations[i] == nil {\n\t\t\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t\t\t} else {\n\t\t\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t\t\t// --- [begin][write][struct](AllocationSet) ---\n\t\t\t\ta, errA := target.allocations[i].MarshalBinary()\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn nil, errA\n\t\t\t\t}\n\t\t\t\tbuff.WriteInt(len(a))\n\t\t\t\tbuff.WriteBytes(a)\n\t\t\t\t// --- [end][write][struct](AllocationSet) ---\n\n\t\t\t}\n\t\t}\n\t\t// --- [end][write][slice]([]*AllocationSet) ---\n\n\t}\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the AllocationSetRange type\nfunc (target *AllocationSetRange) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling AllocationSetRange. Expected 1, got %d\", version)\n\t}\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.allocations = nil\n\t} else {\n\t\t// --- [begin][read][slice]([]*AllocationSet) ---\n\t\tb := buff.ReadInt() // array len\n\t\ta := make([]*AllocationSet, b)\n\t\tfor i := 0; i < b; i++ {\n\t\t\tvar c *AllocationSet\n\t\t\tif buff.ReadUInt8() == uint8(0) {\n\t\t\t\tc = nil\n\t\t\t} else {\n\t\t\t\t// --- [begin][read][struct](AllocationSet) ---\n\t\t\t\td := &AllocationSet{}\n\t\t\t\te := buff.ReadInt()    // byte array length\n\t\t\t\tf := buff.ReadBytes(e) // byte array\n\t\t\t\terrA := d.UnmarshalBinary(f)\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn errA\n\t\t\t\t}\n\t\t\t\tc = d\n\t\t\t\t// --- [end][read][struct](AllocationSet) ---\n\n\t\t\t}\n\t\t\ta[i] = c\n\t\t}\n\t\ttarget.allocations = a\n\t\t// --- [end][read][slice]([]*AllocationSet) ---\n\n\t}\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  Any\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this Any instance\n// into a byte array\nfunc (target *Any) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.name)       // write string\n\tbuff.WriteString(target.cluster)    // write string\n\tbuff.WriteString(target.providerID) // write string\n\t// --- [begin][write][struct](Window) ---\n\ta, errA := target.window.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteFloat64(target.Cost)       // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the Any type\nfunc (target *Any) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling Any. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.name = a\n\n\tb := buff.ReadString() // read string\n\ttarget.cluster = b\n\n\tc := buff.ReadString() // read string\n\ttarget.providerID = c\n\n\t// --- [begin][read][struct](Window) ---\n\td := &Window{}\n\te := buff.ReadInt()    // byte array length\n\tf := buff.ReadBytes(e) // byte array\n\terrA := d.UnmarshalBinary(f)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.window = *d\n\t// --- [end][read][struct](Window) ---\n\n\tg := buff.ReadFloat64() // read float64\n\ttarget.adjustment = g\n\n\th := buff.ReadFloat64() // read float64\n\ttarget.Cost = h\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  AssetSet\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this AssetSet instance\n// into a byte array\nfunc (target *AssetSet) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tif target.assets == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][map](map[string]Asset) ---\n\t\tbuff.WriteInt(len(target.assets)) // map length\n\t\tfor k, v := range target.assets {\n\t\t\tbuff.WriteString(k) // write string\n\t\t\tif v == nil {\n\t\t\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t\t\t} else {\n\t\t\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t\t\t// --- [begin][write][interface](Asset) ---\n\t\t\t\ta := reflect.ValueOf(v).Interface()\n\t\t\t\tb := a.(encoding.BinaryMarshaler)\n\t\t\t\tc, errA := b.MarshalBinary()\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn nil, errA\n\t\t\t\t}\n\t\t\t\tbuff.WriteString(typeToString(v))\n\t\t\t\tbuff.WriteInt(len(c))\n\t\t\t\tbuff.WriteBytes(c)\n\t\t\t\t// --- [end][write][interface](Asset) ---\n\n\t\t\t}\n\t\t}\n\t\t// --- [end][write][map](map[string]Asset) ---\n\n\t}\n\tif target.props == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][slice]([]AssetProperty) ---\n\t\tbuff.WriteInt(len(target.props)) // array length\n\t\tfor i := 0; i < len(target.props); i++ {\n\t\t\t// --- [begin][write][alias](AssetProperty) ---\n\t\t\tbuff.WriteString(string(target.props[i])) // write string\n\t\t\t// --- [end][write][alias](AssetProperty) ---\n\n\t\t}\n\t\t// --- [end][write][slice]([]AssetProperty) ---\n\n\t}\n\t// --- [begin][write][struct](Window) ---\n\td, errB := target.Window.MarshalBinary()\n\tif errB != nil {\n\t\treturn nil, errB\n\t}\n\tbuff.WriteInt(len(d))\n\tbuff.WriteBytes(d)\n\t// --- [end][write][struct](Window) ---\n\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the AssetSet type\nfunc (target *AssetSet) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling AssetSet. Expected 1, got %d\", version)\n\t}\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.assets = nil\n\t} else {\n\t\t// --- [begin][read][map](map[string]Asset) ---\n\t\ta := make(map[string]Asset)\n\t\tb := buff.ReadInt() // map len\n\t\tfor i := 0; i < b; i++ {\n\t\t\tvar k string\n\t\t\tc := buff.ReadString() // read string\n\t\t\tk = c\n\n\t\t\tvar v Asset\n\t\t\tif buff.ReadUInt8() == uint8(0) {\n\t\t\t\tv = nil\n\t\t\t} else {\n\t\t\t\t// --- [begin][read][interface](Asset) ---\n\t\t\t\td := buff.ReadString()\n\t\t\t\t_, e, _ := resolveType(d)\n\t\t\t\tf := reflect.New(typeMap[e]).Interface().(interface{ UnmarshalBinary([]byte) error })\n\t\t\t\tg := buff.ReadInt()    // byte array length\n\t\t\t\th := buff.ReadBytes(g) // byte array\n\t\t\t\terrA := f.UnmarshalBinary(h)\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn errA\n\t\t\t\t}\n\t\t\t\tv = f.(Asset)\n\t\t\t\t// --- [end][read][interface](Asset) ---\n\n\t\t\t}\n\t\t\ta[k] = v\n\t\t}\n\t\ttarget.assets = a\n\t\t// --- [end][read][map](map[string]Asset) ---\n\n\t}\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.props = nil\n\t} else {\n\t\t// --- [begin][read][slice]([]AssetProperty) ---\n\t\tm := buff.ReadInt() // array len\n\t\tl := make([]AssetProperty, m)\n\t\tfor j := 0; j < m; j++ {\n\t\t\t// --- [begin][read][alias](AssetProperty) ---\n\t\t\tvar o string\n\t\t\tp := buff.ReadString() // read string\n\t\t\to = p\n\n\t\t\tn := AssetProperty(o)\n\t\t\t// --- [end][read][alias](AssetProperty) ---\n\n\t\t\tl[j] = n\n\t\t}\n\t\ttarget.props = l\n\t\t// --- [end][read][slice]([]AssetProperty) ---\n\n\t}\n\t// --- [begin][read][struct](Window) ---\n\tq := &Window{}\n\tr := buff.ReadInt()    // byte array length\n\ts := buff.ReadBytes(r) // byte array\n\terrB := q.UnmarshalBinary(s)\n\tif errB != nil {\n\t\treturn errB\n\t}\n\ttarget.Window = *q\n\t// --- [end][read][struct](Window) ---\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  AssetSetRange\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this AssetSetRange instance\n// into a byte array\nfunc (target *AssetSetRange) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tif target.assets == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][slice]([]*AssetSet) ---\n\t\tbuff.WriteInt(len(target.assets)) // array length\n\t\tfor i := 0; i < len(target.assets); i++ {\n\t\t\tif target.assets[i] == nil {\n\t\t\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t\t\t} else {\n\t\t\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t\t\t// --- [begin][write][struct](AssetSet) ---\n\t\t\t\ta, errA := target.assets[i].MarshalBinary()\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn nil, errA\n\t\t\t\t}\n\t\t\t\tbuff.WriteInt(len(a))\n\t\t\t\tbuff.WriteBytes(a)\n\t\t\t\t// --- [end][write][struct](AssetSet) ---\n\n\t\t\t}\n\t\t}\n\t\t// --- [end][write][slice]([]*AssetSet) ---\n\n\t}\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the AssetSetRange type\nfunc (target *AssetSetRange) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling AssetSetRange. Expected 1, got %d\", version)\n\t}\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.assets = nil\n\t} else {\n\t\t// --- [begin][read][slice]([]*AssetSet) ---\n\t\tb := buff.ReadInt() // array len\n\t\ta := make([]*AssetSet, b)\n\t\tfor i := 0; i < b; i++ {\n\t\t\tvar c *AssetSet\n\t\t\tif buff.ReadUInt8() == uint8(0) {\n\t\t\t\tc = nil\n\t\t\t} else {\n\t\t\t\t// --- [begin][read][struct](AssetSet) ---\n\t\t\t\td := &AssetSet{}\n\t\t\t\te := buff.ReadInt()    // byte array length\n\t\t\t\tf := buff.ReadBytes(e) // byte array\n\t\t\t\terrA := d.UnmarshalBinary(f)\n\t\t\t\tif errA != nil {\n\t\t\t\t\treturn errA\n\t\t\t\t}\n\t\t\t\tc = d\n\t\t\t\t// --- [end][read][struct](AssetSet) ---\n\n\t\t\t}\n\t\t\ta[i] = c\n\t\t}\n\t\ttarget.assets = a\n\t\t// --- [end][read][slice]([]*AssetSet) ---\n\n\t}\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  Breakdown\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this Breakdown instance\n// into a byte array\nfunc (target *Breakdown) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteFloat64(target.Idle)   // write float64\n\tbuff.WriteFloat64(target.Other)  // write float64\n\tbuff.WriteFloat64(target.System) // write float64\n\tbuff.WriteFloat64(target.User)   // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the Breakdown type\nfunc (target *Breakdown) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling Breakdown. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadFloat64() // read float64\n\ttarget.Idle = a\n\n\tb := buff.ReadFloat64() // read float64\n\ttarget.Other = b\n\n\tc := buff.ReadFloat64() // read float64\n\ttarget.System = c\n\n\td := buff.ReadFloat64() // read float64\n\ttarget.User = d\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  CloudAny\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this CloudAny instance\n// into a byte array\nfunc (target *CloudAny) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.providerID) // write string\n\t// --- [begin][write][struct](Window) ---\n\ta, errA := target.window.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteFloat64(target.Cost)       // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the CloudAny type\nfunc (target *CloudAny) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling CloudAny. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.providerID = a\n\n\t// --- [begin][read][struct](Window) ---\n\tb := &Window{}\n\tc := buff.ReadInt()    // byte array length\n\td := buff.ReadBytes(c) // byte array\n\terrA := b.UnmarshalBinary(d)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.window = *b\n\t// --- [end][read][struct](Window) ---\n\n\te := buff.ReadFloat64() // read float64\n\ttarget.adjustment = e\n\n\tf := buff.ReadFloat64() // read float64\n\ttarget.Cost = f\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  CloudNetwork\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this CloudNetwork instance\n// into a byte array\nfunc (target *CloudNetwork) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.providerID)  // write string\n\tbuff.WriteString(target.secondaryID) // write string\n\t// --- [begin][write][struct](Window) ---\n\ta, errA := target.window.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteFloat64(target.Cost)       // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the CloudNetwork type\nfunc (target *CloudNetwork) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling CloudNetwork. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.providerID = a\n\n\tb := buff.ReadString() // read string\n\ttarget.secondaryID = b\n\n\t// --- [begin][read][struct](Window) ---\n\tc := &Window{}\n\td := buff.ReadInt()    // byte array length\n\te := buff.ReadBytes(d) // byte array\n\terrA := c.UnmarshalBinary(e)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.window = *c\n\t// --- [end][read][struct](Window) ---\n\n\tf := buff.ReadFloat64() // read float64\n\ttarget.adjustment = f\n\n\tg := buff.ReadFloat64() // read float64\n\ttarget.Cost = g\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  ClusterManagement\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this ClusterManagement instance\n// into a byte array\nfunc (target *ClusterManagement) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.name)    // write string\n\tbuff.WriteString(target.cluster) // write string\n\t// --- [begin][write][struct](Window) ---\n\ta, errA := target.window.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteFloat64(target.Cost)       // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the ClusterManagement type\nfunc (target *ClusterManagement) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling ClusterManagement. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.name = a\n\n\tb := buff.ReadString() // read string\n\ttarget.cluster = b\n\n\t// --- [begin][read][struct](Window) ---\n\tc := &Window{}\n\td := buff.ReadInt()    // byte array length\n\te := buff.ReadBytes(d) // byte array\n\terrA := c.UnmarshalBinary(e)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.window = *c\n\t// --- [end][read][struct](Window) ---\n\n\tf := buff.ReadFloat64() // read float64\n\ttarget.adjustment = f\n\n\tg := buff.ReadFloat64() // read float64\n\ttarget.Cost = g\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  Disk\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this Disk instance\n// into a byte array\nfunc (target *Disk) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.name)    // write string\n\tbuff.WriteString(target.cluster) // write string\n\t// --- [begin][write][reference](time.Time) ---\n\ta, errA := target.end.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][reference](time.Time) ---\n\n\tbuff.WriteString(target.providerID) // write string\n\t// --- [begin][write][reference](time.Time) ---\n\tb, errB := target.start.MarshalBinary()\n\tif errB != nil {\n\t\treturn nil, errB\n\t}\n\tbuff.WriteInt(len(b))\n\tbuff.WriteBytes(b)\n\t// --- [end][write][reference](time.Time) ---\n\n\t// --- [begin][write][struct](Window) ---\n\tc, errC := target.window.MarshalBinary()\n\tif errC != nil {\n\t\treturn nil, errC\n\t}\n\tbuff.WriteInt(len(c))\n\tbuff.WriteBytes(c)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteFloat64(target.Bytes)      // write float64\n\tbuff.WriteFloat64(target.Cost)       // write float64\n\tbuff.WriteFloat64(target.Local)      // write float64\n\tif target.Breakdown == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][struct](Breakdown) ---\n\t\td, errD := target.Breakdown.MarshalBinary()\n\t\tif errD != nil {\n\t\t\treturn nil, errD\n\t\t}\n\t\tbuff.WriteInt(len(d))\n\t\tbuff.WriteBytes(d)\n\t\t// --- [end][write][struct](Breakdown) ---\n\n\t}\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the Disk type\nfunc (target *Disk) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling Disk. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.name = a\n\n\tb := buff.ReadString() // read string\n\ttarget.cluster = b\n\n\t// --- [begin][read][reference](time.Time) ---\n\tc := &time.Time{}\n\td := buff.ReadInt()    // byte array length\n\te := buff.ReadBytes(d) // byte array\n\terrA := c.UnmarshalBinary(e)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.end = *c\n\t// --- [end][read][reference](time.Time) ---\n\n\tf := buff.ReadString() // read string\n\ttarget.providerID = f\n\n\t// --- [begin][read][reference](time.Time) ---\n\tg := &time.Time{}\n\th := buff.ReadInt()    // byte array length\n\tl := buff.ReadBytes(h) // byte array\n\terrB := g.UnmarshalBinary(l)\n\tif errB != nil {\n\t\treturn errB\n\t}\n\ttarget.start = *g\n\t// --- [end][read][reference](time.Time) ---\n\n\t// --- [begin][read][struct](Window) ---\n\tm := &Window{}\n\tn := buff.ReadInt()    // byte array length\n\to := buff.ReadBytes(n) // byte array\n\terrC := m.UnmarshalBinary(o)\n\tif errC != nil {\n\t\treturn errC\n\t}\n\ttarget.window = *m\n\t// --- [end][read][struct](Window) ---\n\n\tp := buff.ReadFloat64() // read float64\n\ttarget.adjustment = p\n\n\tq := buff.ReadFloat64() // read float64\n\ttarget.Bytes = q\n\n\tr := buff.ReadFloat64() // read float64\n\ttarget.Cost = r\n\n\ts := buff.ReadFloat64() // read float64\n\ttarget.Local = s\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.Breakdown = nil\n\t} else {\n\t\t// --- [begin][read][struct](Breakdown) ---\n\t\tt := &Breakdown{}\n\t\tu := buff.ReadInt()    // byte array length\n\t\tw := buff.ReadBytes(u) // byte array\n\t\terrD := t.UnmarshalBinary(w)\n\t\tif errD != nil {\n\t\t\treturn errD\n\t\t}\n\t\ttarget.Breakdown = t\n\t\t// --- [end][read][struct](Breakdown) ---\n\n\t}\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  LoadBalancer\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this LoadBalancer instance\n// into a byte array\nfunc (target *LoadBalancer) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.name)       // write string\n\tbuff.WriteString(target.cluster)    // write string\n\tbuff.WriteString(target.providerID) // write string\n\t// --- [begin][write][struct](Window) ---\n\ta, errA := target.window.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteFloat64(target.minutes)    // write float64\n\tbuff.WriteFloat64(target.Cost)       // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the LoadBalancer type\nfunc (target *LoadBalancer) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling LoadBalancer. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.name = a\n\n\tb := buff.ReadString() // read string\n\ttarget.cluster = b\n\n\tc := buff.ReadString() // read string\n\ttarget.providerID = c\n\n\t// --- [begin][read][struct](Window) ---\n\td := &Window{}\n\te := buff.ReadInt()    // byte array length\n\tf := buff.ReadBytes(e) // byte array\n\terrA := d.UnmarshalBinary(f)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.window = *d\n\t// --- [end][read][struct](Window) ---\n\n\tg := buff.ReadFloat64() // read float64\n\ttarget.adjustment = g\n\n\th := buff.ReadFloat64() // read float64\n\ttarget.minutes = h\n\n\tl := buff.ReadFloat64() // read float64\n\ttarget.Cost = l\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  Node\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this Node instance\n// into a byte array\nfunc (target *Node) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.name)       // write string\n\tbuff.WriteString(target.cluster)    // write string\n\tbuff.WriteString(target.providerID) // write string\n\t// --- [begin][write][reference](time.Time) ---\n\ta, errA := target.start.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][reference](time.Time) ---\n\n\t// --- [begin][write][reference](time.Time) ---\n\tb, errB := target.end.MarshalBinary()\n\tif errB != nil {\n\t\treturn nil, errB\n\t}\n\tbuff.WriteInt(len(b))\n\tbuff.WriteBytes(b)\n\t// --- [end][write][reference](time.Time) ---\n\n\t// --- [begin][write][struct](Window) ---\n\tc, errC := target.window.MarshalBinary()\n\tif errC != nil {\n\t\treturn nil, errC\n\t}\n\tbuff.WriteInt(len(c))\n\tbuff.WriteBytes(c)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.adjustment) // write float64\n\tbuff.WriteString(target.NodeType)    // write string\n\tbuff.WriteFloat64(target.CPUCores)   // write float64\n\tbuff.WriteFloat64(target.RAMBytes)   // write float64\n\tif target.CPUBreakdown == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][struct](Breakdown) ---\n\t\td, errD := target.CPUBreakdown.MarshalBinary()\n\t\tif errD != nil {\n\t\t\treturn nil, errD\n\t\t}\n\t\tbuff.WriteInt(len(d))\n\t\tbuff.WriteBytes(d)\n\t\t// --- [end][write][struct](Breakdown) ---\n\n\t}\n\tif target.RAMBreakdown == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][struct](Breakdown) ---\n\t\te, errE := target.RAMBreakdown.MarshalBinary()\n\t\tif errE != nil {\n\t\t\treturn nil, errE\n\t\t}\n\t\tbuff.WriteInt(len(e))\n\t\tbuff.WriteBytes(e)\n\t\t// --- [end][write][struct](Breakdown) ---\n\n\t}\n\tbuff.WriteFloat64(target.CPUCost)     // write float64\n\tbuff.WriteFloat64(target.GPUCost)     // write float64\n\tbuff.WriteFloat64(target.RAMCost)     // write float64\n\tbuff.WriteFloat64(target.Discount)    // write float64\n\tbuff.WriteFloat64(target.Preemptible) // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the Node type\nfunc (target *Node) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling Node. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.name = a\n\n\tb := buff.ReadString() // read string\n\ttarget.cluster = b\n\n\tc := buff.ReadString() // read string\n\ttarget.providerID = c\n\n\t// --- [begin][read][reference](time.Time) ---\n\td := &time.Time{}\n\te := buff.ReadInt()    // byte array length\n\tf := buff.ReadBytes(e) // byte array\n\terrA := d.UnmarshalBinary(f)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.start = *d\n\t// --- [end][read][reference](time.Time) ---\n\n\t// --- [begin][read][reference](time.Time) ---\n\tg := &time.Time{}\n\th := buff.ReadInt()    // byte array length\n\tl := buff.ReadBytes(h) // byte array\n\terrB := g.UnmarshalBinary(l)\n\tif errB != nil {\n\t\treturn errB\n\t}\n\ttarget.end = *g\n\t// --- [end][read][reference](time.Time) ---\n\n\t// --- [begin][read][struct](Window) ---\n\tm := &Window{}\n\tn := buff.ReadInt()    // byte array length\n\to := buff.ReadBytes(n) // byte array\n\terrC := m.UnmarshalBinary(o)\n\tif errC != nil {\n\t\treturn errC\n\t}\n\ttarget.window = *m\n\t// --- [end][read][struct](Window) ---\n\n\tp := buff.ReadFloat64() // read float64\n\ttarget.adjustment = p\n\n\tq := buff.ReadString() // read string\n\ttarget.NodeType = q\n\n\tr := buff.ReadFloat64() // read float64\n\ttarget.CPUCores = r\n\n\ts := buff.ReadFloat64() // read float64\n\ttarget.RAMBytes = s\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.CPUBreakdown = nil\n\t} else {\n\t\t// --- [begin][read][struct](Breakdown) ---\n\t\tt := &Breakdown{}\n\t\tu := buff.ReadInt()    // byte array length\n\t\tw := buff.ReadBytes(u) // byte array\n\t\terrD := t.UnmarshalBinary(w)\n\t\tif errD != nil {\n\t\t\treturn errD\n\t\t}\n\t\ttarget.CPUBreakdown = t\n\t\t// --- [end][read][struct](Breakdown) ---\n\n\t}\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.RAMBreakdown = nil\n\t} else {\n\t\t// --- [begin][read][struct](Breakdown) ---\n\t\tx := &Breakdown{}\n\t\ty := buff.ReadInt()    // byte array length\n\t\tz := buff.ReadBytes(y) // byte array\n\t\terrE := x.UnmarshalBinary(z)\n\t\tif errE != nil {\n\t\t\treturn errE\n\t\t}\n\t\ttarget.RAMBreakdown = x\n\t\t// --- [end][read][struct](Breakdown) ---\n\n\t}\n\taa := buff.ReadFloat64() // read float64\n\ttarget.CPUCost = aa\n\n\tbb := buff.ReadFloat64() // read float64\n\ttarget.GPUCost = bb\n\n\tcc := buff.ReadFloat64() // read float64\n\ttarget.RAMCost = cc\n\n\tdd := buff.ReadFloat64() // read float64\n\ttarget.Discount = dd\n\n\tee := buff.ReadFloat64() // read float64\n\ttarget.Preemptible = ee\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  SharedAsset\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this SharedAsset instance\n// into a byte array\nfunc (target *SharedAsset) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tbuff.WriteString(target.name) // write string\n\t// --- [begin][write][struct](Window) ---\n\ta, errA := target.window.MarshalBinary()\n\tif errA != nil {\n\t\treturn nil, errA\n\t}\n\tbuff.WriteInt(len(a))\n\tbuff.WriteBytes(a)\n\t// --- [end][write][struct](Window) ---\n\n\tbuff.WriteFloat64(target.Cost) // write float64\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the SharedAsset type\nfunc (target *SharedAsset) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling SharedAsset. Expected 1, got %d\", version)\n\t}\n\n\ta := buff.ReadString() // read string\n\ttarget.name = a\n\n\t// --- [begin][read][struct](Window) ---\n\tb := &Window{}\n\tc := buff.ReadInt()    // byte array length\n\td := buff.ReadBytes(c) // byte array\n\terrA := b.UnmarshalBinary(d)\n\tif errA != nil {\n\t\treturn errA\n\t}\n\ttarget.window = *b\n\t// --- [end][read][struct](Window) ---\n\n\te := buff.ReadFloat64() // read float64\n\ttarget.Cost = e\n\n\treturn nil\n}\n\n//--------------------------------------------------------------------------\n//  Window\n//--------------------------------------------------------------------------\n\n// MarshalBinary serializes the internal properties of this Window instance\n// into a byte array\nfunc (target *Window) MarshalBinary() (data []byte, err error) {\n\tbuff := util.NewBuffer()\n\tbuff.WriteUInt8(1) // version\n\n\tif target.start == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][reference](time.Time) ---\n\t\ta, errA := target.start.MarshalBinary()\n\t\tif errA != nil {\n\t\t\treturn nil, errA\n\t\t}\n\t\tbuff.WriteInt(len(a))\n\t\tbuff.WriteBytes(a)\n\t\t// --- [end][write][reference](time.Time) ---\n\n\t}\n\tif target.end == nil {\n\t\tbuff.WriteUInt8(uint8(0)) // write nil byte\n\t} else {\n\t\tbuff.WriteUInt8(uint8(1)) // write non-nil byte\n\n\t\t// --- [begin][write][reference](time.Time) ---\n\t\tb, errB := target.end.MarshalBinary()\n\t\tif errB != nil {\n\t\t\treturn nil, errB\n\t\t}\n\t\tbuff.WriteInt(len(b))\n\t\tbuff.WriteBytes(b)\n\t\t// --- [end][write][reference](time.Time) ---\n\n\t}\n\treturn buff.Bytes(), nil\n}\n\n// UnmarshalBinary uses the data passed byte array to set all the internal properties of\n// the Window type\nfunc (target *Window) UnmarshalBinary(data []byte) error {\n\tbuff := util.NewBufferFromBytes(data, binary.LittleEndian)\n\n\t// Codec Version Check\n\tversion := buff.ReadUInt8()\n\tif version != 1 {\n\t\treturn fmt.Errorf(\"Invalid Version Unmarshaling Window. Expected 1, got %d\", version)\n\t}\n\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.start = nil\n\t} else {\n\t\t// --- [begin][read][reference](time.Time) ---\n\t\ta := &time.Time{}\n\t\tb := buff.ReadInt()    // byte array length\n\t\tc := buff.ReadBytes(b) // byte array\n\t\terrA := a.UnmarshalBinary(c)\n\t\tif errA != nil {\n\t\t\treturn errA\n\t\t}\n\t\ttarget.start = a\n\t\t// --- [end][read][reference](time.Time) ---\n\n\t}\n\tif buff.ReadUInt8() == uint8(0) {\n\t\ttarget.end = nil\n\t} else {\n\t\t// --- [begin][read][reference](time.Time) ---\n\t\td := &time.Time{}\n\t\te := buff.ReadInt()    // byte array length\n\t\tf := buff.ReadBytes(e) // byte array\n\t\terrB := d.UnmarshalBinary(f)\n\t\tif errB != nil {\n\t\t\treturn errB\n\t\t}\n\t\ttarget.end = d\n\t\t// --- [end][read][reference](time.Time) ---\n\n\t}\n\treturn nil\n}\n"}}


[Trace - 12:19:48.140 PM] Sending response 'window/workDoneProgress/create - (1)' in 26ms.
Result: 


[Trace - 12:19:48.140 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}


[Trace - 12:19:48.140 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///home/myuser/kc/bingen-file-tests","section":"gopls"},{"scopeUri":"file:///home/myuser/kc/bingen-file-tests","section":"gopls-bingen-file-tests"}]}


[Trace - 12:19:48.156 PM] Sending request 'textDocument/documentSymbol - (1)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"}}


[Trace - 12:19:48.157 PM] Sending request 'textDocument/codeAction - (2)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"},"range":{"start":{"line":9,"character":10},"end":{"line":9,"character":10}},"context":{"diagnostics":[]}}


[Trace - 12:19:48.162 PM] Sending request 'textDocument/documentLink - (3)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"}}


[Trace - 12:19:48.172 PM] Sending response 'workspace/configuration - (2)' in 31ms.
Result: [{"usePlaceholders":true,"staticcheck":false},null]


[Trace - 12:19:48.302 PM] Sending request 'textDocument/hover - (4)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"},"position":{"line":23,"character":50}}


[Trace - 12:19:48.349 PM] Sending request 'textDocument/foldingRange - (5)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"}}


[Trace - 12:19:48.396 PM] Sending request 'textDocument/codeLens - (6)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"}}


[Trace - 12:19:48.551 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/16 12:19:48 go env for /home/myuser/kc/bingen-file-tests\n(root /home/myuser/kc/bingen-file-tests)\n(go version go version go1.15.3 linux/amd64\n)\n(valid build configuration = true)\n(build flags: [])\nGOROOT=/home/myuser/sdk/go1.15.3\nGOFLAGS=\nGOINSECURE=\nGOMOD=/home/myuser/kc/bingen-file-tests/go.mod\nGONOPROXY=\nGOPROXY=https://proxy.golang.org,direct\nGOPATH=/home/myuser/go\nGOPRIVATE=\nGO111MODULE=\nGOMODCACHE=/home/myuser/go/pkg/mod\nGONOSUMDB=\nGOSUMDB=sum.golang.org\nGOCACHE=/home/myuser/.cache/go-build\n\n"}


[Info  - 12:19:48 PM] 2020/10/16 12:19:48 go env for /home/myuser/kc/bingen-file-tests
(root /home/myuser/kc/bingen-file-tests)
(go version go version go1.15.3 linux/amd64
)
(valid build configuration = true)
(build flags: [])
GOROOT=/home/myuser/sdk/go1.15.3
GOFLAGS=
GOINSECURE=
GOMOD=/home/myuser/kc/bingen-file-tests/go.mod
GONOPROXY=
GOPROXY=https://proxy.golang.org,direct
GOPATH=/home/myuser/go
GOPRIVATE=
GO111MODULE=
GOMODCACHE=/home/myuser/go/pkg/mod
GONOSUMDB=
GOSUMDB=sum.golang.org
GOCACHE=/home/myuser/.cache/go-build


[Trace - 12:19:48.551 PM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"/home/myuser/kc/bingen-file-tests/**/*.{go,mod,sum}","kind":7}]}}]}


[Trace - 12:19:48.553 PM] Sending response 'client/registerCapability - (3)' in 1ms.
Result: 


[Trace - 12:19:48.553 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}


[Trace - 12:19:48.554 PM] Sending response 'client/registerCapability - (4)' in 0ms.
Result: 


[Trace - 12:19:49.359 PM] Sending notification '$/cancelRequest'.
Params: {"id":2}


[Trace - 12:19:49.360 PM] Sending request 'textDocument/codeAction - (7)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/kc/kc_codecs.go"},"range":{"start":{"line":9,"character":10},"end":{"line":9,"character":10}},"context":{"diagnostics":[]}}


[Trace - 12:19:52.979 PM] Sending notification '$/cancelRequest'.
Params: {"id":4}


[Trace - 12:19:58.558 PM] Sending notification '$/cancelRequest'.
Params: {"id":1}


[Trace - 12:19:58.623 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go","languageId":"go","version":1,"text":"package util\r\n\r\nimport (\r\n\t\"bytes\"\r\n\t\"encoding/binary\"\r\n)\r\n\r\n// Buffer is a utility type which implements a very basic binary protocol for\r\n// writing core go types.\r\ntype Buffer struct {\r\n\tb     *bytes.Buffer\r\n\torder binary.ByteOrder\r\n}\r\n\r\n// NewBuffer creates a new Buffer instance using LittleEndian ByteOrder.\r\nfunc NewBuffer() *Buffer {\r\n\treturn NewBufferWith(binary.LittleEndian)\r\n}\r\n\r\n// NewBufferWith creates a new Buffer instance using the provided ByteOrder.\r\nfunc NewBufferWith(order binary.ByteOrder) *Buffer {\r\n\tvar b bytes.Buffer\r\n\treturn &Buffer{\r\n\t\tb:     &b,\r\n\t\torder: order,\r\n\t}\r\n}\r\n\r\n// NewBufferFromBytes creates a new Buffer instance using the provided byte slice.\r\n// The new buffer assumes ownership of the byte slice.\r\nfunc NewBufferFromBytes(b []byte, order binary.ByteOrder) *Buffer {\r\n\treturn &Buffer{\r\n\t\tb:     bytes.NewBuffer(b),\r\n\t\torder: order,\r\n\t}\r\n}\r\n\r\n// NewBufferFrom creates a new Buffer instance using the remaining unread data from the\r\n// provided Buffer instance. The new buffer assumes ownership of the underlying data.\r\nfunc NewBufferFrom(b *Buffer) *Buffer {\r\n\tbb := b.Bytes()\r\n\treturn &Buffer{\r\n\t\tb:     bytes.NewBuffer(bb),\r\n\t\torder: b.order,\r\n\t}\r\n}\r\n\r\n// WriteBool writes a bool value to the buffer.\r\nfunc (b *Buffer) WriteBool(t bool) {\r\n\tbinary.Write(b.b, b.order, t)\r\n}\r\n\r\n// WriteInt writes an int value to the buffer.\r\nfunc (b *Buffer) WriteInt(i int) {\r\n\tbinary.Write(b.b, b.order, int32(i))\r\n}\r\n\r\n// WriteInt8 writes an int8 value to the buffer.\r\nfunc (b *Buffer) WriteInt8(i int8) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteInt16 writes an int16 value to the buffer.\r\nfunc (b *Buffer) WriteInt16(i int16) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteInt32 writes an int32 value to the buffer.\r\nfunc (b *Buffer) WriteInt32(i int32) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteInt64 writes an int64 value to the buffer.\r\nfunc (b *Buffer) WriteInt64(i int64) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteUInt writes a uint value to the buffer.\r\nfunc (b *Buffer) WriteUInt(i uint) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteUInt8 writes a uint8 value to the buffer.\r\nfunc (b *Buffer) WriteUInt8(i uint8) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteUInt16 writes a uint16 value to the buffer.\r\nfunc (b *Buffer) WriteUInt16(i uint16) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteUInt32 writes a uint32 value to the buffer.\r\nfunc (b *Buffer) WriteUInt32(i uint32) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteUInt64 writes a uint64 value to the buffer.\r\nfunc (b *Buffer) WriteUInt64(i uint64) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteFloat32 writes a float32 value to the buffer.\r\nfunc (b *Buffer) WriteFloat32(i float32) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteFloat64 writes a float64 value to the buffer.\r\nfunc (b *Buffer) WriteFloat64(i float64) {\r\n\tbinary.Write(b.b, b.order, i)\r\n}\r\n\r\n// WriteString writes the string's length as a uint16 followed by the string contents.\r\nfunc (b *Buffer) WriteString(i string) {\r\n\ts := []byte(i)\r\n\tbinary.Write(b.b, b.order, uint16(len(s)))\r\n\tb.b.Write(s)\r\n}\r\n\r\n// WriteBytes writes the contents of the byte slice to the buffer.\r\nfunc (b *Buffer) WriteBytes(bytes []byte) {\r\n\tb.b.Write(bytes)\r\n}\r\n\r\n// ReadBool reads a bool value from the buffer.\r\nfunc (b *Buffer) ReadBool() bool {\r\n\tvar i bool\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadInt reads an int value from the buffer.\r\nfunc (b *Buffer) ReadInt() int {\r\n\tvar i int32\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn int(i)\r\n}\r\n\r\n// ReadInt8 reads an int8 value from the buffer.\r\nfunc (b *Buffer) ReadInt8() int8 {\r\n\tvar i int8\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadInt16 reads an int16 value from the buffer.\r\nfunc (b *Buffer) ReadInt16() int16 {\r\n\tvar i int16\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadInt32 reads an int32 value from the buffer.\r\nfunc (b *Buffer) ReadInt32() int32 {\r\n\tvar i int32\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadInt64 reads an int64 value from the buffer.\r\nfunc (b *Buffer) ReadInt64() int64 {\r\n\tvar i int64\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadUInt reads a uint value from the buffer.\r\nfunc (b *Buffer) ReadUInt() uint {\r\n\tvar i uint\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadUInt8 reads a uint8 value from the buffer.\r\nfunc (b *Buffer) ReadUInt8() uint8 {\r\n\tvar i uint8\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadUInt16 reads a uint16 value from the buffer.\r\nfunc (b *Buffer) ReadUInt16() uint16 {\r\n\tvar i uint16\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadUInt32 reads a uint32 value from the buffer.\r\nfunc (b *Buffer) ReadUInt32() uint32 {\r\n\tvar i uint32\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadUInt64 reads a uint64 value from the buffer.\r\nfunc (b *Buffer) ReadUInt64() uint64 {\r\n\tvar i uint64\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadFloat32 reads a float32 value from the buffer.\r\nfunc (b *Buffer) ReadFloat32() float32 {\r\n\tvar i float32\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadFloat64 reads a float64 value from the buffer.\r\nfunc (b *Buffer) ReadFloat64() float64 {\r\n\tvar i float64\r\n\tbinary.Read(b.b, b.order, &i)\r\n\treturn i\r\n}\r\n\r\n// ReadString reads a uint16 value from the buffer representing the string's length,\r\n// then uses the length to extract the exact length []byte representing the string.\r\nfunc (b *Buffer) ReadString() string {\r\n\tvar l uint16\r\n\tbinary.Read(b.b, b.order, &l)\r\n\treturn string(b.b.Next(int(l)))\r\n}\r\n\r\n// ReadBytes reads the specified length from the buffer and returns the byte slice.\r\nfunc (b *Buffer) ReadBytes(length int) []byte {\r\n\treturn b.b.Next(length)\r\n}\r\n\r\n// Bytes returns the unread portion of the underlying buffer storage.\r\nfunc (b *Buffer) Bytes() []byte {\r\n\treturn b.b.Bytes()\r\n}\r\n"}}


[Trace - 12:19:58.624 PM] Sending notification '$/cancelRequest'.
Params: {"id":6}


[Trace - 12:19:58.624 PM] Sending notification '$/cancelRequest'.
Params: {"id":5}


[Trace - 12:19:58.624 PM] Sending notification '$/cancelRequest'.
Params: {"id":3}


[Trace - 12:19:58.629 PM] Sending request 'textDocument/documentLink - (8)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"}}


[Trace - 12:19:58.629 PM] Sending notification '$/cancelRequest'.
Params: {"id":7}


[Trace - 12:19:58.629 PM] Sending request 'textDocument/codeAction - (9)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}


[Trace - 12:19:58.632 PM] Sending request 'textDocument/documentSymbol - (10)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"}}


[Trace - 12:19:58.782 PM] Sending request 'textDocument/foldingRange - (11)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"}}


[Trace - 12:19:58.829 PM] Sending request 'textDocument/codeLens - (12)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"}}


[Trace - 12:19:59.659 PM] Sending request 'textDocument/codeAction - (13)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"},"range":{"start":{"line":17,"character":1},"end":{"line":17,"character":1}},"context":{"diagnostics":[]}}


[Trace - 12:19:59.659 PM] Sending notification '$/cancelRequest'.
Params: {"id":9}


[Trace - 12:20:00.139 PM] Sending request 'textDocument/hover - (14)'.
Params: {"textDocument":{"uri":"file:///home/myuser/kc/bingen-file-tests/util/buffer.go"},"position":{"line":53,"character":21}}


[Trace - 12:20:00.153 PM] Sending notification '$/cancelRequest'.
Params: {"id":14}

I've tried my best to isolate the issue to a specific behavior on my end, but I've come up empty. Sometimes switching to different projects works after running Go: Restart Language Server from the Command Palette. Once in this stuck state, saving source files hangs on "Waiting for codeactions (configure)", and code completion just doesn't work (I'm assuming this is expected given the lack of responsiveness from the language server).

Would love assistance here, as it completely derails my go workflow.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 16, 2020

@adityaramani: Can you reproduce this in a public project or only in a private one? What is the output of gopls -rpc.trace -v check path/to/file.go, and how long does it take to run?

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 16, 2020

A few extra details: It does appear to only be happening in one specific workspace. I actually deleted a generated source file and fixed up some broken imports, and it eventually started back correctly after Restarting the Language Server and Reloading VS Code. I then added back the offensive file, and everything was fine.

It looks related to broken imports (referencing a different project that isn't added to go.mod). It's a private workspace which I don't feel comfortable sharing in the public bug report, but if there's another way I could share privately, I would gladly oblige if it means getting to a fix faster.

While in the "stuck" state, I ran gopls -rpc.trace -v check <offensive_file> and it responded almost instantly:

$ gopls -rpc.trace -v check kc/kc_codecs.go 
2020/10/16 13:10:29 Info:2020/10/16 13:10:29 go env for /home/myuser/kc/bingen-file-tests
(root /home/myuser/kc/bingen-file-tests)
(go version go version go1.15.3 linux/amd64
)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOINSECURE=
GOPATH=/home/myuser/go
GONOSUMDB=
GOSUMDB=sum.golang.org
GOCACHE=/home/myuser/.cache/go-build
GOFLAGS=
GOMOD=/home/myuser/kc/bingen-file-tests/go.mod
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/myuser/sdk/go1.15.3
GOMODCACHE=/home/myuser/go/pkg/mod
GONOPROXY=
GOPRIVATE=

2020/10/16 13:10:29 Info:2020/10/16 13:10:29 go/packages.Load
        snapshot=0
        directory=/home/myuser/kc/bingen-file-tests
        query=[./... builtin]
        packages=4
@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 16, 2020

If I pull back in the problematic file with a "bad import", it recreates the issue.

Hopefully providing some more useful information here. One of imports references a module that is a private github repository (in this case, it was an incorrect import designed to be a placeholder from a source generation template). I am going to try and run go get in my workspace directory to see if that actually "fixes" the issue.

The reason I bring this up because it seemed possible that the extension might try to reach out and pull in referenced packages. For private repositories, we've had to use $ git config --global url.git@github.com:.insteadOf https://github.com/ in order to ensure go get uses ssh. Total speculation, but would failure to resolve/pull a referenced package cause this?

@adityaramani
Copy link
Author

@adityaramani adityaramani commented Oct 16, 2020

I ran gopls -rpc.trace -v check <offensive_file> and again got the response instantly, here it is.

./gopls -rpc.trace -v check  /flarexfer/setup.go
2020/10/16 17:33:13 Info:2020/10/16 17:33:13 go env for /ghostcache/build_setup/flare-ws/flarexfer/bin
(root /ghostcache/build_setup/flare-ws/flarexfer/bin)
(go version go version go1.14.2 linux/amd64
)
(valid build configuration = false)
(build flags: [])
GOROOT=/ghostcache/build_setup/bzflud/go
GO111MODULE=
GOSUMDB=sum.golang.org
GOCACHE=/root/.cache/go-build
GONOPROXY=
GOPATH=/root/go
GOMODCACHE=
GOPROXY=https://proxy.golang.org,direct
GOFLAGS=
GOINSECURE=
GOMOD=
GOPRIVATE=
GONOSUMDB=

2020/10/16 17:33:13 Info:2020/10/16 17:33:13 go/packages.Load
        snapshot=0
        directory=/ghostcache/build_setup/flare-ws/flarexfer/bin
        query=[./ builtin]
        packages=2
2020/10/16 17:33:13 Info:2020/10/16 17:33:13 go/packages.Load
        snapshot=0
        directory=/ghostcache/build_setup/flare-ws/flarexfer/bin
        query=[./]
        packages=1
root@198.18.66.201:/ghostcache/build_setup/flare-ws/flarexfer/bin# 

These are the logs from my gopls (server)

[Info  - 5:30:19 PM] 2020/10/16 17:30:19 go env for /ghostcache/build_setup/flare-ws/flarexfer/src/azupload
(root /ghostcache/build_setup/flare-ws/flarexfer/src)
(go version go version go1.14.2 linux/amd64
)
(valid build configuration = true)
(build flags: [])
GOMODCACHE=
GOPATH=/ghostcache/build_setup/flare-ws/flarexfer:/ghostcache/build_setup/filename_fix/go/
GOSUMDB=sum.golang.org
GOFLAGS=
GOMOD=/ghostcache/build_setup/flare-ws/flarexfer/src/go.mod
GONOPROXY=
GOPRIVATE=
GONOSUMDB=
GOPROXY=https://proxy.golang.org,direct
GOROOT=/ghostcache/build_setup/bzflud/go
GO111MODULE=
GOCACHE=/root/.cache/go-build
GOINSECURE=


[Trace - 17:30:19.544 PM] Sending response 'client/registerCapability - (5)' in 1ms.
Result: 


[Trace - 17:30:19.544 PM] Received request 'client/registerCapability - (6)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}


[Trace - 17:30:19.544 PM] Sending response 'client/registerCapability - (6)' in 0ms.
Result: 


[Trace - 17:32:36.464 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go","languageId":"go","version":1,"text":"package flarexfer\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc SetupPaths(topdir string, paths ...string) error {\n\n\tfor _, dir := range paths {\n\t\tif !filepath.IsAbs(dir) {\n\t\t\tdir = filepath.Join(topdir, dir)\n\t\t}\n\n\t\tinfo, err := os.Stat(dir)\n\t\tif err != nil && os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(dir, 0755)\n\t\t} else if err == nil && !info.IsDir() {\n\t\t\terr = fmt.Errorf(\"invalid path %s\", dir)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc CleanupWorkDir(dst, toclean, ext string) error {\n\tdstinfo, err := os.Stat(dst)\n\tif err != nil || !dstinfo.IsDir() {\n\t\treturn fmt.Errorf(\"invalid argument: %s bad or not a dir %v\", dst, err)\n\t}\n\ttcinfo, err := os.Stat(toclean)\n\tif err != nil || !tcinfo.IsDir() {\n\t\treturn fmt.Errorf(\"invalid argument: %s bad or not a dir %v\", toclean, err)\n\t}\n\terr = filepath.Walk(toclean, func(path string, info os.FileInfo, werr error) error {\n\t\tif werr != nil {\n\t\t\treturn werr\n\t\t}\n\t\tif path == toclean || path == \".\" || path == \"..\" {\n\t\t\treturn nil\n\t\t}\n\t\tif !info.IsDir() && filepath.Ext(path) == ext {\n\t\t\treturn os.Rename(path, dst)\n\t\t}\n\t\treturn filepath.SkipDir\n\t})\n\tif err != nil {\n\t\tflog.Printf(\"failed to cleanup %v\", err)\n\t}\n\t// Will fail if we have at least one file.\n\t// Reporting failure due to not empty directory is the right thing to do here.\n\t// Even if there was an error before. The end result is directory cannot be removed.\n\treturn os.Remove(toclean)\n}\n"}}


[Trace - 17:32:36.466 PM] Sending request 'textDocument/documentLink - (1)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:32:36.467 PM] Sending request 'textDocument/codeAction - (2)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}


[Trace - 17:32:36.469 PM] Sending request 'textDocument/documentSymbol - (3)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:32:36.710 PM] Sending request 'textDocument/codeLens - (4)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:32:36.712 PM] Sending request 'textDocument/foldingRange - (5)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:32:37.021 PM] Sending notification '$/cancelRequest'.
Params: {"id":3}


[Trace - 17:32:37.022 PM] Sending request 'textDocument/documentSymbol - (6)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:32:37.162 PM] Sending notification '$/cancelRequest'.
Params: {"id":6}


[Trace - 17:32:37.162 PM] Sending request 'textDocument/documentSymbol - (7)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:36:53.675 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/16 17:36:53 go/packages.Load: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n\n\tsnapshot=0\n\tdirectory=/ghostcache/build_setup/flare-ws/flarexfer/src\n\tquery=[./... builtin]\n\tpackages=0\n"}


[Trace - 17:36:53.675 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/16 17:36:53 initial workspace load failed: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n: packages.Load error\n"}


[Trace - 17:36:53.675 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/16 17:36:53 initial workspace load failed: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n: packages.Load error\n"}


[Trace - 17:36:53.675 PM] Received notification '$/progress'.
Params: {"token":"8674665223082153551","value":{"kind":"end","message":"Finished loading packages."}}


[Trace - 17:36:53.675 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/16 17:36:53 warning: diagnose go.mod: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n: packages.Load error\n\tdirectory=/ghostcache/build_setup/flare-ws/flarexfer/src/\n"}


[Trace - 17:36:53.676 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/16 17:36:53 go/packages.Load: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n\n\tsnapshot=0\n\tdirectory=/ghostcache/build_setup/flare-ws/flarexfer/src\n\tquery=[./... builtin]\n\tpackages=0\n"}


[Trace - 17:36:53.676 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}


[Error - 5:36:53 PM] 2020/10/16 17:36:53 go/packages.Load: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1

	snapshot=0
	directory=/ghostcache/build_setup/flare-ws/flarexfer/src
	query=[./... builtin]
	packages=0

[Trace - 17:36:53.676 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///ghostcache/build_setup/flare-ws/flarexfer/src/go.mod","diagnostics":[{"range":{"start":{"line":5,"character":1},"end":{"line":5,"character":52}},"severity":1,"message":"go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n: packages.Load error"}]}


[Trace - 17:36:53.676 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/16 17:36:53 warning: diagnose go.mod: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n: packages.Load error\n\tdirectory=/ghostcache/build_setup/flare-ws/flarexfer/src/azupload\n"}


[Trace - 17:36:53.676 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///ghostcache/build_setup/flare-ws/flarexfer/src/go.mod","diagnostics":[{"range":{"start":{"line":5,"character":1},"end":{"line":5,"character":52}},"severity":1,"message":"go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1\n: packages.Load error"}]}


[Error - 5:36:53 PM] 2020/10/16 17:36:53 initial workspace load failed: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1
: packages.Load error

[Error - 5:36:53 PM] 2020/10/16 17:36:53 initial workspace load failed: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1
: packages.Load error

[Error - 5:36:53 PM] 2020/10/16 17:36:53 warning: diagnose go.mod: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.085212434.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1
: packages.Load error
	directory=/ghostcache/build_setup/flare-ws/flarexfer/src/

[Error - 5:36:53 PM] 2020/10/16 17:36:53 go/packages.Load: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1

	snapshot=0
	directory=/ghostcache/build_setup/flare-ws/flarexfer/src
	query=[./... builtin]
	packages=0

[Error - 5:36:53 PM] 2020/10/16 17:36:53 warning: diagnose go.mod: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -modfile=/tmp/go.3c2c4f92fb391b2b08514fe2d822dc4a2ec879f598973749bd099670d551fa8f.988692809.mod -- ./... builtin]: exit status 1: go: ./gomod/go-query2.git/v3@v3.0.1: reading ./gomod/go-query2.git/go.mod at revision v3.0.1: unknown revision v3.0.1
: packages.Load error
	directory=/ghostcache/build_setup/flare-ws/flarexfer/src/azupload

[Trace - 17:37:02.844 PM] Sending request 'textDocument/hover - (8)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":10,"character":15}}


[Trace - 17:37:02.956 PM] Sending notification '$/cancelRequest'.
Params: {"id":8}


[Trace - 17:37:03.789 PM] Sending notification '$/cancelRequest'.
Params: {"id":7}


[Trace - 17:37:03.789 PM] Sending notification '$/cancelRequest'.
Params: {"id":4}


[Trace - 17:37:03.789 PM] Sending notification '$/cancelRequest'.
Params: {"id":5}


[Trace - 17:37:03.789 PM] Sending notification '$/cancelRequest'.
Params: {"id":1}


[Trace - 17:37:03.789 PM] Sending notification '$/cancelRequest'.
Params: {"id":2}


[Error - Received] 17:37:03.791 PM golang/vscode-go#1 JSON RPC cancelled


[Error - Received] 17:37:03.791 PM golang/vscode-go#2 JSON RPC cancelled


[Error - Received] 17:37:03.791 PM golang/vscode-go#3 JSON RPC cancelled


[Error - Received] 17:37:03.791 PM golang/vscode-go#4 JSON RPC cancelled


[Error - Received] 17:37:03.791 PM golang/vscode-go#5 JSON RPC cancelled


[Error - Received] 17:37:03.791 PM golang/vscode-go#6 JSON RPC cancelled


[Error - Received] 17:37:03.791 PM golang/vscode-go#7 JSON RPC cancelled


[Error - Received] 17:37:03.792 PM golang/vscode-go#8 JSON RPC cancelled


[Trace - 17:37:05.388 PM] Sending request 'textDocument/documentLink - (9)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:37:05.388 PM] Sending request 'textDocument/codeAction - (10)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}


[Trace - 17:37:05.390 PM] Sending request 'textDocument/documentSymbol - (11)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:37:05.599 PM] Sending request 'textDocument/foldingRange - (12)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:37:05.604 PM] Sending request 'textDocument/codeLens - (13)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"}}


[Trace - 17:37:06.246 PM] Sending request 'textDocument/definition - (14)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":11}}


[Trace - 17:37:06.496 PM] Sending request 'textDocument/hover - (15)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":10}}


[Trace - 17:37:06.926 PM] Sending notification '$/cancelRequest'.
Params: {"id":14}


[Trace - 17:37:06.926 PM] Sending request 'textDocument/definition - (16)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":29,"character":13}}


[Trace - 17:37:06.926 PM] Sending notification '$/cancelRequest'.
Params: {"id":15}


[Trace - 17:37:07.028 PM] Sending notification '$/cancelRequest'.
Params: {"id":16}


[Trace - 17:37:07.028 PM] Sending request 'textDocument/definition - (17)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":17}}


[Trace - 17:37:07.129 PM] Sending notification '$/cancelRequest'.
Params: {"id":17}


[Trace - 17:37:07.129 PM] Sending request 'textDocument/definition - (18)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":24}}


[Trace - 17:37:07.230 PM] Sending notification '$/cancelRequest'.
Params: {"id":18}


[Trace - 17:37:07.230 PM] Sending request 'textDocument/definition - (19)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":31,"character":25}}


[Trace - 17:37:07.420 PM] Sending request 'textDocument/hover - (20)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":31,"character":24}}


[Trace - 17:37:07.446 PM] Sending notification '$/cancelRequest'.
Params: {"id":20}


[Trace - 17:37:07.642 PM] Sending notification '$/cancelRequest'.
Params: {"id":19}


[Trace - 17:37:07.642 PM] Sending request 'textDocument/definition - (21)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":23}}


[Trace - 17:37:07.886 PM] Sending request 'textDocument/hover - (22)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":22}}


[Trace - 17:37:07.917 PM] Sending request 'textDocument/documentHighlight - (23)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":22}}


[Trace - 17:37:07.918 PM] Sending notification '$/cancelRequest'.
Params: {"id":22}


[Trace - 17:37:08.060 PM] Sending request 'textDocument/definition - (24)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":22}}


[Trace - 17:37:08.176 PM] Sending request 'textDocument/codeAction - (25)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"range":{"start":{"line":30,"character":22},"end":{"line":30,"character":22}},"context":{"diagnostics":[]}}


[Trace - 17:37:08.176 PM] Sending notification '$/cancelRequest'.
Params: {"id":10}


[Trace - 17:37:10.159 PM] Sending request 'textDocument/hover - (26)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":30,"character":23}}


[Trace - 17:37:10.508 PM] Sending notification '$/cancelRequest'.
Params: {"id":21}


[Trace - 17:37:10.508 PM] Sending request 'textDocument/definition - (27)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":32,"character":21}}


[Trace - 17:37:10.508 PM] Sending notification '$/cancelRequest'.
Params: {"id":26}


[Trace - 17:37:11.474 PM] Sending request 'textDocument/hover - (28)'.
Params: {"textDocument":{"uri":"file:///flarexfer/setup.go"},"position":{"line":40,"character":14}}


[Trace - 17:37:11.661 PM] Sending notification '$/cancelRequest'.
Params: {"id":28}

And code navigation does not seem to work only on this workspace, my other workspaces seem to be working fine.

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 16, 2020

I can 100% reproduce the issue by including a source file that points to a package import from a private repository that doesn't exist in $GOPATH/pkg/mod -- Once I ran env GOSUMDB=off go get <repo> (have to turn off the checksum validation otherwise it fails), restarted the language server and reloaded VS Code, the issue no longer happens. The issue may have less strict parameters than this, but this is my exact repro case. Hopefully this sheds a bit more light on the issue.

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 16, 2020

I thought that removing this setting would actually move us forward, but it appears that's not the case.

"go.autocompleteUnimportedPackages": true,

It does appear that the existence of the source in $GOPATH/pkg/mod doesn't actually matter. As long as there were entries for the package in go.mod and go.sum the language server appeared to be happy. I tested this by removing the source package only. Issue didn't occur. However, when I removed the specific package from go.mod and go.sum the infinite code actions started happening, and reloading got me back to the stuck state at: "Setting up workspace: Loading packages..."

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 16, 2020

Thanks again for the help with this issue. I found one possibly related issue for gopls: #41962

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 16, 2020

@mbolt35: Have you tried configuring the GOPRIVATE environment variable (https://golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules)?

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 19, 2020

I've created a video response which shows basic reproduction steps, and also demonstrates an issue that I believe may be related. I apologize for the lack of brevity, as I wanted to ensure I was being clear in the cases.

https://youtu.be/b407MMruUII

@mbolt35
Copy link

@mbolt35 mbolt35 commented Oct 19, 2020

@stamblerre I had no idea that existed! Thank you very much, this will help tremendously with our workflow :)

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 20, 2020

@mbolt35: Thank you for that detailed repro! That makes things a lot clearer, we will try to investigate the issue.

@stamblerre stamblerre transferred this issue from golang/vscode-go Oct 20, 2020
@stamblerre stamblerre added this to the gopls/v1.0.0 milestone Oct 20, 2020
@stamblerre stamblerre changed the title Setting Up Workspace : Loading packages indefinetly x/tools/gopls: hangs while loading the workspace Oct 20, 2020
@stamblerre stamblerre added this to Needs Triage in vscode-go: gopls by default Nov 10, 2020
@stamblerre stamblerre moved this from Needs Triage to Critical in vscode-go: gopls by default Nov 10, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Nov 16, 2020

I've just revisited this to try to reproduce, and I'm afraid I'm not able to.
@mbolt35: Are you still able to repro this with the latest version (v0.5.3) of gopls?

The first issue that you point out is still a problem, but I think it will be addressed by #38462 (right now, we try to reload packages whenever an import statement is changed, but if we switch to GOPROXY=off, the latency will go away).

@stamblerre stamblerre moved this from Critical to In progress in vscode-go: gopls by default Nov 18, 2020
@stamblerre stamblerre moved this from In progress to Waiting for Info in vscode-go: gopls by default Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
vscode-go: gopls by default
  
Waiting for Info
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.