consul/version/versiontest/versiontest.go
R.B. Boyer b21851c903
test: add test helper to detect if the current build is enterprise (#19201)
This can help conditionally change test behavior if the test is executing in enterprise without the need to split the test with build tags.
2023-11-13 10:30:07 -06:00

14 lines
337 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package versiontest
import "github.com/hashicorp/consul/version"
// IsEnterprise returns true if the current build is a Consul Enterprise build.
//
// This should only be called from test code.
func IsEnterprise() bool {
return version.VersionMetadata == "ent"
}