If running brew update && brew upgrade
leads to a macOS UI prompt with, “The "clang" command
requires the command line developer tools” that reappears after installing, try running this:
xcodebuild -runFirstLaunch
Thanks to https://boyter.org/posts/golang-the-clang-command-requires-command-line-developer-tools/.