-
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.
-
The
exhaustiveGo linter complaining about missing cases for switch statements with adefaultclause is killing me.missing cases in switch of type this, and this, and this, and this, andβ¦
-
Request for a go linter: something that would warn when an variable with the name
erris not of typeerror:func Bla() { err := 123 // 'err' not of type 'error' }Would’ve saved me a few hours today trying to test if a Future was not-nil, without actually waiting for the result.
-
Moan-routine: LO's Predicate Signatures
A critique of function signatures the ’lo’ package offers for functions like Map and Filter. Continue reading β
-
Does Google ever regret naming Go “Go”? Such a common word to use as a proper noun. I know the language devs prefer not to use Golang, but there’s no denying that it’s easier to search for.
-
Broadtail
Date: 2021 β 2022 Status: Paused First project I’ll talk about is Broadtail. I think I talked about this one before, or at least I posted screenshot of it. I started work on this in 2021. The pandemic was still raging, and much of my downtime was watching YouTube videos. We were coming up to a federal election, and I was getting frustrated with seeing YouTube ads from political parties that offend me. Continue reading β
-
Why I like developing in Go vs. something like NodeJS: my development setup doesn’t randomly break for some weird reason. When it does break, it’s because of something I did explicitly.
-
Why I'm Considering Building A Blogging CMS
I’m planning to start a new blog about Go development and one of the things that I’m currently torn on is how to host it. The choice look to be either using a service like blot.im or micro.blog or some other hosting service, using a static site generation tool like Hugo, or building my own CMS for it. I know that one of the things people tell you about blogging is that building your CMS is not worth your time: I myself even described it as “second cardinal sin of programming” on my first post to micro. Continue reading β
-
Offical support for file embedding coming to Go
I’m excited to see, via Golang Weekly, that the official support for embedding static files in Go is being realised, with the final commit merged to the core a couple of days ago. This, along with the new file-system abstraction, will mean that it will be much easier to embed files in Go applications, and make use of them within the application itself. One of the features I like about coding is Go is that the build artefacts are statically linked executables that can be distributed without any additional dependencies. Continue reading β
-
Remarks on Go's Error Handling using Facebook's SDK Crashes As a Framing Device
There are new reports of Facebook’s SDK crashing apps again due to server changes. The post above links to Bugsnag article which explores the underlying cause: that’s worth a read. I’m going to throw a shout-out to Go’s approach to error handling here. I’m not saying that this shows the superiority of Go over Objective C: these sorts of things can happen in any language. The difference I want to highlight is that Go treats error handling as part of the standard flow of the language, rather than the exceptional flow. Continue reading β
-
On Goβs Type Parameters Proposal
The developers of Go have release a new draft proposal for type parameters. The biggest change is the replacing the concept of constraints, which complicated the proposal somewhat, and replaced it with interfaces to express the same thing. You can read the proposal here latest proposal here. I think theyβre starting to reach a great balance between what currently exists in the language, and the features required to make a useful type parameter system. Continue reading β