github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/states/statemgr/lineage.go (about) 1 package statemgr 2 3 import ( 4 "fmt" 5 6 uuid "github.com/hashicorp/go-uuid" 7 ) 8 9 // NewLineage generates a new lineage identifier string. A lineage identifier 10 // is an opaque string that is intended to be unique in space and time, chosen 11 // when state is recorded at a location for the first time and then preserved 12 // afterwards to allow Terraform to recognize when one state snapshot is a 13 // predecessor or successor of another. 14 func NewLineage() string { 15 lineage, err := uuid.GenerateUUID() 16 if err != nil { 17 panic(fmt.Errorf("Failed to generate lineage: %v", err)) 18 } 19 return lineage 20 }