The following information is either not mentioned in the various docs and tutorials either well-hidden:
Official provider template: https://github.com/hashicorp/terraform-provider-scaffolding
When making a new provider from scratch, build it in $GOPATH/bin/terraform-provider-example
then let's say your provider will reside on the official Terraform registry under my-company/example
, you need to create a bypass to use your locally built provider on your system:
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/my-company/example/1.0.0/darwin_amd64
ln -s $GOPATH/bin/terraform-provider-example ~/.terraform.d/plugins/registry.terraform.io/my-company/example/1.0.0/darwin_amd64/terraform-provider-example