-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
four_point_oh.go
42 lines (36 loc) · 1.43 KB
/
four_point_oh.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package features
// import "os"
// nolint gocritic
// DeprecatedInFourPointOh returns the deprecation message if the provider
// is running in 4.0 mode - otherwise is returns an empty string (such that
// this deprecation should be ignored).
// This can be used for the following scenarios:
// - Signify resources which will be Deprecated in 4.0, but not Removed (which will happen in a later release).
// - For properties undergoing a rename, where the renamed property will only be introduced in the next release
func DeprecatedInFourPointOh(deprecationMessage string) string {
if !FourPointOhBeta() {
return ""
}
return deprecationMessage
}
// FourPointOh returns whether this provider is running in 4.0 mode
// that is to say - the final 4.0 release
//
// This exists to allow breaking changes to be piped through the provider
// during the development of 3.x until 4.0 is ready.
func FourPointOh() bool {
return false
}
// FourPointOhBeta returns whether this provider is running in 4.0 mode
// which is an opt-in Beta of the (non-breaking changes) coming in 4.0.
//
// Any features behind this flag should be backwards-compatible to allow
// users to try out 4.0 functionality.
//
// This exists to allow breaking changes to be piped through the provider
// during the development of 3.x until 4.0 is ready.
func FourPointOhBeta() bool {
return FourPointOh() || false
}