package main import ( "github.com/hashicorp/terraform/terraform" ) func main() { // create a new MockResourceProvider mrp := terraform.MockResourceProvider{} // define a new resource type providerSchema := map[string]*resource.Schema { "example_resource": &resource.Schema{ Type: schema.TypeList, Optional: true, Elem: &schema.Resource { Schema: map[string]*resource.Schema { "id": &resource.Schema{ Type: schema.TypeString, Computed: true, }, "name": &resource.Schema{ Type: schema.TypeString, Required: true, }, }, }, }, } // initialize the resource type rs := &schema.Resource{ Schema: providerSchema, } // create a mock resource mr := mrp.NewResource(rs) err := mr.Set("name", "test_resource") if err != nil { fmt.Println("Could not set test_resource") return } }In this example we create a new MockResourceProvider and define a new resource type. We then initialize the resource type and create a new mock resource. We set a value for the "name" field in the mock resource with the Set() function. Overall, the github.com/hashicorp/terraform/terraform package library is designed to make developing terraform providers easier and faster. The MockResourceProvider is but one of the many useful tools available in the package library.