-
Comparing the “default” aesthetics the agents use for a vibe-coded Golang Wails GUI app is quite interesting. Claude seems to be a real minimalist here: you get the developer UI and that’s it. GPT seems to forget it’s building a GUI app, and adds unnecessary page banners everywhere.
-
π Vibelog
UCL Build
A bit of fun using Astra to make a Make-clone that uses UCL as the receipt syntax. Continue reading β
-
I had a bit more of a think about that Unsung post about responsive code blocks. Apparently there exists a package which can format Go code assuming a certain width. It can also adjust the tab width and reflow comments and method calls. I asked GPT-6 Astra Light to build a quick playground for me to test it:
Prompt to Astra
In webtools is a set of basic web-tools. I would like you to add a new tool for testing out golines, shown here: github.com/golangci/… There should be a package version of this called shorten, documented here: pkg.go.dev/github.co…
What I’m thinking is a new tool which takes as input a Go program. It will use shorten to format the Go input and render it as output. There should be a slider allowing the user to adjust the Config.MaxLen (min width = 40, max width = 180, step = 5). Other config should be as follows:
- TabLen = 4, unless MaxLen < 80, then 2
- ShortenComments = true
- ReformatTags = true
- ChainSplitDots = true
Try to produce a WASM target for this, much like some of the other tools in this project.
It was my first test of Astra actually, and I was quite happy with what it produced:
Anyway, adding something like this for Go code on this site might be viable. My current thinking is adding a module to Blogging Tools which would allow me to copy-paste a Go snippet, which would then be formatted four different ways, based on the assumed client width. I don’t know how that would appear on the site though. Probably one code block which would assume a baseline width, and some JavaScript or CSS which would replace it with something more size appropriate. I’ll also need to work with RSS and PageFind indexing. I’ll have to have a think about that.
-
π Vibelog
MD Treatment - Trying Out Pi and Kimi k3
I’m moving markdown files from an Obsidian vault to a private Hugo site, and I needed something that did text transformations. And these were text transformations that would’ve beenβ¦ well, not difficult to automate, but annoying to automate. The transformations themselves would be easy, it’s just knowing where to apply them. Context is important, and I was not confident that a simple pattern matcher would’ve picked up or applied the transformations correctly.
Continue reading β -
Hey, Go 1.27 has been released. That’s awesome. And what a release! Some pretty cool things I’ve been wanting for a while have been added to the language. Looking forward to getting my hands dirty with these. π
-
The most common integer type in Go is
int, and 90% of the time, it should be the one to use. There are some QoL issues with usinguint: values show up as hex in the debugger, linter complains about overflows. A 64 bit unsigned int is overkill for a retry count that’s likely to be less than 10. -
Musings Of Faking a REST-API Client in Server-Side Rendered Templates
Proponents of server-side rendering question whether a well-defined API can also work effectively with server-side templates, suggesting an approach where Go handlers serve both needs without requiring actual server round-trips. Continue reading β
-
TIL that Go’s formatter will be fine formatting a file with a composite literal for a slice, yet the Golang CI linter will complain about it and simply say the file is not fomatted:
// gofmt will be fine with this, but not golangci-lint myValues := []myType{ myType{ Foo: 1, Bar: 2 }, myType{ Foo: 3, Bar: 5 }, }So when you find you find yourself seeing a linter complain that a file that’s not formatted when it seems to be (maybe via an auto-format on save feature), try removing the redundant type name:
myValues := []myType{ { Foo: 1, Bar: 2 }, { Foo: 3, Bar: 5 }, }Maybe this is what the
-sswitch ofgofmtdoes (I haven’t checked). If so, I’m not sure why this switch is not set/available ingo fmt. -
Turns out I’m in the weights. They know I’m a software engineer, but not much more than that. Hilariously, Claude and Gemini think I’m a Swift developer and contributor. I guess the models have a problem recognising Go as a proper noun (or there’s a Leon Mika out there that’s a legendary Swift dev).
-
I’ve found myself using PTAL at work, as a shorthand for “please take another look.” And it doesn’t seem to be a very common shorthand in the circles I work in: I’m usually asked what I mean. Is it a well-known shorthand in other circles? The US, maybe? I picked it up from the Go project.
I’ve never so badly wanted to add a poll to this site until today.
-
I do wonder if the broader Go community would adopt the new UUID package. It’s purely additive so it’s not like they need to, but the strength of any one library package depends on how many people use it. There’s a lot of network effects involved. I definitely will make use of it, but if database client don’t, it will be quite disappointing.
I feel like they would though. There is some precedent of Go developers adopting new language features, such as threading
context.Contextcalls throughout the call graph. So my hopes are high. -
I wish Go’s errgroup returned all the errors from the go-routines, not just the first one. It’s inherently leads to race conditions: I’ve lost useful error details because the error return is from the context being cancelled due to an error, not the error itself. Makes debugging difficult.
-
Still wishing for enums in Go. And now, after looking at a piece of code feating optional pointer types, I wished Go had unions too. In fact, Go should just bite the bullet and implement algebraic data types already, a.la. Haskell. But would it still be Go if they did?
-
Amusing to find myself being roped into a release ofβ¦ something, that needs to go out this week. Not entirely sure what needs to go out, and I don’t think anyone else does either. But damnit, it must be released by Friday!
-
Found this gem of a remark in the documentation of Go’s time formatting string:
It is a regrettable historic error that the date uses the American convention of putting the numerical month before the day.
Yeah, kind of wish we learnt from history on this one. πΌ
-
TTL that h2c, the Go HTTP handler that allows for unencrypted HTTP/2 connections, does not do graceful shutdowns. When you call
http.Shutdown()on a server using this hijacking handler, instead of draining the active request, it just kills the server. The good news is that it’s now deprecated in favour of http.Protocols, which doesn’t have this problem. -
π Blain Smith: Just Fucking Use Go
There are not enough “this"es in the English language I can add in support for this post.
-
Might be time to take another look at Zed. Got Go properly setup in it and used it to fix a small bug. I have to do something about the font, but it feels pretty featureful compared to the last time I looked. Shows some decent promise.
-
A gentle reminder that just because you have a coding agent, doesn’t mean everything needs to go through the coding agent. If something can achieved using a traditional command invocation, just use that. It’ll burn zero tokens and would end up being faster in the long run.
-
Could Swift's Guard Statement Work in Go?
Exploring the idea of a
guardstatement in Go reveals significant challenges and limitations compared to its implementation in Swift. Spoilers: it probably wouldn’t work. Continue reading β -
π Devlog
Imagen
A personal playground with image generation models (not related to Google’s Imagen model). Continue reading β
-
π οΈ Sky β an Elm-inspired language that compiles to Go
Kind of striking seeing Go becoming the target of other languages. Here’s another one. Looks a bit like Haskell to my eyes.
Via: Hacker News
-
π οΈ Lisette β Rust syntax, Go runtime
A little language inspired by Rust that compiles to Go
This looks really interesting.
-
It looks like Go’s getting a UUID package added to the standard library. Someone’s been reading my mind, or at the very least reading my blog. π
-
My Coolify instance has been running really slowly over the last few days. I may start looking at alternatives, or maybe go back to using Dokku.
-
Go iterators don’t have a built in way to send errors back, so I borrowed something from Haskell and made a “maybe” type:
type Maybe[T any] { Value T Err error } func (m Maybe[T]) Get() (T, error) { return m.Value, m.Err }The iterator pushes values wrapped in this, which would have
Valueset if one is available, orErrset if not. TheGet()method provides a convenient way to get both, allowing for patterns that look much like the following:func consume() error { for m := range myIter() { val, err := m.Get() if err != nil { return err } } doThingWithVal(val) } -
Had a go (heh) at making a Go iterator. It was simpler than I expected, once I got my head around how they work. It’s a push model, the iterator pushes value to a yield function, which sends it to
range, and receives a flag on whether to continue. The package docs do a good job explaining this. -
A bit frustrating that I asked my IDE to rename all instances of a method, and it did around half of them, ignoring the interfaces the type implements. I know Go interfaces are different to Java interfaces, but if the type checker passes already, rename things such that it remains that way.
-
Reason Go should add enums number 5,132: you’re not left up to runtime checks to verify that an enum value is invalid. You can rely on the type system to do that. It’s all well and good to implement marshallers and unmarshallers that verify that the input is a valid enum value, but that doesn’t stop developers from casting any arbitrary string to your enum type. And then what are you expected to do in your String() method (which doesn’t return an error)? Do you panic? Return “invalid?” Return the string enum value as is, even if it is invalid?
Making it impossible to even produce invalid types is the whole reason why we have a type system. It’s why I prefer Go over an untyped language like Python and JavaScript. So it would be nice if Go supported enums in the type system to get this guarantee.
-
Added my π to the other 192 on this Go proposal to add generics to methods. Great idea! I’ve been wishing for this for a while.
-
It’s so satisfying seeing the run of a large Go test suite reveal itself as a tree when executed in an editor. IDEs should lean into this, allowing execution of subtests to any depth (not just the top + 1 level), and offering features like find.
-
π Devlog
An API For a Keyframe Animation Package
A Go-based key-frame animator for Ebitengine projects was developed, emphasizing a clear API for animating float values with room for future enhancements. Continue reading β
-
Achievement unlocked: setting up a CI/CD pipeline the builds a Go WASM project and deploys it to Netlify that worked first try.
-
π Devlog
Blogging Tools - Image Collections Triage App
Using Google Antigravity to add an improved image triaging feature for Blogging Tools, allowing the user to categorise images from posts and automate header image updates. Continue reading β
-
Kind of crazy seeing Go packages which are effectively WASM builds of C libraries running in a Go WASM runtime, like this sqlite3 port. So that’s WASM sandwiched between two layers of Go. A “WASM smash burger,” if you will. Still, if you want to avoid using Cgo, then I can understand the motivation.
-
Interesting development in the world of Go: in 1.26, the new() function will now accept expressions, not just types. This returns a pointer to the value, which will be useful for those types that use pointers for their fields:
type User struct { Age *int } user := User{} var age int = 10 user.Age = new(age)It also works for literal values, so that temporary
agevariable is strictly not necessary, although the linked post does state that it requires some consideration for types. Havinguser.Age = new(10)will work without issue asnewwill return a*int; but ifAgewere a*uint, you’ll get a type error.I go on about unnecessary pointer types in the past (and will probably continue to do so in the future). To me, it’s just one of those paper-cuts you encounter in your day to day that you know can be made easier. So I consider this a welcome change. It’s not going to same me a ton on code, but every little bit helps.
-
Learning To Like Sentinel Errors In Go
Coming around to returning a result or an error in the Go programming instead of returning nil for both. Continue reading β
-
π Devlog
Dequoter β Something Different Today
A new project called Dequoter was started to unquote a JSON string and filter it, utilizing Go for backend functionality and HTML for the frontend. Continue reading β
-
π GitHub: Gopher Hawaiian Shirts
Patterns for printing Hawaiian shirts with the Go gopher. I think I’ve found what I’ll be wearing to work in the future. π
Via: Golang Weekly
-
Dear Go developers,
You don’t need to return pointers,
Unless you do need to return pointers.
But if you think you need to return pointers,
You probably don’t need to return pointers.Instead, consider just returning regular struct values. Keep the nil-pointer panics at bay.