docs(struct_tags): update

This commit is contained in:
Oleksandr Smirnov 2025-02-25 13:58:16 +02:00
parent db02180617
commit ef483bc644
No known key found for this signature in database

View file

@ -1,13 +1,15 @@
---@toc_entry Modifty struct tags ---@toc_entry Modify struct tags
---@tag gopher.nvim-struct-tags ---@tag gopher.nvim-struct-tags
---@text struct-tags is utilizing the `gomodifytags` tool to add or remove tags to struct fields. ---@text struct-tags is utilizing the `gomodifytags` tool to add or remove tags to struct fields.
---@usage - put your coursor on the struct ---@usage
--- - run `:GoTagAdd json` to add json tags to struct fields --- How to add/remove tags to struct fields:
--- - run `:GoTagRm json` to remove json tags to struct fields -- 1. Place cursor on the struct
--- 2. Run `:GoTagAdd json` to add json tags to struct fields
--- 3. Run `:GoTagRm json` to remove json tags to struct fields
--- ---
--- note: if you dont spesify the tag it will use `json` as default --- NOTE: if you dont specify the tag it will use `json` as default
--- ---
--- simple example: --- Example:
--- >go --- >go
--- // before --- // before
--- type User struct { --- type User struct {
@ -74,7 +76,7 @@ local function modify(...)
end, end,
}) })
-- decode goted value -- decode value
local tagged = vim.json.decode(table.concat(output)) local tagged = vim.json.decode(table.concat(output))
if if
tagged.errors ~= nil tagged.errors ~= nil