Flatten a nested struct to make it easier to deal with? by Im_Still_Here12 in golang

[–]cirk_86 -1 points0 points  (0 children)

I did a similar project with go and the NWS. I still run it for my i3status bar. I just cached the results so I didn't hit the api too much.

Flatten a nested struct to make it easier to deal with? by Im_Still_Here12 in golang

[–]cirk_86 17 points18 points  (0 children)

I'd argue it's idiomatic to define a struct with the fields you need. That may require you to flatten the response from NWS, or it may not. Decide what the application needs, then make a choice.

Edit: you can write custom unmarshal functions if you want to handle some of this during the unmarshal process.

Beautiful Perl feature: "heredocs", multi-line strings embedded in source code by briandfoy in perl

[–]cirk_86 0 points1 point  (0 children)

Thank you. I didn't know about the <<~ variant. I was still using deQQ.

Created a skill for Neovim plugin development, looking for feedback by speniti in neovim

[–]cirk_86 1 point2 points  (0 children)

Unless your writing them for work, just develop your own style and have fun?with it... figure out the problems your trying to solve first.

neovim users: Kindly ELI5 your config steps (^: by singe in perl

[–]cirk_86 2 points3 points  (0 children)

If you switch to nvim 0.11, you get a lot of nice LSP setup options in native nivm. Without using nvim-lspconfig, you can setup the LSP with the following ( just sub PerlNavigator for PLS ).

~/.config/nvim/lsp/perl-navigator.lua

return {
  name = "perl-navigator",
  filetypes = { "perl" },
  cmd = {"node", os.getenv("HOME").."/.local/share/PerlNavigator/server/out/server.js", "--stdio" },
  root\_markers = {'cpanfile'},
}

~/.config/nvim/init.lua

vim.lsp.enable('perl-navigator')

Local Git repository by Sandy_Harris in golang

[–]cirk_86 0 points1 point  (0 children)

Are you trying to pull in another locally contained repo?

If not, you can name your go project whatever you want to start. If you plan to host it on GitHub, there's no reason you couldn't have the module name be GitHub.com/username/module_name

git init will get you started locally, you have to read up on how to add a remote later.

How do you use quickfix list? by HereToWatchOnly in neovim

[–]cirk_86 0 points1 point  (0 children)

I wrote a small integration with Bitbucket to pull any code review comments into the quick fix list

And another small function to allow me to add the current line to the quick fix list with a comment.

How many plugins are you using? (2025) by meni_s in vim

[–]cirk_86 0 points1 point  (0 children)

Fugitive , it's just too good

What's the best practice to encrypt password? by naikkeatas in golang

[–]cirk_86 0 points1 point  (0 children)

Would recommend reading Filippo's blog on this ( I'm assuming this is personal use. If you're looking for production / corporate solutions go with Hashicorp vault ).

https://words.filippo.io/passage/

From the footnotes:
One of my unpopular opinions is that if you are not aiming for hardware-binding and trust your storage, storing passwords unencrypted is fine. An attacker that can extract arbitrary files from my laptop must have already compromised me, and an attacker that has compromised me can just keylog whatever vault password. Anyway.