refactor: google util

main
sundowndev 2021-09-20 16:52:48 +02:00
parent 809577db57
commit 6fda312232
1 changed files with 3 additions and 2 deletions

View File

@ -1,9 +1,10 @@
package google
import (
"strings"
"regexp"
)
func trimResourceName(name string) string {
return strings.TrimPrefix(name, "//compute.googleapis.com/")
re, _ := regexp.Compile(`^\/\/[\w]+.googleapis.com\/`)
return re.ReplaceAllString(name, "")
}