Skip to content

posts🔗

Go R1 Day 53

progress

  • Troubleshooting on: typechecking loop that helped me learn a bit more on how the compiler parsing occurs. Quick fix was to simply change var logger *logger.Logger to var log *logger.Logger.
  • Read up on dependency injection concepts and clean architecture design.

Go R1 Day 52

progress

  • 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).
func Perimeter(width float64, height float64) float64 {
    return 2 * (width + height)
}
  • Learned a few extra linter violations and how to exclude including:
    • lll: for maximum line length
    • packagetest: for emphasizing blackbox testing.
    • gochecknoglobals: for ensuring global variables aren't used
    • nlreturn: for returning without a black line before. That's a "nit", but nice for consistency (though I'd like to see this as an autoformatted rule with fix applied.)

feat: structs-methods-and-interfaces -> initial functions without str… · sheldonhull/learn-go-with-tests-applied@be9ce01 · GitHub

My First Vscode Extension Pack for Go

Took a swing at creating my own extension pack for Go.

:(fab fa-github fa-fw): sheldonhull/extension-pack-go - GitHub

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 looks like: Marketplace - extension-pack-go

I could see this process being improved in the future with GitHub only requirements. At this time, it required me to use my personal Azure DevOps org to configure access and publishing.

Resources

Publishing Extensions

Go R1 Day 51

progress

  • Did iteration exercise, however, I skipped ahead and did strings.Repeat instead 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-ci to reduce noise on linting checks.

r1-d51-code-coverage

Commits

Use Driftctl to Detect Infra Drift

Use Driftctl to detect drift in your your infrastructure. This snippet generates a html report to show coverage and drift figures of the target.

For multiple states, you'll need to adapt this to provide more --from paths to ensure all state files are used to identify coverage.

