😰 Mood: Frantically refreshing the live race results every hour on the hour for Big’s Backyard Ultra. Currently 5 people left who have run 241 miles.

📚 Reading Github Issues

I read the 30 new issues since Thursday.

  • Two were about fuzzing: 1, 2. Both looks do-able, but I already have an open PR for a go fuzz fix. I don’t want to pick up more work until my previous work is reviewed.
  • There was one about testable examples not working properly IRL (but passing tests) with local files. Looked intersting, but it sounds like the author wants to handle it.

👀 What to work on next?

I started out feeling aimless today. Last week I got frustrated with the lack of documentation around go assembly. I did find assembly interesting and I could look more into a different assembly language, but I feel like I am straying further and further from the point of this sabbatical.

I wrote some testable examples for some functions in the net package (1, 2) just to give me something productive to do that wouldn’t take much time.

Then I started looking through the issues marked “help wanted”. Maybe you’ve wondered why I didn’t start here in the first place? Well, it turns out that most of the issues labeled “help wanted” already have fixes submitted. I would estimate 9/10 of the issues that I think look interesting based on their title are already complete. This is a sucky (my editor claims this is spelled ‘suckey’???) user experience, which is why I have been gravitating towards the new issues everyday.

đŸ„ș Go, please

Eventually after sifting through pages of “help wanted” issues, I found this one from March 2021. It is about the code formatting suggestions that you get via gopls in your code editor. The feature is to add a “fix all” option when you highlight a section. This is one of the (many) areas of go that I am unfamiliar with; seems like there could be some fun digging here.

My ideal next steps are:

  1. Duplicate the example in the github issue
  2. Find some gopls logs
  3. Figure out how to use a local version of gopls
  4. Fix it

đŸŽ„ Even before those steps, you know I had to watch some videos

I learned:

  • Gopls is a language server that follows the Language Server Protocol (LSP).
  • Before gopls all the editors called out to the tens of go tools to do the different editor-y things you and I love (goto definition, autocomplete, etc). This means lots of integration points and lots of breakage.
  • Now every editor can speak to the gopls via a standard API.
  • Now gopls can handle all of the logic of knowing if you are using modules or not.
  • Now gopls is maintained by the go team and is thoroughly tested.

đŸ‘Żâ€â™€ïž Step 1: Use gopls to duplicate the issue

I use vim for 95% of my text editor needs. I even write this blog in vim. I am terrified of messing up my vim config, so I will not be testing this out with vim. I decided to try it out with sublime. I installed sublime, immediately had problems, finally figured out that they are because I used mv to move the application into the application directory instead of finder and that somehow screws things up? Then I had tons of problems getting it to use gopls. Okay. Scrap sublime. Let’s try VSCode!

Wwith a few button clicks VSCode “just worked” with gopls.

  • I duplicated the example in the github issue 👈 this was step 1!
  • I enabled trace logging for gopls and found the logs 👈 this was step 2!
  • Got a cool debug server up for gopls that has a ton more debug information (reference guide)

Tomorrow I will try to get my own local version of gopls running.