From ed9722f637568b3b216dc951688024f63f627dff Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 18 Sep 2024 08:22:28 -0400 Subject: [PATCH] Use golang stdlib 'regexp', not 'regexache'. --- endpoints/endpoints_gen.go | 16 ++++++++-------- go.mod | 1 - go.sum | 2 -- internal/generate/endpoints/output.go.gtpl | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/endpoints/endpoints_gen.go b/endpoints/endpoints_gen.go index 6232a612..891e5634 100644 --- a/endpoints/endpoints_gen.go +++ b/endpoints/endpoints_gen.go @@ -6,7 +6,7 @@ package endpoints import ( - "github.com/YakDriver/regexache" + "regexp" ) // All known partition IDs. @@ -81,7 +81,7 @@ var ( id: AwsPartitionID, name: "AWS Standard", dnsSuffix: "amazonaws.com", - regionRegex: regexache.MustCompile(`^(us|eu|ap|sa|ca|me|af|il|mx)\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^(us|eu|ap|sa|ca|me|af|il|mx)\-\w+\-\d+$`), }, regions: map[string]Region{ AfSouth1RegionID: { @@ -211,7 +211,7 @@ var ( id: AwsCnPartitionID, name: "AWS China", dnsSuffix: "amazonaws.com.cn", - regionRegex: regexache.MustCompile(`^cn\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^cn\-\w+\-\d+$`), }, regions: map[string]Region{ CnNorth1RegionID: { @@ -229,7 +229,7 @@ var ( id: AwsIsoPartitionID, name: "AWS ISO (US)", dnsSuffix: "c2s.ic.gov", - regionRegex: regexache.MustCompile(`^us\-iso\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^us\-iso\-\w+\-\d+$`), }, regions: map[string]Region{ UsIsoEast1RegionID: { @@ -247,7 +247,7 @@ var ( id: AwsIsoBPartitionID, name: "AWS ISOB (US)", dnsSuffix: "sc2s.sgov.gov", - regionRegex: regexache.MustCompile(`^us\-isob\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^us\-isob\-\w+\-\d+$`), }, regions: map[string]Region{ UsIsobEast1RegionID: { @@ -261,7 +261,7 @@ var ( id: AwsIsoEPartitionID, name: "AWS ISOE (Europe)", dnsSuffix: "cloud.adc-e.uk", - regionRegex: regexache.MustCompile(`^eu\-isoe\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^eu\-isoe\-\w+\-\d+$`), }, regions: map[string]Region{ EuIsoeWest1RegionID: { @@ -275,7 +275,7 @@ var ( id: AwsIsoFPartitionID, name: "AWS ISOF", dnsSuffix: "csp.hci.ic.gov", - regionRegex: regexache.MustCompile(`^us\-isof\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^us\-isof\-\w+\-\d+$`), }, regions: map[string]Region{}, }, @@ -284,7 +284,7 @@ var ( id: AwsUsGovPartitionID, name: "AWS GovCloud (US)", dnsSuffix: "amazonaws.com", - regionRegex: regexache.MustCompile(`^us\-gov\-\w+\-\d+$`), + regionRegex: regexp.MustCompile(`^us\-gov\-\w+\-\d+$`), }, regions: map[string]Region{ UsGovEast1RegionID: { diff --git a/go.mod b/go.mod index afe10750..33dae101 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.22 toolchain go1.22.7 require ( - github.com/YakDriver/regexache v0.24.0 github.com/aws/aws-sdk-go-v2 v1.30.5 github.com/aws/aws-sdk-go-v2/config v1.27.35 github.com/aws/aws-sdk-go-v2/credentials v1.17.33 diff --git a/go.sum b/go.sum index fece635f..f5726210 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,6 @@ github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+ github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/YakDriver/regexache v0.24.0 h1:zUKaixelkswzdqsqPc2sveiV//Mi/msJn0teG8zBDiA= -github.com/YakDriver/regexache v0.24.0/go.mod h1:awcd8uBj614F3ScW06JqlfSGqq2/7vdJHy+RiKzVC+g= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= diff --git a/internal/generate/endpoints/output.go.gtpl b/internal/generate/endpoints/output.go.gtpl index 0dccbb4b..127351c1 100644 --- a/internal/generate/endpoints/output.go.gtpl +++ b/internal/generate/endpoints/output.go.gtpl @@ -6,7 +6,7 @@ package endpoints import ( - "github.com/YakDriver/regexache" + "regexp" ) // All known partition IDs. @@ -39,7 +39,7 @@ var ( id: {{ .ID | KebabToTitle}}PartitionID, name: "{{ .Name }}", dnsSuffix: "{{ .DNSSuffix }}", - regionRegex: regexache.MustCompile(`{{ .RegionRegex }}`), + regionRegex: regexp.MustCompile(`{{ .RegionRegex }}`), }, regions: map[string]Region{ {{- range .Regions }}