Comments (7)
I guess that in windows, you need to use GoRun .\\cmd
?
You need to set the path the same as you did when you run it with go run
in windows cmd.
from go.nvim.
Just tried that, same response :(
I also found out that it doesn't detect any modules. Because I thought, it should at least work inside cmd folder, but when I GoRun there, it literally does nothing. So I tried GoDebug, but the log says it doesn't detect any of the non-standard imported modules so it fails.
(Btw in the terminal I run the code with go run .
)
Nevermind, the GoRun works inside the cmd folder, it just takes way too long. GoDebug in the other hand still fails.
from go.nvim.
I think the issue is more regarding windows vs linux/Mac have different path name format
.projectRoot/cmd/main.go
does not seem to be a valid path in windows.
For debug . you may have same issue. As in dap.lua
, the code says
dap_cfg.program = "./${relativeFileDirname}"
I doubt it is valid in windows....
from go.nvim.
Okey, I have reduced the problem to the minimum creating a new golang project ./go
which file structure is:
main.go
go.mod
go.sum
pkg/sum.go
This show me a couple things, firts of all GoRun/GoDebug works only if you enter neovim inside the project folder, otherwise it doesn't matter if you run GoRun or GoRun ./go or whatever it always throw an error.
Once you open neovim inside ./go folder, GoRun works well and what remains is GoDebug.
Another thing I figured out it's that for the plugin to work you must have a global main.go with its respective go.mod and go.sum. If you have your main file and stuff inside, let's say cmd folder, again , no matter what command you run it always fails saying that it doesn't detect any of the imported modules (local or external).
¿Any ideas on how to fix / work around this? :)
from go.nvim.
In your windows command line, with old project structure, does any of this work
cmd> go run .projectRoot/cmd/main.go
cmd> go run .projectRoot/cmd/...
cmd> go run .projectRoot\\cmd\\...
cmd> go run .projectRoot\\cmd\\main.go
from go.nvim.
Yes, go run ./cmd
works perfect. And also find out what was making GoRun ./cmd
not work.
The only thing that still doesn't work is GoDebug. But you already helped so much and I think that it has more to do with nvim-dap or nvim-dap-go that what it has to do with this plugin.
Thank u for the patience! :)
You can close the issue if you feel like
from go.nvim.
link to dap issue:
mfussenegger/nvim-dap#346
from go.nvim.
Related Issues (20)
- neovim nightly changed the inlay hint api again.
- [change request] quickfix behavior when running :GoBuild HOT 2
- /usr/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:375: enable: expected boolean, got table HOT 5
- [Windows] `:checkhealth` does not report true for `GOBIN` and `GOROOT` HOT 1
- inlay_hint.lua:383: enable: expected boolean, got table HOT 2
- vim.lsp.get_active_clients() is deprecated, use vim.lsp.get_clients() instead HOT 2
- Bug: diagnostic api change not work in neovim 0.10. HOT 2
- [null-ls] failed to run generator: ...go/null_ls.lua:201: attempt to index field 'golangci_lint' (a nil value) HOT 6
- Diagnostic update in insert not working HOT 7
- gopls -debug=localhost:8080 HOT 2
- set diagnostic to `false` will be error
- vim shows import error until re-open HOT 2
- How to get highlights and injections to work with go-templates
- New? enable: expected boolean, got number HOT 2
- Provide a way to run alternate command for eg. go and go test HOT 2
- Error from InsertLeave Autocmd, codelens not supported
- 'Buffer file://<filepath> newer than edits.' when importing things on neovim nightly (0.11.0) HOT 2
- GoRun try install package run HOT 8
- How to avoid conflict with navigator HOT 3
- help finding autocomplete bug: extmark/helper text persists. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.nvim.