For another PR: @carlosmn can we change this opts API to take a pointer to `gh_buf` instead? It would make it much more usable.