sys/capability.h will be removed before FreeBSD 13. The (now) correct header to use on all supported (and most unsupported) versions of FreeBSD is sys/capsicum.h. There's no need for autoconf checks etc. to check for both (in the ports tree) but upstream may want to if there's a desire to build on older releases. go/vendor/golang.org/x/sys/unix/mkerrors.sh 82:#include <sys/capability.h>
Upstream pull request at https://github.com/golang/go/pull/28742 Port can probably use REINPLACE_CMD to modify the file while waiting on the change to percolate through, or just wait if it gets merged/released quickly.
Canonical change URL: https://go-review.googlesource.com/c/go/+/148836
Link to commit that addresses this.
ping!
This was fixed by the upstream [1] and included in go1.12 [1] https://github.com/golang/go/commit/cc5fb5d93dd5880ba9832b1aa5f0914cca5cc0bd#diff-0a9f0278821c88f523571ee62e282314L83
In go 1.12 per comment #5