$S3BucketUri = "terraform-states-$AWS_ACCOUNT_NUMBER/$AWS_REGION/$TERRAFORMMODULE/terraform.tfstate"
$Date = $(Get-Date -Format 'yyyy-MM-dd-HHmmss')
$ArtifactDirectory = (New-Item 'artifacts' -ItemType Directory -Force).FullName
&docker run -t --rm `
    -v ${PWD}:/app:rw `
    -v "$HOME/.driftctl:/root/.driftctl" `
    -v "$HOME/.aws:/root/.aws:ro" `
    -e "AWS_PROFILE=default" ` # Replace this with your aws profile name if you have multiple profiles
    cloudskiff/driftctl scan --from "tfstate+s3://$S3BucketUri" --output "html://$ArtifactDirectory/driftctl-report-$Date.html"

Optionally, you can adjust to recursively scan the state file of an entire bucket (say if using Terragrunt to store in special key prefixes).

  • Change to --from "tfstate+s3://mybucket/myprefix" without requiring the full path to a single tfstate file.
  • Recursively search if in many subfolders with: **/*.tfstate.

Go R1 Day 50

progress

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 a wrapper to organize this and return the logger.

This tends to look like:

type Logger struct {
  Logger *zerolog.Logger
}

This results in a pretty lengthy call with logger.Logger.Info().Str("key", "value").Msg("message"). I'm also having issues with the embedded logger not returning the correct methods transparently back to the caller.

I've tested with internal/logger and pkg/logger with similar issues. This one I'll have to come back round to.

Go R1 Day 49

progress

  • 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_test for only accessing the exported identifiers.
  • Used examples in test file to provide self-documentation of how to use the method.
  • Worked further with golanglint-ci and found it challenging when working with multiple modules in subdirectories. The go eco system systems simplest with one repo = one module. While mono-repos can work, the CI tooling isn't quite as intuitive to setup. VSCode requires experimental support for multiple modules as well at this time.

How To Reduce Noise From Slack

Noise

Slack can be a really effective tool with asynchronous work, but the defaults aren't great out of the box.

I want to get you a few tips on how to use Slack effectively.

Piping through release notifications, work-item updates, alerts and more can help you reduce context switching with other tools, but without proper control you'll likely find it overwhelming.

Sections

Use sections to organize your content and customize the level of priority you want to assign to the grouped channels.

This is for paid plans. This guide assumes you are on company plan with those features.

Slack Sidebar Section

Individual Channel Settings

Reduce noise from busy channels, especially when folks over-use @here

Individual Channel Settings

Configure settings (especially in automated or busy rooms) to:

  • mute notifications
  • mute @here if this is not properly used in the room.
  • You'll still get notified if your name is mentioned, but otherwise the channel won't keep showing up as needing your attention.

Change Section Behavior

Change To Unread Only

  • Sort by recent activity
  • Set your section to only show unreads + sort by recent updates. This will keep your sidebar very simple and clean, autohiding after it's been read.

Flag Keywords

If someone forgets to mention your name with the @Me syntax, you can set your name as a keyboard to alert on as a backup.

I set sheldon as a keyword, and it helps ensure I get notified even if the alert, message, response didn't properly format my name in the message or by the app integrations (very few map to user id properly).

Use All Unreads

From your settings for the sidebar, enable the All Unreads section. This can help you quickly review all channel activity in a single pane similar to an email inbox.

Shortcuts

A couple basic shortcuts will set you up to use Slack effectively.

For Windows, typically replace cmd with ctrl.

Action Keyboard
cmd+k Quick switcher for channels and conversations. Don't leave anything pinned you don't need to by using this to flip
cmd+/ Keyboard shortcut reference panel
cmd+left cmd+right Navigate similar to a web browser back or forward to whatever converation or channel you were looking at.
cmd+up edit the last message (if you are focused in the textbox)
option+shift+down go to next unread channel (or use allunreads)

Downtime

Make sure to update your notification window to allow for uninteruppted deep work.

Go R1 Day 48

progress

  • worked through more test concepts with learn-go-with-tests, including test helpers.
  • enjoyed the results GitHub copilot was producing. I can see a lot of promise for speeding up things and reducing the need for snippets as it builds code suggestions on the fly with far more context than a general snippet could do.

GitHub Copilot being helpful

r1-d48-multi-lang

Luminar AI

{{< admonition type="Note" title="Update" open="true">}}

Customer service bumped my older version of Luminar 3 to 4. The issues with distortion on the preview screen aren't there with version 4.

The new AI enhancements aren't there, so it's missing some of the new features. For now I'm going to try and use this as my daily driver for images and see how it goes.

Positive experience so far, though I still miss the fluid experience of Lightroom's preview modes.

{{< /admonition >}}

My Credentials

None. 😀

I'm a software engineer working with AWS mostly.

I'd be considered a "prosumer" with video and photography, in that I use high quality gear when possible, have comfort with professional video editing software, and have used Photoshop, Lightroom, Gimp, and other tools of a similar nature.

This is a quick review from someone who found Lightroom to overall a freeing experiencing in photography workflow.

For my occasional usage, I'm not excited to pay the subscription fee, so my Lightroom 6 standalone license is all I've continued with.

Scope

  • Casual impressions only.
  • This is not in-depth review from a photography specialist.
  • My focus is:

    • user experience
    • application stability
    • lock-in
    • library management (the one thing Lightroom seems to do better than any other app I've tried)

First Look

The very first look of the library view was pretty bad.

I'm not certain what's going on, but the raw file previews in the library view loaded in a way that made my daughter look like she was being viewed through one of those warping mirrors.

2021-05-24-16.46.05-Luminar AI

The library management workflow was pretty snappy, so I was overall happy with that.

I do miss Lightroom Survey view, but no other app has had that kind of compare interface that I've discovered so far.

Templates

The template presets for portrait did well out of the gate.

I was even able to enhance the eyes and change the color of the eyes completely with a few clicks.

A few preset adjustments such as "Face AI" allowed editing the light on the face to help brighten just the face without any need to mask.

Editing

🔳 Many of the AI powered tools were gimmicky to me.

🔳 Mystical, Glow, Dramatic, all tended to be pretty over the top when max, though perhaps a little touch of each might work.

✅ The composition auto leveler was nice.

✅ Enhance tool was subtle and tasteful

✅ The ability to apply a preset then jump tweaking the presets applied changes was intuitive and well done.

✅ The erase tool did great at removing a sign from a brick wall with seconds of effort.

Overall Verdict

Overall good quick intuitive workflow.

Value propisition is more difficult to determine.

I had Luminar 2018 and Luminar 3. Both weren't a great experience on the PC and never really got much value from them.

I could see this being a viable raw editing workflow for me though, considering the overall license cost would be significantly less than many other competitors.

2021-05-24-18.20.37-Luminar AI