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.
Go R1 Day 50
- evaluate package level logging variables and how to properly use them.
- tested best way to abstract the common logging to avoid run time dependency with package level variables and impact to tests.
- read through Effective Go - The Go Programming Language - embedding
At this point, I’m still struggling with the proper way to abstract a logging wrapper that calls a logging library. There’s enough boilerplate for setup of my preferred defaults in zerolog that I want to include …
Go R1 Day 49
- Learned about White-Box vs Black-Box testing.
Apparently, you can access all indentifiers of a package if you use the same package name such as:
package packagename. If you are testing as a consumer might be, then you can use
package packagename_testfor only accessing the exported identifiers.
- Used examples in test file to provide self-documentation of how to use the method.
- Worked further with
golanglint-ciand found it challenging when working with multiple modules in …