]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/terraform/path.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / path.go
index 51dd4122bb49e8cbdfba018aa15c13de2f101543..9757446bb6ceaebec2bc984a0c452dec1d8f40a5 100644 (file)
@@ -1,10 +1,17 @@
 package terraform
 
 import (
-       "strings"
+       "fmt"
+
+       "github.com/hashicorp/terraform/addrs"
 )
 
-// PathCacheKey returns a cache key for a module path.
-func PathCacheKey(path []string) string {
-       return strings.Join(path, "|")
+// PathObjectCacheKey is like PathCacheKey but includes an additional name
+// to be included in the key, for module-namespaced objects.
+//
+// The result of this function is guaranteed unique for any distinct pair
+// of path and name, but is not guaranteed to be in any particular format
+// and in particular should never be shown to end-users.
+func PathObjectCacheKey(path addrs.ModuleInstance, objectName string) string {
+       return fmt.Sprintf("%s|%s", path.String(), objectName)
 }