Skip to content

Commit 983ab4d

Browse files
committed
Deprecated packages that were removed in v2
See #438
1 parent 782eab1 commit 983ab4d

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

helper/hashcode/hashcode.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import (
88

99
// String hashes a string to a unique hashcode.
1010
//
11+
// Deprecated: This will be removed in v2 without replacement. If you need
12+
// its functionality, you can copy it, use crc32 directory, or reference the
13+
// v1 package.
14+
//
1115
// crc32 returns a uint32, but for our use we need
1216
// and non negative integer. Here we cast to an integer
1317
// and invert it if the result is negative.
@@ -24,6 +28,10 @@ func String(s string) int {
2428
}
2529

2630
// Strings hashes a list of strings to a unique hashcode.
31+
//
32+
// Deprecated: This will be removed in v2 without replacement. If you need
33+
// its functionality, you can copy it, use crc32 directory, or reference the
34+
// v1 package.
2735
func Strings(strings []string) string {
2836
var buf bytes.Buffer
2937

helper/mutexkv/mutexkv.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import (
99
// serialize changes across arbitrary collaborators that share knowledge of the
1010
// keys they must serialize on.
1111
//
12+
// Deprecated: This will be removed in v2 without replacement. If you need
13+
// its functionality, you can copy it or reference the v1 package.
14+
//
1215
// The initial use case is to let aws_security_group_rule resources serialize
1316
// their access to individual security groups based on SG ID.
1417
type MutexKV struct {
@@ -18,13 +21,19 @@ type MutexKV struct {
1821

1922
// Locks the mutex for the given key. Caller is responsible for calling Unlock
2023
// for the same key
24+
//
25+
// Deprecated: This will be removed in v2 without replacement. If you need
26+
// its functionality, you can copy it or reference the v1 package.
2127
func (m *MutexKV) Lock(key string) {
2228
log.Printf("[DEBUG] Locking %q", key)
2329
m.get(key).Lock()
2430
log.Printf("[DEBUG] Locked %q", key)
2531
}
2632

2733
// Unlock the mutex for the given key. Caller must have called Lock for the same key first
34+
//
35+
// Deprecated: This will be removed in v2 without replacement. If you need
36+
// its functionality, you can copy it or reference the v1 package.
2837
func (m *MutexKV) Unlock(key string) {
2938
log.Printf("[DEBUG] Unlocking %q", key)
3039
m.get(key).Unlock()
@@ -44,6 +53,9 @@ func (m *MutexKV) get(key string) *sync.Mutex {
4453
}
4554

4655
// Returns a properly initalized MutexKV
56+
//
57+
// Deprecated: This will be removed in v2 without replacement. If you need
58+
// its functionality, you can copy it or reference the v1 package.
4759
func NewMutexKV() *MutexKV {
4860
return &MutexKV{
4961
store: make(map[string]*sync.Mutex),

helper/pathorcontents/read.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import (
1212
// otherwise the argument is assumed to be the desired contents and is simply
1313
// returned.
1414
//
15+
// Deprecated: This will be removed in v2 without replacement. If you need
16+
// its functionality, you can copy it or reference the v1 package.
17+
//
1518
// The boolean second return value can be called `wasPath` - it indicates if a
1619
// path was detected and a file loaded.
1720
func Read(poc string) (string, bool, error) {

httpclient/useragent.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import (
1111

1212
const uaEnvVar = "TF_APPEND_USER_AGENT"
1313

14+
// TerraformUserAgent returns a User-Agent header for a Terraform version string.
15+
//
16+
// Deprecated: This will be removed in v2 without replacement. If you need
17+
// its functionality, you can copy it or reference the v1 package.
1418
func TerraformUserAgent(version string) string {
1519
ua := fmt.Sprintf("HashiCorp Terraform/%s (+https://www.terraform.io) Terraform Plugin SDK/%s", version, meta.SDKVersionString())
1620

0 commit comments

Comments
 (0)