terraform-provider-gitea/vendor/github.com/hashicorp/terraform-plugin-test/plugin.go
Malar Invention 00ebcd295e add vendor
2022-04-03 09:37:16 +05:30

16 lines
425 B
Go

package tftest
import (
"os"
)
// RunningAsPlugin returns true if it detects the usual Terraform plugin
// detection environment variables, suggesting that the current process is
// being launched as a plugin server.
func RunningAsPlugin() bool {
const cookieVar = "TF_PLUGIN_MAGIC_COOKIE"
const cookieVal = "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2"
return os.Getenv(cookieVar) == cookieVal
}