| 1 | package testhelpersscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/internal/testhelpers`/ |
| 2 | |
| 3 | import "stringsscip-go gomod github.com/golang/go/src go1.17 strings/" |
| 4 | |
| 5 | // IsTestResource returns true if given resource identifier is from terraform test |
| 6 | // identifier should be resource name but some resource don't have names |
| 7 | // return true if identifier match regex "tf[-_]test" |
| 8 | // common used prefixes are "tf_tests", "tf_test", "tf-tests", "tf-test" |
| 9 | func IsTestResourcescip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/internal/testhelpers`/IsTestResource().(identifier string) bool { |
| 10 | return len(identifier) >= len("tf_test") && |
| 11 | stringsscip-go gomod github.com/golang/go/src go1.17 strings/.HasPrefixscip-go gomod github.com/golang/go/src go1.17 strings/HasPrefix().(identifier, "tf") && |
| 12 | (identifier[2] == '_' || identifier[2] == '-') && |
| 13 | identifier[3:7] == "test" |
| 14 | } |