Carl Johnson

blog.carlmjohnson.net · Personal blog · on HN since 2016

Carl Johnson is a Go programmer who writes about Go tooling, CLI design, web development, and programming history.

What HN saysHN commenters recommend his Go CLI architecture advice, praise his go:embed guide, and cite his argument against Gitflow.
23HN people shared it
7linked it in comments
33stories submitted
863story points
3 years agolast shared
2016people per year2026

Most-shared posts

  1. 1
  2. 2
    I wrote my own Go HTTP client
    3 people · 7 points · first shared 2021 · discussion on HN
  3. 3
    How to use go embed
    3 people · first shared 2021
  4. 4
    Three Minor Features in Go 1.18
    2 people · 226 points · first shared 2021 · 90 comments on HN
  5. 5
  6. 6
    Ten Years of “Go: The Good, the Bad, and the Meh
    2 people · 4 points · first shared 2023 · discussion on HN
  7. 7
    Dropping Support for IE11 Is Progressive Enhancement
    2 people · 4 points · first shared 2020 · discussion on HN
  8. 8
    The failed promise of Web Components
    2 people · 3 points · first shared 2020 · 3 comments on HN
  9. 9
  10. 10
    What’s New in Go 1.19?
    1 people · 53 points · first shared 2022 · 16 comments on HN
  11. 11
    Even More Minor Features in Go 1.18
    1 people · 3 points · first shared 2022 · discussion on HN
  12. 12
    Major standard library changes in Go 1.20
    1 people · 2 points · first shared 2023 · discussion on HN
  13. 13
    A Wizard Did It
    1 people · 2 points · first shared 2016 · discussion on HN
  14. 14
    Online Tracking Is Bad for Advertisers
    1 people · 2 points · first shared 2017 · discussion on HN
  15. 15
    Would you fund this grant proposal?
    1 people · 2 points · first shared 2021 · discussion on HN

What HN people wrote when they linked it

bokwoon · 2020-07-05
One of my favourite abstraction advice comes from this article: https://blog.carlmjohnson.net/post/2020/go-cli-how-to-and-advice. "You want one layer to handle user input and get it into a normalized form. You want one layer to do your actual task. And you want one layer to handle formatting and output to the user. Those are the three layers you always need." The "do the task" layer can be abstracted again further. But starting it off as a monolithic layer, separated from input and output, is always the right call.
earthboundkid · 2020-03-05
I recommended avoiding Gitflow back in 2018: > There are more complicated systems for branching like Git flow that have a separate “develop” branch and distinguish between “features” and “hot fixes”. These systems are fine if they fit your use case, but if a project releases code quickly, the level of complexity involved in Git Flow is unnecessary. > Ideally, branches should be short lived. One strategy to allow merging a branch before a large feature is fully completed is to create a feature flag that lets the production system have the new code in it but in an inactive state. https://blog.carlmjohnson.net/post/2018/git-gud/
5e92cb50239222b · 2022-11-11
It's a bit more advanced than what Rust macros provided last time I checked. You can shove whole directories in there and then traverse them or serve as static resources with pretty much one line of code. Random blog post with a few examples: https://blog.carlmjohnson.net/post/2021/how-to-use-go-embed/
xaduha · 2021-10-27
Only tangentially related, but go:embed is pretty neat https://blog.carlmjohnson.net/post/2021/how-to-use-go-embed/
daoman · 2021-08-25
Yes, and it's super easy to do nowdays with embed since Go 1.16 https://blog.carlmjohnson.net/post/2021/how-to-use-go-embed/
kaushalmodi · 2018-06-12
I use this technique for cache busting with Hugo: https://blog.carlmjohnson.net/post/2017/hugo-asset-pipeline/. I am not a web developer, so have translated that flow to a simple Bash script which I run on Netlify. Hugo v0.43 has inbuilt cache busting on the roadmap, and Hugo v0.42 will probably be released in about a week.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close