generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 10
/
const.go
50 lines (47 loc) · 1.58 KB
/
const.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
43
44
45
46
47
48
49
50
package provider
import (
"fmt"
)
const (
// ImportPathKey is used for common "importpath" resource attribute
ImportPathKey = "importpath"
// WorkingDirKey is used for common "working_dir" resource attribute
WorkingDirKey = "working_dir"
// PlatformsKey is used for common "platforms" resource attribute
PlatformsKey = "platforms"
// SBOMKey is used for common "sbom" resource attribute
SBOMKey = "sbom"
// BaseImageKey is used for common "base_image" resource attribute
BaseImageKey = "base_image"
// TagsKey is used for common "tags" resource attribute
TagsKey = "tags"
// TagOnlyKey is used for common "tag_only" resource attribute
TagOnlyKey = "tag_only"
// PushKey is used for common "push" resource attribute
PushKey = "push"
// FilenamesKey is used for common "filenames" resource attribute
FilenamesKey = "filenames"
// RecursiveKey is used for common "recursive" resource attribute
RecursiveKey = "recursive"
// SelectorKey is used for common "selector" resource attribute
SelectorKey = "selector"
// ImageRefKey is used for common "image_ref" resource attribute
ImageRefKey = "image_ref"
// ManifestsKey is used for common "manifests" resource attribute
ManifestsKey = "manifests"
// RepoKey is used for common "repo" resource attribute
RepoKey = "repo"
// Ldflags is used for common "ldflags" resource attribute
LdflagsKey = "ldflags"
)
func StringSlice(in []interface{}) []string {
out := make([]string, len(in))
for i, ii := range in {
if s, ok := ii.(string); ok {
out[i] = s
} else {
panic(fmt.Errorf("expected string, got %T", ii))
}
}
return out
}