mirror of https://github.com/hashicorp/consul
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.pull/19613/head
parent
af2086fbeb
commit
b21851c903
@ -0,0 +1,13 @@
|
||||
// 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"
|
||||
}
|
Loading…
Reference in new issue