docs(iferr): add docs
This commit is contained in:
parent
3f07f03117
commit
beed143e64
3 changed files with 16 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ Table of Contents
|
|||
Modifty struct tags................................|gopher.nvim-struct-tags|
|
||||
Auto implementation of interface methods..................|gopher.nvim-impl|
|
||||
Generating unit tests boilerplate......................|gopher.nvim-gotests|
|
||||
Iferr....................................................|gopher.nvim-iferr|
|
||||
Setup `nvim-dap` for Go......................................|gopher.nvim-dap|
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
|
@ -191,6 +192,14 @@ you can do it with:
|
|||
if you choose to install `gotests` within neovim, i recommend adding it to your `build` section in your |lazy.nvim|
|
||||
|
||||
|
||||
==============================================================================
|
||||
------------------------------------------------------------------------------
|
||||
*gopher.nvim-iferr*
|
||||
if you're using `iferr` tool, this module provides a way to automatically insert `if err != nil` check.
|
||||
Usage ~
|
||||
execute `:GoIfErr` near any err variable to insert the check
|
||||
|
||||
|
||||
==============================================================================
|
||||
------------------------------------------------------------------------------
|
||||
*gopher.nvim-dap*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
---@toc_entry Iferr
|
||||
---@tag gopher.nvim-iferr
|
||||
---@text if you're using `iferr` tool, this module provides a way to automatically insert `if err != nil` check.
|
||||
---@usage execute `:GoIfErr` near any err variable to insert the check
|
||||
|
||||
local c = require "gopher.config"
|
||||
local iferr = {}
|
||||
|
||||
-- That's Lua of vimscript implementation of: github.com/koron/iferr
|
||||
-- That's Lua implementation: github.com/koron/iferr
|
||||
function iferr.iferr()
|
||||
local boff = vim.fn.wordcount().cursor_bytes
|
||||
local pos = vim.fn.getcurpos()[2]
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ local files = {
|
|||
"lua/gopher/struct_tags.lua",
|
||||
"lua/gopher/impl.lua",
|
||||
"lua/gopher/gotests.lua",
|
||||
"lua/gopher/iferr.lua",
|
||||
"lua/gopher/dap.lua",
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue