From a7d1d9c8be201b411154ea1ec0744b5bdafc9018 Mon Sep 17 00:00:00 2001 From: Christopher Hunter Date: Wed, 16 Aug 2023 13:00:00 -0700 Subject: [PATCH] use standard library "slices" package this was added in go 1.21 --- go.mod | 1 - go.sum | 2 -- internal/acceptance/workflows/acceptance_test.go | 3 +-- internal/acceptance/workflows/scenario/initialize_test.go | 2 +- .../workflows/scenario/step_funcs_tile_source_code.go | 2 +- internal/component/artifactory_test.go | 1 - internal/test/container.go | 2 +- pkg/cargo/bosh_release.go | 2 +- pkg/cargo/bump.go | 2 +- pkg/cargo/validate.go | 2 +- pkg/proofing/product_template.go | 3 +-- 11 files changed, 8 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 4e29bcb10..76c6ef0b0 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,6 @@ require ( github.com/snabb/httpreaderat v1.0.1 github.com/stretchr/testify v1.8.4 golang.org/x/crypto v0.12.0 - golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb golang.org/x/oauth2 v0.11.0 golang.org/x/sync v0.3.0 golang.org/x/term v0.11.0 diff --git a/go.sum b/go.sum index fff08d61e..98c608411 100644 --- a/go.sum +++ b/go.sum @@ -712,8 +712,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/internal/acceptance/workflows/acceptance_test.go b/internal/acceptance/workflows/acceptance_test.go index c87e1d658..70c663ed8 100644 --- a/internal/acceptance/workflows/acceptance_test.go +++ b/internal/acceptance/workflows/acceptance_test.go @@ -16,11 +16,10 @@ import ( "os" "os/exec" "path/filepath" + "slices" "strings" "testing" - "golang.org/x/exp/slices" - "github.com/cucumber/godog" "github.com/pivotal-cf/kiln/internal/acceptance/workflows/scenario" diff --git a/internal/acceptance/workflows/scenario/initialize_test.go b/internal/acceptance/workflows/scenario/initialize_test.go index 99d55d237..131d62eb7 100644 --- a/internal/acceptance/workflows/scenario/initialize_test.go +++ b/internal/acceptance/workflows/scenario/initialize_test.go @@ -7,11 +7,11 @@ import ( "os" "reflect" "regexp" + "slices" "sort" "testing" "github.com/cucumber/godog" - "golang.org/x/exp/slices" ) const testTilePath = "../hello-tile" diff --git a/internal/acceptance/workflows/scenario/step_funcs_tile_source_code.go b/internal/acceptance/workflows/scenario/step_funcs_tile_source_code.go index 4ebf96d8e..3216dc780 100644 --- a/internal/acceptance/workflows/scenario/step_funcs_tile_source_code.go +++ b/internal/acceptance/workflows/scenario/step_funcs_tile_source_code.go @@ -5,12 +5,12 @@ import ( "fmt" "os" "os/exec" + "slices" "strings" "github.com/cucumber/godog" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" - "golang.org/x/exp/slices" "github.com/pivotal-cf/kiln/internal/component" "github.com/pivotal-cf/kiln/pkg/cargo" diff --git a/internal/component/artifactory_test.go b/internal/component/artifactory_test.go index 4f21cfcc0..f06cb87a2 100644 --- a/internal/component/artifactory_test.go +++ b/internal/component/artifactory_test.go @@ -247,7 +247,6 @@ var _ = Describe("interacting with BOSH releases on Artifactory", func() { When("a bosh release is not found", func() { BeforeEach(func() { artifactoryRouter.NotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNotFound) _, _ = fmt.Fprintln(w, `{"errors":[{"status":404,"message":"File not found."}]}`) }) diff --git a/internal/test/container.go b/internal/test/container.go index 82708d1fe..fa0c23341 100644 --- a/internal/test/container.go +++ b/internal/test/container.go @@ -16,6 +16,7 @@ import ( "os/signal" "path" "path/filepath" + "slices" "strings" "github.com/docker/docker/api/types" @@ -32,7 +33,6 @@ import ( "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" - "golang.org/x/exp/slices" "golang.org/x/term" ) diff --git a/pkg/cargo/bosh_release.go b/pkg/cargo/bosh_release.go index 333b5e6ce..099799aa8 100644 --- a/pkg/cargo/bosh_release.go +++ b/pkg/cargo/bosh_release.go @@ -11,9 +11,9 @@ import ( "io/fs" "os" "path" + "slices" "strings" - "golang.org/x/exp/slices" "gopkg.in/yaml.v3" "github.com/pivotal-cf/kiln/pkg/proofing" diff --git a/pkg/cargo/bump.go b/pkg/cargo/bump.go index 09ba19a66..a854f4c7c 100644 --- a/pkg/cargo/bump.go +++ b/pkg/cargo/bump.go @@ -2,13 +2,13 @@ package cargo import ( "context" + "slices" "sort" "strings" "sync" "github.com/Masterminds/semver/v3" "github.com/google/go-github/v40/github" - "golang.org/x/exp/slices" "github.com/pivotal-cf/kiln/internal/gh" ) diff --git a/pkg/cargo/validate.go b/pkg/cargo/validate.go index fb14b1c1d..c4a630c20 100644 --- a/pkg/cargo/validate.go +++ b/pkg/cargo/validate.go @@ -2,9 +2,9 @@ package cargo import ( "fmt" + "slices" "github.com/Masterminds/semver/v3" - "golang.org/x/exp/slices" ) func Validate(spec Kilnfile, lock KilnfileLock) []error { diff --git a/pkg/proofing/product_template.go b/pkg/proofing/product_template.go index b632624a5..703e697bf 100644 --- a/pkg/proofing/product_template.go +++ b/pkg/proofing/product_template.go @@ -2,8 +2,7 @@ package proofing import ( "fmt" - - "golang.org/x/exp/slices" + "slices" ) type ProductTemplate struct {