update Goiferr and doc

pull/21/head
ray-x 3 years ago
parent b566782f4a
commit af37cb81b8

@ -76,14 +76,24 @@ require("go.format").gofmt()
require("go.format").goimport()
```
## Auto fill struct
## Auto fill
Note: auto fill struct also supported by gopls lsp-action
| command | Description |
| ----------- | ----------- |
| GoFillStruct | auto fill struct |
| GoFillSwitch | fill switch|
| GoIfErr | Add if err|
```go
package foo
import "io"
func Foo() (io.Reader, error) { // the cursor on this line to add if err statement
}
```

@ -65,7 +65,7 @@ function go.setup(cfg)
vim.cmd([[command! GoClearTag lua require("go.tags").clear()]])
vim.cmd([[command! GoCmt lua require("go.comment").gen()]])
vim.cmd([[command! GoRename lua require("go.rename").run()]])
vim.cmd([[command! Goiferr lua require("go.iferr").run()]])
vim.cmd([[command! GoIfErr lua require("go.iferr").run()]])
vim.cmd([[command! GoFillStruct lua require("go.reftool").fillstruct()]])
vim.cmd([[command! GoFillSwitch lua require("go.reftool").fillswitch()]])

Loading…
Cancel
Save