Go R1 Day 57
- Did some adhoc work in this repo (the hugo repo that contains this blog) testing out Mage, which is a Go based Make alternative.
- Generated dynamic target directory for hugo posts using stringify for kebab case.
- Unexpected behavior when generating dynamic file path including date.
Go R1 Day 56
- Worked on ci-cd pipelines for Go apps.
- Learned a bit more on building Azure Pipeline templates to use with Go, learning a bit from SignalFx and how they did it.
- Read more on semver versioning, and still can’t find anything as good as GitVersion
Go R1 Day 56
- Avoiding a panic in Go for missing dictionary match is very straight forward.
The error pattern for failed conversions and out of range index matches is the same, with:
ok, err := action.
- TODO: Figure out if ok to reference an error in a test by:
is.Equal(error.Error(),"unable to find value in map"). Linter warns me with:
Method call 'err.Error()' might lead to a nil pointer dereference.
- Started work with dependency injection.
My Goland Log
This is a log of my second journey in using Goland from Jetbrains for Go development.
I’ve got VSCode in a great state. It’s flexible, powerful, and I’ve highly customized it to my workflow.
However, doing Go development, I’d like to better explore Jetbrains Goland and see if the experience proves positive.
I’ll log updates and issues here as I work through it in the hope that it might provide you better information if you are considering Goland as well. …
Go R1 Day 55
In Go, when you call a function or a method the arguments are copied. 1
- Built some test cases for working with pointers and test methods.
- Did this in Goland to become more familar with it and figured out how to use the nice tests explorer with a floating window to auto-test.
- Built a filewatcher configuration watcher as alternative to tests panel, allowing automated run in terminal or output panel of
go test ./....
- Couldn’t figure out how to run every test in project, as …
Go R1 Day 54
- worked with tests and Goland.
- Modified table driven tests to remove hard coded test case inputs.
Steampipe Is Sql Magic
Up And Running In Minutes
I tried Steampipe out for the first time today.
I’m seriously impressed.
I built a project go-aws-ami-metrics last year to test out some Go that would iterate through instances and AMIs to build out aging information on the instances.
I used it to help me work through how to use the AWS SDK to iterate through regions, instances, images, and more.
In 15 mins I just solved the equivalent issue in a way that would benefit anyone on …
Go R1 Day 53
- Troubleshooting on:
typechecking loopthat helped me learn a bit more on how the compiler parsing occurs. Quick fix was to simply change
var logger *logger.Loggerto
var log *logger.Logger.
- Read up on dependency injection concepts and clean architecture design.
Go R1 Day 52
- published extension pack for Go1
- Learned about magic number linter in
golanglint-ci. For instance this would be flagged as a bad practice (while not applicable for a simple test like this, having a const makes sense in almost all other cases).
- Learned a few extra linter violations and how to exclude including:
lll: for maximum line length
packagetest: for emphasizing blackbox testing. …
My First Vscode Extension Pack for Go
Took a swing at creating my own extension pack for Go.
This was a good chance to familarize myself with the eco-system and simplify sharing a preset group of extensions.
Setup the repo with a
Taskfile.yml to simplify running in the future.
If frequent updates needed to happen, it would be easy to plug this into GitHub actions with a dispatch event and run on demand or per merge to main.
Here’s the marketplace link if you want to see what it …
Go R1 Day 51
- Did iteration exercise, however, I skipped ahead and did
strings.Repeatinstead of iteration because I’m lazy. 😀
- Moved all tests into blackbox test packages.
- Worked through variadiac functions.
- Tweaked my VSCode autotest to run on save.
- Further tweaks to
golanglint-cito reduce noise on linting checks.
Use Driftctl to Detect Infra Drift
For multiple states, you’ll need to adapt this to provide more
--from paths to ensure all state files are used to identify coverage.