Addressable values in Go (and unaddressable ones too)

One of the tricky concepts in Go is 'addressable values', whichshow up in various places in the Go specification . To understand them better, let'spull all of the scattered references to them together in one place.The best place to start is with the specification of what they are,which is covered in Address operators :

For an operand x of type T , the address operation &x generates a pointer of type *T to x . The operand must be addressable , that is, either a


Learning about Go's unaddressable values and slicing

Dave Cheney recently posted another little Go pop quiz on Twitter,and as usual I learned something interesting from it. Let's startwith his tweet :

#golang pop quiz: what does this program print?

package main
import (    "crypto/sha1"    "fmt")func main() {    input := []byte("Hello, playground")    hash := sha1.Sum(input)[:5]    fmt.Println(hash)}

To my surprise, here is


A problem with unmounting FUSE mount points that are on NFS filesystems

If you have NFS filesystems with directories that are not worldaccessible, and people mount FUSE filesystems at spots under thosedirectories, you are probably going to have problems in modern Linuxkernels. Specifically, it is very difficult to unmount these FUSEmounts (even if the program providing the FUSE filesystem exits).

Here is what happens:

; ls -ld .; stat -f -c '%T' .drwx--S--- 108 cks itdirgrp 242 Sep 25 22

Why I don't set master passwords in programs

There are any number of programs and systems that store passwordsfor you, most prominently browsers with their remembered websitepasswords. It's very common for these programs to ask you to set amaster password that will secure the passwords they store and benecessary to unlock those passwords. One of my peculiarities isthat I refuse to set up such master passwords; this shows up mostoften in browsers, but I stick to it elsewhere as well. The fundamentalreason why I don't do this because I don'


Walking away from Google Chrome

Despite periodic qualms over Chrome extensions, I've been using Chrome for what is now along time . However, that's a bitmisleading of a statement, because I don't really use Chrome in aconventional way. Basically all of what I do with Chrome is useincognito mode as my 'just make this site work, I don't care' browser , with Javascript and so on all enabled in away that I don't normally do. For a long time this also had


The ed(1) command in the Single Unix Specification (and the SVID)

When I wrote my entry on some differences between various versionsof ed(1) , I forgot to check the SingleUnix Specification to see if it has anything to say about ed . It turns out that itdoes, and ed ispart of the 'Shell & Utilities' section.

SUS ed is mostly the same as FreeBSD ed , which is kind of whatI think of as 'the baseline modern ed '. SUS ed requires that s support a bunch of flags for printing the results (only GNU ed


Some differences between various versions of ed(1)

Today, the versions of ed(1) that people are most likely toencounter and experiment with are GNU ed on Linux,and FreeBSD ed and OpenBSD ed on their respectivesystems. GNU ed is a new implementation written from scratch, whileI believe that the *BSD ed is a descendant from the original V7ed by way of 4.x BSD ed, such as 4.4BSD ed .However, a great deal of what's said about ed(1) , especially instuff from


Your databases always have a schema

Over on Mastodon, I had a database opinion :

Obvious database hot take: your stored data always has a schema,unless your code neither reads nor writes it as anything except anopaque blob. What NoSQL changes is how many places that schema existsand how easy it is to have multiple schemas for your data.

(SQL allows multiple schemas too. You just change what fields mean inyour code, reuse them, extend them, etc etc.)

One schema that your data has is implicit in what data fields


Why I mostly don't use ed(1) for non-interactive edits in scripts

One of the things that is frequently said about ed(1) is that it remains useful for non-interactive modificationsto files, for example as part of shell scripts. I even mentionedthis as a good use of ed today in my entry on why ed is nota good (interactive) editor today ,and I stand by that. But, well, there is a problem with using ed this way, and that problem is why I only very rarely actually use ed for scripted modifications to files.

The


Ubuntu pretty much is the 'universe' repository for us

Recently, HL left a comment on my entry about Ubuntu bug reportsbeing useless pointing out that part ofthe problem is Ubuntu's "Universe" repository.To quote HL:

The issue is of course that Universe is essentially a static snapshotof Debian unstable at the time of the relevant Ubuntu release. Someupdates do happen, generally if someone contributes them, but Ubuntudoes not consider the huge set of packages that only exist in Universeto actually be supported. [...] (In many cases it