From d019644034407eedbb0f938e08f32f4e9279edb2 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Thu, 16 May 2024 17:35:50 +0200 Subject: [PATCH 1/9] bugfix: refactor test package names 'packageA' and 'packageB' because they break naming conventions (#3260) Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Upstream-repository: operator-lifecycle-manager Upstream-commit: 3e0230e983397a49306f9f69c6a4561c28fbe67e --- .../registry/resolver/resolver_test.go | 398 +++++++++--------- .../test/e2e/catalog_e2e_test.go | 2 +- .../test/e2e/catalog_exclusion_test.go | 2 +- .../test/e2e/data/catalog.new.yaml | 2 +- .../test/e2e/data/catalog.old.yaml | 2 +- .../test/e2e/fail_forward_e2e_test.go | 4 +- .../test/e2e/magic_catalog_test.go | 8 +- .../test/e2e/subscription_e2e_test.go | 55 +-- .../test/e2e/testdata/bad-csv/bad-csv.yaml | 8 +- .../fail-forward/v0.1.0/packagemanifest.yaml | 2 +- .../v0.2.0-invalid-csv/packagemanifest.yaml | 2 +- .../packagemanifest.yaml | 2 +- .../v0.2.1-invalid-csv/packagemanifest.yaml | 2 +- .../packagemanifest.yaml | 2 +- .../packagemanifest.yaml | 2 +- .../v0.3.0-skip-range/packagemanifest.yaml | 2 +- .../v0.3.0-skips/packagemanifest.yaml | 2 +- .../testdata/magiccatalog/fbc_catalog.json | 14 +- .../testdata/magiccatalog/fbc_initial.yaml | 8 +- .../testdata/magiccatalog/fbc_updated.yaml | 8 +- .../subscription/example-operator.v0.1.0.yaml | 8 +- .../example-operator.v0.2.0-deprecations.yaml | 12 +- .../example-operator.v0.2.0-invalid-csv.yaml | 8 +- ...mple-operator.v0.2.0-non-existent-tag.yaml | 8 +- .../subscription/example-operator.v0.2.0.yaml | 8 +- .../example-operator.v0.3.0-deprecations.yaml | 12 +- .../subscription/example-operator.v0.3.0.yaml | 8 +- 27 files changed, 297 insertions(+), 294 deletions(-) diff --git a/staging/operator-lifecycle-manager/pkg/controller/registry/resolver/resolver_test.go b/staging/operator-lifecycle-manager/pkg/controller/registry/resolver/resolver_test.go index dcb310bf1b..f2a3735cc4 100644 --- a/staging/operator-lifecycle-manager/pkg/controller/registry/resolver/resolver_test.go +++ b/staging/operator-lifecycle-manager/pkg/controller/registry/resolver/resolver_test.go @@ -53,17 +53,17 @@ func TestSolveOperators(t *testing.T) { const namespace = "test-namespace" catalog := cache.SourceKey{Name: "test-catalog", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.1", "", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.1", "", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -75,7 +75,7 @@ func TestSolveOperators(t *testing.T) { assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageB.v1", "1.0.1", "", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.1", "", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), } require.ElementsMatch(t, expected, operators) } @@ -91,14 +91,14 @@ func TestSolveOperators_WithSystemConstraints(t *testing.T) { const namespace = "test-namespace" catalog := cache.SourceKey{Name: "test-catalog", Namespace: namespace} - packageASub := newSub(namespace, "packageA", "alpha", catalog) + packageASub := newSub(namespace, "test-package", "alpha", catalog) packageDSub := existingSub(namespace, "packageD.v1", "packageD", "alpha", catalog) APISet := cache.APISet{opregistry.APIKey{Group: "g", Version: "v", Kind: "k", Plural: "ks"}: struct{}{}} - // packageA requires an API that can be provided by B or C - packageA := genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", catalog.Name, catalog.Namespace, APISet, nil, nil, "", false) - packageB := genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, APISet, nil, "", false) + // test-package requires an API that can be provided by B or C + testPackage := genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", catalog.Name, catalog.Namespace, APISet, nil, nil, "", false) + anotherPackage := genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, APISet, nil, "", false) packageC := genEntry("packageC.v1", "1.0.0", "", "packageC", "alpha", catalog.Name, catalog.Namespace, nil, APISet, nil, "", false) // Existing operators @@ -133,39 +133,39 @@ func TestSolveOperators_WithSystemConstraints(t *testing.T) { }{ { title: "No runtime constraints", - snapshotEntries: []*cache.Entry{packageA, packageB, packageC, packageD}, + snapshotEntries: []*cache.Entry{testPackage, anotherPackage, packageC, packageD}, systemConstraintsProvider: nil, - expectedOperators: []*cache.Entry{packageA, packageB}, + expectedOperators: []*cache.Entry{testPackage, anotherPackage}, csvs: nil, subs: []*v1alpha1.Subscription{packageASub}, err: "", }, { title: "Runtime constraints only accept packages A and C", - snapshotEntries: []*cache.Entry{packageA, packageB, packageC, packageD}, - systemConstraintsProvider: whiteListConstraintProvider(packageA, packageC), - expectedOperators: []*cache.Entry{packageA, packageC}, + snapshotEntries: []*cache.Entry{testPackage, anotherPackage, packageC, packageD}, + systemConstraintsProvider: whiteListConstraintProvider(testPackage, packageC), + expectedOperators: []*cache.Entry{testPackage, packageC}, csvs: nil, subs: []*v1alpha1.Subscription{packageASub}, err: "", }, { title: "Existing packages are ignored", - snapshotEntries: []*cache.Entry{packageA, packageB, packageC, packageD}, - systemConstraintsProvider: whiteListConstraintProvider(packageA, packageC), - expectedOperators: []*cache.Entry{packageA, packageC}, + snapshotEntries: []*cache.Entry{testPackage, anotherPackage, packageC, packageD}, + systemConstraintsProvider: whiteListConstraintProvider(testPackage, packageC), + expectedOperators: []*cache.Entry{testPackage, packageC}, csvs: []*v1alpha1.ClusterServiceVersion{existingPackageD}, subs: []*v1alpha1.Subscription{packageASub, packageDSub}, err: "", }, { title: "Runtime constraints don't allow A", - snapshotEntries: []*cache.Entry{packageA, packageB, packageC, packageD}, - systemConstraintsProvider: whiteListConstraintProvider(packageB, packageC, packageD), + snapshotEntries: []*cache.Entry{testPackage, anotherPackage, packageC, packageD}, + systemConstraintsProvider: whiteListConstraintProvider(anotherPackage, packageC, packageD), expectedOperators: nil, csvs: nil, subs: []*v1alpha1.Subscription{packageASub}, - err: "packageA is not white listed", + err: "test-package is not white listed", }, } @@ -195,17 +195,17 @@ func TestDisjointChannelGraph(t *testing.T) { const namespace = "test-namespace" catalog := cache.SourceKey{Name: "test-catalog", Namespace: namespace} - newSub := newSub(namespace, "packageA", "alpha", catalog) + newSub := newSub(namespace, "test-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.side1.v1", "0.0.1", "", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), - genEntry("packageA.side1.v2", "0.0.2", "packageA.side1.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), - genEntry("packageA.side2.v1", "1.0.0", "", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), - genEntry("packageA.side2.v2", "2.0.0", "packageA.side2.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("test-package.side1.v1", "0.0.1", "", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("test-package.side1.v2", "0.0.2", "test-package.side1.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("test-package.side2.v1", "1.0.0", "", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("test-package.side2.v2", "2.0.0", "test-package.side2.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), }, }, }), @@ -213,7 +213,7 @@ func TestDisjointChannelGraph(t *testing.T) { } _, err := resolver.Resolve([]string{namespace}, subs) - require.Error(t, err, "a unique replacement chain within a channel is required to determine the relative order between channel entries, but 2 replacement chains were found in channel \"alpha\" of package \"packageA\": packageA.side1.v2...packageA.side1.v1, packageA.side2.v2...packageA.side2.v1") + require.Error(t, err, "a unique replacement chain within a channel is required to determine the relative order between channel entries, but 2 replacement chains were found in channel \"alpha\" of package \"test-package\": test-package.side1.v2...test-package.side1.v1, test-package.side2.v2...test-package.side2.v1") } func TestSolveOperators_MultipleChannels(t *testing.T) { @@ -223,18 +223,18 @@ func TestSolveOperators_MultipleChannels(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "beta", "community", "olm", nil, nil, nil, "", false), + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "beta", "community", "olm", nil, nil, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -245,7 +245,7 @@ func TestSolveOperators_MultipleChannels(t *testing.T) { operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) } @@ -257,9 +257,9 @@ func TestSolveOperators_FindLatestVersion(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} resolver := Resolver{ @@ -269,10 +269,10 @@ func TestSolveOperators_FindLatestVersion(t *testing.T) { Name: "community", }: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v0.9.0", "0.9.0", "", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.0", "1.0.0", "packageB.v0.9.0", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v0.9.0", "0.9.0", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.0", "1.0.0", "another-package.v0.9.0", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -288,8 +288,8 @@ func TestSolveOperators_FindLatestVersion(t *testing.T) { } expected := []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) } @@ -301,9 +301,9 @@ func TestSolveOperators_FindLatestVersionWithDependencies(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} opToAddVersionDeps := []*api.Dependency{ @@ -321,10 +321,10 @@ func TestSolveOperators_FindLatestVersionWithDependencies(t *testing.T) { cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v0.9.0", "0.9.0", "", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.0", "1.0.0", "packageB.v0.9.0", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v0.9.0", "0.9.0", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.0", "1.0.0", "another-package.v0.9.0", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1.0.0", "1.0.0", "", "packageC", "alpha", "community", "olm", nil, nil, nil, "", false), genEntry("packageC.v1.0.1", "1.0.1", "packageC.v1.0.0", "packageC", "alpha", "community", "olm", nil, nil, nil, "", false), genEntry("packageD.v1.0.0", "1.0.0", "", "packageD", "alpha", "community", "olm", nil, nil, nil, "", false), @@ -342,8 +342,8 @@ func TestSolveOperators_FindLatestVersionWithDependencies(t *testing.T) { assert.Equal(t, 4, len(operators)) expected := []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1.0.1", "1.0.1", "packageC.v1.0.0", "packageC", "alpha", "community", "olm", nil, nil, nil, "", false), genEntry("packageD.v1.0.1", "1.0.1", "packageD.v1.0.0", "packageD", "alpha", "community", "olm", nil, nil, nil, "", false), } @@ -357,9 +357,9 @@ func TestSolveOperators_FindLatestVersionWithNestedDependencies(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} opToAddVersionDeps := []*api.Dependency{ @@ -383,10 +383,10 @@ func TestSolveOperators_FindLatestVersionWithNestedDependencies(t *testing.T) { cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v0.9.0", "0.9.0", "", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.0", "1.0.0", "packageB.v0.9.0", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v0.9.0", "0.9.0", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.0", "1.0.0", "another-package.v0.9.0", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1.0.0", "1.0.0", "", "packageC", "alpha", "community", "olm", nil, nil, nestedVersionDeps, "", false), genEntry("packageC.v1.0.1", "1.0.1", "packageC.v1.0.0", "packageC", "alpha", "community", "olm", nil, nil, nestedVersionDeps, "", false), genEntry("packageD.v1.0.1", "1.0.1", "", "packageD", "alpha", "community", "olm", nil, nil, nil, "", false), @@ -403,8 +403,8 @@ func TestSolveOperators_FindLatestVersionWithNestedDependencies(t *testing.T) { assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1.0.1", "1.0.1", "packageC.v1.0.0", "packageC", "alpha", "community", "olm", nil, nil, nestedVersionDeps, "", false), genEntry("packageD.v1.0.1", "1.0.1", "", "packageD", "alpha", "community", "olm", nil, nil, nil, "", false), genEntry("packageE.v1.0.1", "1.0.1", "packageE.v1.0.0", "packageE", "alpha", "community", "olm", nil, nil, nil, "", false), @@ -422,31 +422,31 @@ func TestSolveOperators_CatsrcPrioritySorting(t *testing.T) { opToAddVersionDeps := []*api.Dependency{ { Type: "olm.package", - Value: `{"packageName":"packageB","version":"0.0.1"}`, + Value: `{"packageName":"another-package","version":"0.0.1"}`, }, } namespace := "olm" customCatalog := cache.SourceKey{Name: "community", Namespace: namespace} - newSub := newSub(namespace, "packageA", "alpha", customCatalog) + newSub := newSub(namespace, "test-package", "alpha", customCatalog) subs := []*v1alpha1.Subscription{newSub} ssp := cache.StaticSourceProvider{ cache.SourceKey{Namespace: "olm", Name: "community"}: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", namespace, nil, + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", namespace, nil, nil, opToAddVersionDeps, "", false), }, }, cache.SourceKey{Namespace: "olm", Name: "community-operator"}: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "community-operator", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "community-operator", namespace, nil, nil, nil, "", false), }, }, cache.SourceKey{Namespace: "olm", Name: "high-priority-operator"}: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "high-priority-operator", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "high-priority-operator", namespace, nil, nil, nil, "", false), }, }, @@ -459,9 +459,9 @@ func TestSolveOperators_CatsrcPrioritySorting(t *testing.T) { operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", "olm", + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "high-priority-operator", "olm", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "high-priority-operator", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -472,7 +472,7 @@ func TestSolveOperators_CatsrcPrioritySorting(t *testing.T) { Name: "community-operator", }] = &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "community-operator", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "community-operator", namespace, nil, nil, nil, "", false), }, } @@ -487,9 +487,9 @@ func TestSolveOperators_CatsrcPrioritySorting(t *testing.T) { operators, err = resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected = []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", "olm", + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "community-operator", "olm", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "community-operator", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -500,9 +500,9 @@ func TestSolveOperators_CatsrcPrioritySorting(t *testing.T) { Name: "community", }] = &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", namespace, nil, + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", namespace, nil, nil, opToAddVersionDeps, "", false), - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "community", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "community", namespace, nil, nil, nil, "", false), }, } @@ -514,9 +514,9 @@ func TestSolveOperators_CatsrcPrioritySorting(t *testing.T) { operators, err = resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected = []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", "olm", + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), - genEntry("packageB.v1", "0.0.1", "", "packageB", "alpha", "community", "olm", + genEntry("another-package.v1", "0.0.1", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -529,9 +529,9 @@ func TestSolveOperators_WithPackageDependencies(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} opToAddVersionDeps := []*api.Dependency{ @@ -545,8 +545,8 @@ func TestSolveOperators_WithPackageDependencies(t *testing.T) { cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "community", "olm", nil, nil, nil, "", false), }, }, @@ -560,8 +560,8 @@ func TestSolveOperators_WithPackageDependencies(t *testing.T) { assert.Equal(t, 3, len(operators)) expected := []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "community", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -575,8 +575,8 @@ func TestSolveOperators_WithGVKDependencies(t *testing.T) { community := cache.SourceKey{Name: "community", Namespace: namespace} subs := []*v1alpha1.Subscription{ - existingSub(namespace, "packageA.v1", "packageA", "alpha", community), - newSub(namespace, "packageB", "alpha", community), + existingSub(namespace, "test-package.v1", "test-package", "alpha", community), + newSub(namespace, "another-package", "alpha", community), } deps := []*api.Dependency{ @@ -590,15 +590,15 @@ func TestSolveOperators_WithGVKDependencies(t *testing.T) { cache: cache.New(cache.StaticSourceProvider{ community: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "community", "olm", nil, Provides, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic( namespace, subs, - existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", nil, nil, nil, nil), + existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", nil, nil, nil, nil), ), }), log: logrus.New(), @@ -608,7 +608,7 @@ func TestSolveOperators_WithGVKDependencies(t *testing.T) { assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "community", "olm", nil, Provides, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -618,7 +618,7 @@ func TestSolveOperators_WithLabelDependencies(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - newSub := newSub(namespace, "packageA", "alpha", catalog) + newSub := newSub(namespace, "test-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} deps := []*api.Dependency{ @@ -635,14 +635,14 @@ func TestSolveOperators_WithLabelDependencies(t *testing.T) { }, } - operatorBv1 := genEntry("packageB.v1", "1.0.0", "", "packageB", "beta", "community", "olm", nil, nil, nil, "", false) + operatorBv1 := genEntry("another-package.v1", "1.0.0", "", "another-package", "beta", "community", "olm", nil, nil, nil, "", false) operatorBv1.Properties = append(operatorBv1.Properties, props...) resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA", "0.0.1", "", "packageA", "alpha", "community", "olm", nil, nil, deps, "", false), + genEntry("test-package", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, deps, "", false), operatorBv1, }, }, @@ -654,7 +654,7 @@ func TestSolveOperators_WithLabelDependencies(t *testing.T) { assert.Equal(t, 2, len(operators)) expected := []*cache.Entry{ - genEntry("packageA", "0.0.1", "", "packageA", "alpha", "community", "olm", nil, nil, deps, "", false), + genEntry("test-package", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, deps, "", false), operatorBv1, } assert.ElementsMatch(t, expected, operators) @@ -664,7 +664,7 @@ func TestSolveOperators_WithUnsatisfiableLabelDependencies(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - newSub := newSub(namespace, "packageA", "alpha", catalog) + newSub := newSub(namespace, "test-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} deps := []*api.Dependency{ @@ -678,8 +678,8 @@ func TestSolveOperators_WithUnsatisfiableLabelDependencies(t *testing.T) { cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA", "0.0.1", "", "packageA", "alpha", "community", "olm", nil, nil, deps, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("test-package", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, deps, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, nil, "", false), }, }, }), @@ -697,9 +697,9 @@ func TestSolveOperators_WithNestedGVKDependencies(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub, newSub} deps := []*api.Dependency{ @@ -723,9 +723,9 @@ func TestSolveOperators_WithNestedGVKDependencies(t *testing.T) { Name: "community", }: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.0", "1.0.0", "", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.0", "1.0.0", "", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), genEntry("packageC.v1.0.0", "1.0.0", "", "packageC", "alpha", "community", "olm", Provides2, Provides, deps2, "", false), genEntry("packageC.v1.0.1", "1.0.1", "packageC.v1.0.0", "packageC", "alpha", "community", "olm", Provides2, Provides, deps2, "", false), genEntry("packageD.v1.0.1", "1.0.1", "", "packageD", "alpha", "community", "olm", nil, Provides2, deps2, "", false), @@ -749,8 +749,8 @@ func TestSolveOperators_WithNestedGVKDependencies(t *testing.T) { operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageA.v1.0.1", "1.0.1", "packageA.v1", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("test-package.v1.0.1", "1.0.1", "test-package.v1", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), genEntry("packageC.v1.0.1", "1.0.1", "packageC.v1.0.0", "packageC", "alpha", "community", "olm", Provides2, Provides, deps2, "", false), genEntry("packageD.v1.0.1", "1.0.1", "", "packageD", "alpha", "community", "olm", nil, Provides2, deps2, "", false), } @@ -1053,8 +1053,8 @@ func TestSolveOperators_IgnoreUnsatisfiableDependencies(t *testing.T) { community := cache.SourceKey{Name: "community", Namespace: namespace} subs := []*v1alpha1.Subscription{ - existingSub(namespace, "packageA.v1", "packageA", "alpha", community), - newSub(namespace, "packageB", "alpha", community), + existingSub(namespace, "test-package.v1", "test-package", "alpha", community), + newSub(namespace, "another-package", "alpha", community), } opToAddVersionDeps := []*api.Dependency{ @@ -1074,22 +1074,22 @@ func TestSolveOperators_IgnoreUnsatisfiableDependencies(t *testing.T) { cache: cache.New(cache.StaticSourceProvider{ community: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "community", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "community", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "community", "olm", nil, nil, unsatisfiableVersionDeps, "", false), }, }, {Namespace: "olm", Name: "certified"}: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", "certified", "olm", nil, nil, nil, "", false), - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "certified", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", "certified", "olm", nil, nil, nil, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "certified", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "certified", "olm", nil, nil, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic( namespace, subs, - existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil), + existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil), ), }), log: logrus.New(), @@ -1098,7 +1098,7 @@ func TestSolveOperators_IgnoreUnsatisfiableDependencies(t *testing.T) { operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), + genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false), genEntry("packageC.v1", "0.1.0", "", "packageC", "alpha", "certified", "olm", nil, nil, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -1115,20 +1115,20 @@ func TestSolveOperators_PreferCatalogInSameNamespace(t *testing.T) { catalog := cache.SourceKey{Name: "community", Namespace: namespace} altnsCatalog := cache.SourceKey{Name: "alt-community", Namespace: altNamespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - sub := existingSub(namespace, "packageA.v1", "packageA", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + sub := existingSub(namespace, "test-package.v1", "test-package", "alpha", catalog) subs := []*v1alpha1.Subscription{sub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, "", false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, "", false), }, }, altnsCatalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "alpha", altnsCatalog.Name, altnsCatalog.Namespace, nil, Provides, nil, "", false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "alpha", altnsCatalog.Name, altnsCatalog.Namespace, nil, Provides, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -1140,7 +1140,7 @@ func TestSolveOperators_PreferCatalogInSameNamespace(t *testing.T) { assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, "", false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, "", false), } require.ElementsMatch(t, expected, operators) } @@ -1155,15 +1155,15 @@ func TestSolveOperators_ResolveOnlyInCachedNamespaces(t *testing.T) { catalog := cache.SourceKey{Name: "community", Namespace: namespace} otherCatalog := cache.SourceKey{Name: "secret", Namespace: "secret"} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - newSub := newSub(namespace, "packageA", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + newSub := newSub(namespace, "test-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "alpha", otherCatalog.Name, otherCatalog.Namespace, nil, Provides, nil, "", false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "alpha", otherCatalog.Name, otherCatalog.Namespace, nil, Provides, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -1187,7 +1187,7 @@ func TestSolveOperators_PreferDefaultChannelInResolution(t *testing.T) { const defaultChannel = "stable" // do not specify a channel explicitly on the subscription - newSub := newSub(namespace, "packageA", "", catalog) + newSub := newSub(namespace, "test-package", "", catalog) subs := []*v1alpha1.Subscription{newSub} resolver := Resolver{ @@ -1195,8 +1195,8 @@ func TestSolveOperators_PreferDefaultChannelInResolution(t *testing.T) { catalog: &cache.Snapshot{ Entries: []*cache.Entry{ // Default channel is stable in this case - genEntry("packageA.v0.0.2", "0.0.2", "packageA.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "stable", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), + genEntry("test-package.v0.0.2", "0.0.2", "test-package.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "stable", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), }, }, }), @@ -1208,7 +1208,7 @@ func TestSolveOperators_PreferDefaultChannelInResolution(t *testing.T) { // operator should be from the default stable channel expected := []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "stable", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "stable", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), } require.ElementsMatch(t, expected, operators) } @@ -1221,7 +1221,7 @@ func TestSolveOperators_PreferDefaultChannelInResolutionForTransitiveDependencie namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - newSub := newSub(namespace, "packageA", "alpha", catalog) + newSub := newSub(namespace, "test-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} const defaultChannel = "stable" @@ -1230,9 +1230,9 @@ func TestSolveOperators_PreferDefaultChannelInResolutionForTransitiveDependencie cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, Provides, nil, apiSetToDependencies(nil, Provides), defaultChannel, false), - genEntry("packageB.v0.0.1", "0.0.1", "packageB.v1", "packageB", defaultChannel, catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), - genEntry("packageB.v0.0.2", "0.0.2", "packageB.v0.0.1", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, Provides, nil, apiSetToDependencies(nil, Provides), defaultChannel, false), + genEntry("another-package.v0.0.1", "0.0.1", "another-package.v1", "another-package", defaultChannel, catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), + genEntry("another-package.v0.0.2", "0.0.2", "another-package.v0.0.1", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), }, }, }), @@ -1244,8 +1244,8 @@ func TestSolveOperators_PreferDefaultChannelInResolutionForTransitiveDependencie // operator should be from the default stable channel expected := []*cache.Entry{ - genEntry("packageA.v0.0.1", "0.0.1", "packageA.v1", "packageA", "alpha", catalog.Name, catalog.Namespace, Provides, nil, apiSetToDependencies(nil, Provides), defaultChannel, false), - genEntry("packageB.v0.0.1", "0.0.1", "packageB.v1", "packageB", defaultChannel, catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), + genEntry("test-package.v0.0.1", "0.0.1", "test-package.v1", "test-package", "alpha", catalog.Name, catalog.Namespace, Provides, nil, apiSetToDependencies(nil, Provides), defaultChannel, false), + genEntry("another-package.v0.0.1", "0.0.1", "another-package.v1", "another-package", defaultChannel, catalog.Name, catalog.Namespace, nil, Provides, nil, defaultChannel, false), } require.ElementsMatch(t, expected, operators) } @@ -1257,8 +1257,8 @@ func TestSolveOperators_SubscriptionlessOperatorsSatisfyDependencies(t *testing. namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} deps := []*api.Dependency{ @@ -1272,8 +1272,8 @@ func TestSolveOperators_SubscriptionlessOperatorsSatisfyDependencies(t *testing. cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageB.v1.0.0", "1.0.0", "", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("another-package.v1.0.0", "1.0.0", "", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", Provides, nil, deps, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -1284,7 +1284,7 @@ func TestSolveOperators_SubscriptionlessOperatorsSatisfyDependencies(t *testing. operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", catalog.Name, catalog.Namespace, Provides, nil, apiSetToDependencies(Provides, nil), "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", catalog.Name, catalog.Namespace, Provides, nil, apiSetToDependencies(Provides, nil), "", false), } assert.ElementsMatch(t, expected, operators) } @@ -1296,16 +1296,16 @@ func TestSolveOperators_SubscriptionlessOperatorsCanConflict(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - csv := existingOperator(namespace, "packageA.v1", "packageA", "alpha", "", Provides, nil, nil, nil) - newSub := newSub(namespace, "packageB", "alpha", catalog) + csv := existingOperator(namespace, "test-package.v1", "test-package", "alpha", "", Provides, nil, nil, nil) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageB.v1.0.0", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, Provides, nil, "", false), - genEntry("packageB.v1.0.1", "1.0.1", "packageB.v1.0.0", "packageB", "alpha", "community", "olm", nil, Provides, nil, "", false), + genEntry("another-package.v1.0.0", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, Provides, nil, "", false), + genEntry("another-package.v1.0.1", "1.0.1", "another-package.v1.0.0", "another-package", "alpha", "community", "olm", nil, Provides, nil, "", false), }, }, cache.NewVirtualSourceKey(namespace): csvSnapshotOrPanic(namespace, subs, csv), @@ -1329,24 +1329,24 @@ func TestSolveOperators_PackageCannotSelfSatisfy(t *testing.T) { catalog := cache.SourceKey{Name: "community", Namespace: namespace} secondaryCatalog := cache.SourceKey{Namespace: "olm", Name: "secondary"} - newSub := newSub(namespace, "packageA", "stable", catalog) + newSub := newSub(namespace, "test-package", "stable", catalog) subs := []*v1alpha1.Subscription{newSub} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, RequiresBoth, nil, nil, "", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, RequiresBoth, nil, nil, "", false), // Despite satisfying dependencies of opA, this is not chosen because it is in the same package - genEntry("opABC.v1.0.0", "1.0.0", "", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, ProvidesBoth, nil, "", false), + genEntry("opABC.v1.0.0", "1.0.0", "", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, ProvidesBoth, nil, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), - genEntry("opD.v1.0.0", "1.0.0", "", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), + genEntry("opD.v1.0.0", "1.0.0", "", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), }, }, secondaryCatalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opC.v1.0.0", "1.0.0", "", "packageB", "stable", secondaryCatalog.Name, secondaryCatalog.Namespace, nil, Provides2, nil, "stable", false), + genEntry("opC.v1.0.0", "1.0.0", "", "another-package", "stable", secondaryCatalog.Name, secondaryCatalog.Namespace, nil, Provides2, nil, "stable", false), genEntry("opE.v1.0.0", "1.0.0", "", "packageC", "stable", secondaryCatalog.Name, secondaryCatalog.Namespace, nil, Provides2, nil, "", false), }, @@ -1358,8 +1358,8 @@ func TestSolveOperators_PackageCannotSelfSatisfy(t *testing.T) { operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) expected := []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, RequiresBoth, nil, nil, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, RequiresBoth, nil, nil, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), genEntry("opE.v1.0.0", "1.0.0", "", "packageC", "stable", secondaryCatalog.Name, secondaryCatalog.Namespace, nil, Provides2, nil, "", false), } assert.ElementsMatch(t, expected, operators) @@ -1386,29 +1386,29 @@ func TestSolveOperators_TransferApiOwnership(t *testing.T) { expected []*cache.Entry }{ { - subs: []*v1alpha1.Subscription{newSub(namespace, "packageB", "stable", catalog)}, + subs: []*v1alpha1.Subscription{newSub(namespace, "another-package", "stable", catalog)}, catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), }, }, expected: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), }, }, { // will have two existing subs after resolving once subs: []*v1alpha1.Subscription{ - existingSub(namespace, "opA.v1.0.0", "packageA", "stable", catalog), - existingSub(namespace, "opB.v1.0.0", "packageB", "stable", catalog), + existingSub(namespace, "opA.v1.0.0", "test-package", "stable", catalog), + existingSub(namespace, "opB.v1.0.0", "another-package", "stable", catalog), }, catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), - genEntry("opA.v1.0.1", "1.0.1", "opA.v1.0.0", "packageA", "stable", catalog.Name, catalog.Namespace, Requires1, nil, nil, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), + genEntry("opA.v1.0.1", "1.0.1", "opA.v1.0.0", "test-package", "stable", catalog.Name, catalog.Namespace, Requires1, nil, nil, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), }, }, // nothing new to do here @@ -1417,20 +1417,20 @@ func TestSolveOperators_TransferApiOwnership(t *testing.T) { { // will have two existing subs after resolving once subs: []*v1alpha1.Subscription{ - existingSub(namespace, "opA.v1.0.0", "packageA", "stable", catalog), - existingSub(namespace, "opB.v1.0.0", "packageB", "stable", catalog), + existingSub(namespace, "opA.v1.0.0", "test-package", "stable", catalog), + existingSub(namespace, "opB.v1.0.0", "another-package", "stable", catalog), }, catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), - genEntry("opA.v1.0.1", "1.0.1", "opA.v1.0.0", "packageA", "stable", catalog.Name, catalog.Namespace, Requires1, nil, nil, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), - genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "packageB", "stable", catalog.Name, catalog.Namespace, nil, ProvidesBoth, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), + genEntry("opA.v1.0.1", "1.0.1", "opA.v1.0.0", "test-package", "stable", catalog.Name, catalog.Namespace, Requires1, nil, nil, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, Requires1, Provides2, nil, "stable", false), + genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "another-package", "stable", catalog.Name, catalog.Namespace, nil, ProvidesBoth, nil, "stable", false), }, }, expected: []*cache.Entry{ - genEntry("opA.v1.0.1", "1.0.1", "opA.v1.0.0", "packageA", "stable", catalog.Name, catalog.Namespace, Requires1, nil, nil, "", false), - genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "packageB", "stable", catalog.Name, catalog.Namespace, nil, ProvidesBoth, nil, "stable", false), + genEntry("opA.v1.0.1", "1.0.1", "opA.v1.0.0", "test-package", "stable", catalog.Name, catalog.Namespace, Requires1, nil, nil, "", false), + genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "another-package", "stable", catalog.Name, catalog.Namespace, nil, ProvidesBoth, nil, "stable", false), }, }, } @@ -1530,14 +1530,14 @@ func TestSolveOperators_WithoutDeprecated(t *testing.T) { catalog := cache.SourceKey{Name: "catalog", Namespace: "namespace"} subs := []*v1alpha1.Subscription{ - newSub(catalog.Namespace, "packageA", "alpha", catalog), + newSub(catalog.Namespace, "test-package", "alpha", catalog), } resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("packageA.v1", "0.0.1", "", "packageA", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", true), + genEntry("test-package.v1", "0.0.1", "", "test-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", true), }, }, }), @@ -1581,7 +1581,7 @@ func TestSolveOperators_WithSkipsAndStartingCSV(t *testing.T) { namespace := "olm" catalog := cache.SourceKey{Name: "community", Namespace: namespace} - newSub := newSub(namespace, "packageB", "alpha", catalog, withStartingCSV("packageB.v1")) + newSub := newSub(namespace, "another-package", "alpha", catalog, withStartingCSV("another-package.v1")) subs := []*v1alpha1.Subscription{newSub} opToAddVersionDeps := []*api.Dependency{ @@ -1591,17 +1591,17 @@ func TestSolveOperators_WithSkipsAndStartingCSV(t *testing.T) { }, } - opB := genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false) - opB2 := genEntry("packageB.v2", "2.0.0", "", "packageB", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false) - opB2.Skips = []string{"packageB.v1"} - op1 := genEntry("packageA.v1", "1.0.0", "", "packageA", "alpha", "community", "olm", nil, Provides, nil, "", false) - op2 := genEntry("packageA.v2", "2.0.0", "packageA.v1", "packageA", "alpha", "community", "olm", nil, Provides, nil, "", false) - op3 := genEntry("packageA.v3", "3.0.0", "packageA.v2", "packageA", "alpha", "community", "olm", nil, Provides, nil, "", false) - op4 := genEntry("packageA.v4", "4.0.0", "packageA.v3", "packageA", "alpha", "community", "olm", nil, Provides, nil, "", false) - op4.Skips = []string{"packageA.v3"} - op5 := genEntry("packageA.v5", "5.0.0", "packageA.v4", "packageA", "alpha", "community", "olm", nil, Provides, nil, "", false) - op5.Skips = []string{"packageA.v2", "packageA.v3", "packageA.v4"} - op6 := genEntry("packageA.v6", "6.0.0", "packageA.v5", "packageA", "alpha", "community", "olm", nil, Provides, nil, "", false) + opB := genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false) + opB2 := genEntry("another-package.v2", "2.0.0", "", "another-package", "alpha", "community", "olm", nil, nil, opToAddVersionDeps, "", false) + opB2.Skips = []string{"another-package.v1"} + op1 := genEntry("test-package.v1", "1.0.0", "", "test-package", "alpha", "community", "olm", nil, Provides, nil, "", false) + op2 := genEntry("test-package.v2", "2.0.0", "test-package.v1", "test-package", "alpha", "community", "olm", nil, Provides, nil, "", false) + op3 := genEntry("test-package.v3", "3.0.0", "test-package.v2", "test-package", "alpha", "community", "olm", nil, Provides, nil, "", false) + op4 := genEntry("test-package.v4", "4.0.0", "test-package.v3", "test-package", "alpha", "community", "olm", nil, Provides, nil, "", false) + op4.Skips = []string{"test-package.v3"} + op5 := genEntry("test-package.v5", "5.0.0", "test-package.v4", "test-package", "alpha", "community", "olm", nil, Provides, nil, "", false) + op5.Skips = []string{"test-package.v2", "test-package.v3", "test-package.v4"} + op6 := genEntry("test-package.v6", "6.0.0", "test-package.v5", "test-package", "alpha", "community", "olm", nil, Provides, nil, "", false) resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ @@ -1616,7 +1616,7 @@ func TestSolveOperators_WithSkipsAndStartingCSV(t *testing.T) { operators, err := resolver.Resolve([]string{"olm"}, subs) assert.NoError(t, err) - opB.SourceInfo.StartingCSV = "packageB.v1" + opB.SourceInfo.StartingCSV = "another-package.v1" expected := []*cache.Entry{opB, op6} require.ElementsMatch(t, expected, operators) } @@ -1625,12 +1625,12 @@ func TestSolveOperators_WithSkips(t *testing.T) { const namespace = "test-namespace" catalog := cache.SourceKey{Name: "test-catalog", Namespace: namespace} - newSub := newSub(namespace, "packageB", "alpha", catalog) + newSub := newSub(namespace, "another-package", "alpha", catalog) subs := []*v1alpha1.Subscription{newSub} - opB := genEntry("packageB.v1", "1.0.0", "", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false) - opB2 := genEntry("packageB.v2", "2.0.0", "", "packageB", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false) - opB2.Skips = []string{"packageB.v1"} + opB := genEntry("another-package.v1", "1.0.0", "", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false) + opB2 := genEntry("another-package.v2", "2.0.0", "", "another-package", "alpha", catalog.Name, catalog.Namespace, nil, nil, nil, "", false) + opB2.Skips = []string{"another-package.v1"} resolver := Resolver{ cache: cache.New(cache.StaticSourceProvider{ @@ -1951,7 +1951,7 @@ func TestSolveOperators_GenericConstraint(t *testing.T) { { Type: "olm.constraint", Value: `{"failureMessage":"package-constraint", - "cel":{"rule":"properties.exists(p, p.type == 'olm.package' && p.value.packageName == 'packageB' && (semver_compare(p.value.version, '1.0.1') == 0))"}}`, + "cel":{"rule":"properties.exists(p, p.type == 'olm.package' && p.value.packageName == 'another-package' && (semver_compare(p.value.version, '1.0.1') == 0))"}}`, }, } @@ -1968,17 +1968,17 @@ func TestSolveOperators_GenericConstraint(t *testing.T) { name: "Generic Constraint/Satisfiable GVK Dependency", isErr: false, subs: []*v1alpha1.Subscription{ - newSub(namespace, "packageA", "stable", catalog), + newSub(namespace, "test-package", "stable", catalog), }, catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, nil, deps1, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, nil, deps1, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), }, }, expected: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, nil, deps1, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, nil, deps1, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "stable", false), }, }, { @@ -1986,12 +1986,12 @@ func TestSolveOperators_GenericConstraint(t *testing.T) { name: "Generic Constraint/NotSatisfiable GVK Dependency", isErr: true, subs: []*v1alpha1.Subscription{ - newSub(namespace, "packageA", "stable", catalog), + newSub(namespace, "test-package", "stable", catalog), }, catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, nil, deps2, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, nil, deps2, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, nil, Provides1, nil, "", false), }, }, // unable to find satisfiable gvk dependency @@ -2004,19 +2004,19 @@ func TestSolveOperators_GenericConstraint(t *testing.T) { name: "Generic Constraint/Satisfiable Package Dependency", isErr: false, subs: []*v1alpha1.Subscription{ - newSub(namespace, "packageA", "stable", catalog), + newSub(namespace, "test-package", "stable", catalog), }, catalog: &cache.Snapshot{ Entries: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, nil, deps3, "", false), - genEntry("opB.v1.0.0", "1.0.0", "", "packageB", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), - genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "packageB", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "stable", false), - genEntry("opB.v1.0.2", "1.0.2", "opB.v1.0.1", "packageB", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, nil, deps3, "", false), + genEntry("opB.v1.0.0", "1.0.0", "", "another-package", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "", false), + genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "another-package", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "stable", false), + genEntry("opB.v1.0.2", "1.0.2", "opB.v1.0.1", "another-package", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "stable", false), }, }, expected: []*cache.Entry{ - genEntry("opA.v1.0.0", "1.0.0", "", "packageA", "stable", catalog.Name, catalog.Namespace, nil, nil, deps3, "", false), - genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "packageB", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "stable", false), + genEntry("opA.v1.0.0", "1.0.0", "", "test-package", "stable", catalog.Name, catalog.Namespace, nil, nil, deps3, "", false), + genEntry("opB.v1.0.1", "1.0.1", "opB.v1.0.0", "another-package", "stable", catalog.Name, catalog.Namespace, nil, nil, nil, "stable", false), }, }, } diff --git a/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go index ee2206ca94..8f7d30399e 100644 --- a/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go @@ -1452,7 +1452,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { CatalogSource: catalogSourceName, CatalogSourceNamespace: generatedNamespace.GetName(), Channel: "stable", - Package: "packageA", + Package: "test-package", }, } Expect(c.Create(context.Background(), subscription)).To(BeNil()) diff --git a/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go b/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go index 636ebd012f..78fd617e9a 100644 --- a/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go @@ -95,7 +95,7 @@ var _ = Describe("Global Catalog Exclusion", func() { Spec: &v1alpha1.SubscriptionSpec{ CatalogSource: localCatalog.GetName(), CatalogSourceNamespace: localCatalog.GetNamespace(), - Package: "packageA", + Package: "test-package", Channel: "stable", InstallPlanApproval: v1alpha1.ApprovalAutomatic, }, diff --git a/staging/operator-lifecycle-manager/test/e2e/data/catalog.new.yaml b/staging/operator-lifecycle-manager/test/e2e/data/catalog.new.yaml index 6dc3df27bb..6730676555 100644 --- a/staging/operator-lifecycle-manager/test/e2e/data/catalog.new.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/data/catalog.new.yaml @@ -1,4 +1,4 @@ -# Contains PackageB (Updated), PackageC (new) +# Contains another-package (Updated), PackageC (new) kind: ConfigMap apiVersion: v1 metadata: diff --git a/staging/operator-lifecycle-manager/test/e2e/data/catalog.old.yaml b/staging/operator-lifecycle-manager/test/e2e/data/catalog.old.yaml index ae05008e23..c2f469203e 100644 --- a/staging/operator-lifecycle-manager/test/e2e/data/catalog.old.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/data/catalog.old.yaml @@ -1,4 +1,4 @@ -# Contains PackageA, PackageB +# Contains test-package, another-package kind: ConfigMap apiVersion: v1 metadata: diff --git a/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go index 250db0c1ed..592da29e8b 100644 --- a/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go @@ -183,7 +183,7 @@ var _ = Describe("Fail Forward Upgrades", func() { CatalogSource: catalogSourceName, CatalogSourceNamespace: generatedNamespace.GetName(), Channel: "stable", - Package: "packageA", + Package: "test-package", }, } Expect(c.Create(context.Background(), subscription)).To(BeNil()) @@ -348,7 +348,7 @@ var _ = Describe("Fail Forward Upgrades", func() { CatalogSource: catalogSourceName, CatalogSourceNamespace: generatedNamespace.GetName(), Channel: "stable", - Package: "packageA", + Package: "test-package", }, } Expect(c.Create(context.Background(), subscription)).To(BeNil()) diff --git a/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go b/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go index 02b4eb0a12..9e583b8ed3 100644 --- a/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go @@ -90,11 +90,11 @@ var _ = Describe("MagicCatalog", func() { return data }, ContainSubstring(`--- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: busybox.v2.0.0 @@ -102,7 +102,7 @@ entries: --- schema: olm.bundle name: busybox.v2.0.0 -package: packageA +package: test-package image: quay.io/olmtest/busybox-bundle:2.0.0 properties: - type: olm.gvk @@ -112,7 +112,7 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.0 `)), )) diff --git a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go index c06991aed0..4f625114b6 100644 --- a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go @@ -1461,16 +1461,18 @@ var _ = Describe("Subscription", func() { By(`csvs for catalogsource 2`) csvs2 := make([]operatorsv1alpha1.ClusterServiceVersion, 0) - packageA := registry.PackageManifest{PackageName: "PackageA"} + testPackage := registry.PackageManifest{PackageName: "test-package"} By("Package A", func() { Step(1, "Default Channel: Stable", func() { - packageA.DefaultChannelName = stableChannel + testPackage.DefaultChannelName = stableChannel }) Step(1, "Channel Stable", func() { Step(2, "Operator A (Requires CRD, CRD 2)", func() { csvA := newCSV("csv-a", generatedNamespace.GetName(), "", semver.MustParse("0.1.0"), nil, []apiextensionsv1.CustomResourceDefinition{crd, crd2}, nil) - packageA.Channels = append(packageA.Channels, registry.PackageChannel{Name: stableChannel, CurrentCSVName: csvA.GetName()}) + testPackage. + Channels = append(testPackage. + Channels, registry.PackageChannel{Name: stableChannel, CurrentCSVName: csvA.GetName()}) csvs1 = append(csvs1, csvA) }) }) @@ -1478,22 +1480,24 @@ var _ = Describe("Subscription", func() { Step(1, "Channel Alpha", func() { Step(2, "Operator ABC (Provides: CRD, CRD 2)", func() { csvABC := newCSV("csv-abc", generatedNamespace.GetName(), "", semver.MustParse("0.1.0"), []apiextensionsv1.CustomResourceDefinition{crd, crd2}, nil, nil) - packageA.Channels = append(packageA.Channels, registry.PackageChannel{Name: alphaChannel, CurrentCSVName: csvABC.GetName()}) + testPackage. + Channels = append(testPackage. + Channels, registry.PackageChannel{Name: alphaChannel, CurrentCSVName: csvABC.GetName()}) csvs1 = append(csvs1, csvABC) }) }) }) - packageB := registry.PackageManifest{PackageName: "PackageB"} + anotherPackage := registry.PackageManifest{PackageName: "another-package"} By("Package B", func() { Step(1, "Default Channel: Stable", func() { - packageB.DefaultChannelName = stableChannel + anotherPackage.DefaultChannelName = stableChannel }) Step(1, "Channel Stable", func() { Step(2, "Operator B (Provides: CRD)", func() { csvB := newCSV("csv-b", generatedNamespace.GetName(), "", semver.MustParse("0.1.0"), []apiextensionsv1.CustomResourceDefinition{crd}, nil, nil) - packageB.Channels = append(packageB.Channels, registry.PackageChannel{Name: stableChannel, CurrentCSVName: csvB.GetName()}) + anotherPackage.Channels = append(anotherPackage.Channels, registry.PackageChannel{Name: stableChannel, CurrentCSVName: csvB.GetName()}) csvs1 = append(csvs1, csvB) }) }) @@ -1501,13 +1505,13 @@ var _ = Describe("Subscription", func() { Step(1, "Channel Alpha", func() { Step(2, "Operator D (Provides: CRD)", func() { csvD := newCSV("csv-d", generatedNamespace.GetName(), "", semver.MustParse("0.1.0"), []apiextensionsv1.CustomResourceDefinition{crd}, nil, nil) - packageB.Channels = append(packageB.Channels, registry.PackageChannel{Name: alphaChannel, CurrentCSVName: csvD.GetName()}) + anotherPackage.Channels = append(anotherPackage.Channels, registry.PackageChannel{Name: alphaChannel, CurrentCSVName: csvD.GetName()}) csvs1 = append(csvs1, csvD) }) }) }) - packageBInCatsrc2 := registry.PackageManifest{PackageName: "PackageB"} + packageBInCatsrc2 := registry.PackageManifest{PackageName: "another-package"} By("Package B", func() { Step(1, "Default Channel: Stable", func() { packageBInCatsrc2.DefaultChannelName = stableChannel @@ -1542,7 +1546,7 @@ var _ = Describe("Subscription", func() { var cleanup cleanupFunc By("creating catalogsources", func() { var c1, c2 cleanupFunc - catsrc, c1 = createInternalCatalogSource(kubeClient, crClient, genName("catsrc"), generatedNamespace.GetName(), []registry.PackageManifest{packageA, packageB}, []apiextensionsv1.CustomResourceDefinition{crd, crd2}, csvs1) + catsrc, c1 = createInternalCatalogSource(kubeClient, crClient, genName("catsrc"), generatedNamespace.GetName(), []registry.PackageManifest{testPackage, anotherPackage}, []apiextensionsv1.CustomResourceDefinition{crd, crd2}, csvs1) catsrc2, c2 = createInternalCatalogSource(kubeClient, crClient, genName("catsrc2"), generatedNamespace.GetName(), []registry.PackageManifest{packageBInCatsrc2, packageC}, []apiextensionsv1.CustomResourceDefinition{crd, crd2}, csvs2) cleanup = func() { c1() @@ -1558,11 +1562,11 @@ var _ = Describe("Subscription", func() { require.NoError(GinkgoT(), err) }) - By(`Create a subscription for packageA in catsrc`) + By(`Create a subscription for test-package in catsrc`) subscriptionSpec := &operatorsv1alpha1.SubscriptionSpec{ CatalogSource: catsrc.GetName(), CatalogSourceNamespace: catsrc.GetNamespace(), - Package: packageA.PackageName, + Package: testPackage.PackageName, Channel: stableChannel, InstallPlanApproval: operatorsv1alpha1.ApprovalAutomatic, } @@ -1668,7 +1672,7 @@ var _ = Describe("Subscription", func() { var subscription *operatorsv1alpha1.Subscription BeforeEach(func() { - By(`Create a subscription for packageA in catsrc`) + By(`Create a subscription for test-package in catsrc`) subscriptionSpec := &operatorsv1alpha1.SubscriptionSpec{ CatalogSource: catsrcMain.GetName(), CatalogSourceNamespace: catsrcMain.GetNamespace(), @@ -1756,7 +1760,7 @@ var _ = Describe("Subscription", func() { var subscription *operatorsv1alpha1.Subscription BeforeEach(func() { - By(`Create a subscription for packageA in catsrc`) + By(`Create a subscription for test-package in catsrc`) subscriptionSpec := &operatorsv1alpha1.SubscriptionSpec{ CatalogSource: catsrcMain.GetName(), CatalogSourceNamespace: catsrcMain.GetNamespace(), @@ -1850,7 +1854,7 @@ var _ = Describe("Subscription", func() { var subscription *operatorsv1alpha1.Subscription BeforeEach(func() { - By(`Create a subscription for packageA in catsrc`) + By(`Create a subscription for test-package in catsrc`) subscriptionSpec := &operatorsv1alpha1.SubscriptionSpec{ CatalogSource: catsrcMain.GetName(), CatalogSourceNamespace: catsrcMain.GetNamespace(), @@ -1944,7 +1948,7 @@ var _ = Describe("Subscription", func() { var subscription *operatorsv1alpha1.Subscription BeforeEach(func() { - By(`Create a subscription for packageA in catsrc`) + By(`Create a subscription for test-package in catsrc`) subscriptionSpec := &operatorsv1alpha1.SubscriptionSpec{ CatalogSource: catsrcMain.GetName(), CatalogSourceNamespace: catsrcMain.GetNamespace(), @@ -2156,7 +2160,7 @@ var _ = Describe("Subscription", func() { packages = []registry.PackageManifest{ { - PackageName: "packageA", + PackageName: "test-package", Channels: []registry.PackageChannel{ {Name: "alpha", CurrentCSVName: "csvA"}, }, @@ -2171,7 +2175,7 @@ var _ = Describe("Subscription", func() { _, err := fetchCatalogSourceOnStatus(crc, catSrcName, generatedNamespace.GetName(), catalogSourceRegistryPodSynced()) require.NoError(GinkgoT(), err) - cleanup = createSubscriptionForCatalog(crc, generatedNamespace.GetName(), subName, catSrcName, "packageA", "alpha", "", operatorsv1alpha1.ApprovalAutomatic) + cleanup = createSubscriptionForCatalog(crc, generatedNamespace.GetName(), subName, catSrcName, "test-package", "alpha", "", operatorsv1alpha1.ApprovalAutomatic) }) AfterEach(func() { @@ -2193,7 +2197,7 @@ var _ = Describe("Subscription", func() { BeforeEach(func() { newPkg := registry.PackageManifest{ - PackageName: "PackageB", + PackageName: "another-package", Channels: []registry.PackageChannel{ {Name: "alpha", CurrentCSVName: "csvB"}, }, @@ -2422,8 +2426,8 @@ var _ = Describe("Subscription", func() { Expect(magicCatalog.DeployCatalog(context.Background())).To(BeNil()) By("creating the testing subscription") - subName = fmt.Sprintf("%s-packagea-sub", generatedNamespace.GetName()) - createSubscriptionForCatalog(crc, generatedNamespace.GetName(), subName, catalogSourceName, "packageA", stableChannel, "", operatorsv1alpha1.ApprovalAutomatic) + subName = fmt.Sprintf("%s-test-package-sub", generatedNamespace.GetName()) + createSubscriptionForCatalog(crc, generatedNamespace.GetName(), subName, catalogSourceName, "test-package", stableChannel, "", operatorsv1alpha1.ApprovalAutomatic) By("waiting until the subscription has an IP reference") subscription, err := fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasInstallPlanChecker()) @@ -2594,13 +2598,11 @@ var _ = Describe("Subscription", func() { Expect(err).To(BeNil()) By("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition") - _, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionDoesNotHaveCondition(operatorsv1alpha1.SubscriptionBundleDeprecated)) - Expect(err).Should(BeNil()) sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCondition( operatorsv1alpha1.SubscriptionPackageDeprecated, corev1.ConditionTrue, "", - "olm.package/packageA: packageA has been deprecated. Please switch to packageB.")) + "olm.package/test-package: test-package has been deprecated. Please switch to another-package.")) Expect(err).Should(BeNil()) By("checking for the deprecated conditions") @@ -2827,8 +2829,8 @@ properties: Expect(magicCatalog.DeployCatalog(context.Background())).To(BeNil()) By("creating the testing subscription") - subName := fmt.Sprintf("%s-packagea-sub", generatedNamespace.GetName()) - createSubscriptionForCatalog(crc, generatedNamespace.GetName(), subName, catalogSourceName, "packageA", stableChannel, "", operatorsv1alpha1.ApprovalAutomatic) + subName := fmt.Sprintf("%s-test-package-sub", generatedNamespace.GetName()) + createSubscriptionForCatalog(crc, generatedNamespace.GetName(), subName, catalogSourceName, "test-package", stableChannel, "", operatorsv1alpha1.ApprovalAutomatic) By("waiting until the subscription has an IP reference") subscription, err := fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasInstallPlanChecker()) @@ -3268,6 +3270,7 @@ func fetchSubscription(crc versioned.Interface, namespace, name string, checker if thisState != lastState || thisCSV != lastCSV || !equality.Semantic.DeepEqual(thisInstallPlanRef, lastInstallPlanRef) { lastState, lastCSV, lastInstallPlanRef = thisState, thisCSV, thisInstallPlanRef log(fmt.Sprintf("subscription %s/%s state: %s (csv %s): installPlanRef: %#v", namespace, name, thisState, thisCSV, thisInstallPlanRef)) + log(fmt.Sprintf("subscription %s/%s state: %s (csv %s): status: %#v", namespace, name, thisState, thisCSV, fetchedSubscription.Status)) } return checker(fetchedSubscription), nil }) diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/bad-csv/bad-csv.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/bad-csv/bad-csv.yaml index 0db1f61a48..23f99366f7 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/bad-csv/bad-csv.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/bad-csv/bad-csv.yaml @@ -1,17 +1,17 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: bad-csv --- schema: olm.bundle name: bad-csv -package: packageA +package: test-package image: quay.io/olmtest/missing_api_version:latest properties: - type: olm.gvk @@ -21,5 +21,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.1.0/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.1.0/packagemanifest.yaml index 62f2ff17cc..9821484dce 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.1.0/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.1.0/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.1.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-csv/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-csv/packagemanifest.yaml index 606811ff2c..efba4d6a04 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-csv/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-csv/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.2.0&invalid diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-deployment/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-deployment/packagemanifest.yaml index a79d9a7187..e8f54b6579 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-deployment/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.0-invalid-deployment/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.2.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.1-invalid-csv/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.1-invalid-csv/packagemanifest.yaml index 0232f2c741..135e6366df 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.1-invalid-csv/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.2.1-invalid-csv/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.2.1&invalid diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-csv/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-csv/packagemanifest.yaml index 584cd2d41e..f23038ec00 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-csv/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-csv/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.3.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-deployment/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-deployment/packagemanifest.yaml index 584cd2d41e..f23038ec00 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-deployment/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-replaces-invalid-deployment/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.3.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skip-range/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skip-range/packagemanifest.yaml index 584cd2d41e..f23038ec00 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skip-range/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skip-range/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.3.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skips/packagemanifest.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skips/packagemanifest.yaml index 584cd2d41e..f23038ec00 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skips/packagemanifest.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/fail-forward/v0.3.0-skips/packagemanifest.yaml @@ -1,4 +1,4 @@ -packageName: packageA +packageName: test-package channels: - name: stable currentCSV: example-operator.v0.3.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_catalog.json b/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_catalog.json index c6c7ee6815..aae1664a36 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_catalog.json +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_catalog.json @@ -1,23 +1,23 @@ { "schema": "olm.package", - "name": "packageA", + "name": "test-package", "defaultChannel": "stable" } { "schema": "olm.channel", "name": "stable", - "package": "packageA", + "package": "test-package", "entries": [ { - "name": "packageA.v1.0.0" + "name": "test-package.v1.0.0" } ] } { "schema": "olm.bundle", - "name": "packageA.v1.0.0", - "package": "packageA", - "image": "packageA:v1.0.0", + "name": "test-package.v1.0.0", + "package": "test-package", + "image": "test-package:v1.0.0", "properties": [ { "type": "olm.gvk", @@ -30,7 +30,7 @@ { "type": "olm.package", "value": { - "packageName": "packageA", + "packageName": "test-package", "version": "1.0.0" } } diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_initial.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_initial.yaml index abccd7dec4..f4aa57a0e8 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_initial.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_initial.yaml @@ -1,17 +1,17 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: busybox.v1.0.0 --- schema: olm.bundle name: busybox.v1.0.0 -package: packageA +package: test-package image: quay.io/olmtest/busybox-bundle:1.0.0 properties: - type: olm.gvk @@ -21,5 +21,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_updated.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_updated.yaml index bd241dd7d3..fa376819a4 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_updated.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/magiccatalog/fbc_updated.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: busybox.v2.0.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: busybox.v2.0.0 -package: packageA +package: test-package image: quay.io/olmtest/busybox-bundle:2.0.0 properties: - type: olm.gvk @@ -22,5 +22,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.1.0.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.1.0.yaml index d2b4c981be..5d97e7cc85 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.1.0.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.1.0.yaml @@ -1,17 +1,17 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.1.0 --- schema: olm.bundle name: example-operator.v0.1.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:0.1.0 properties: - type: olm.gvk @@ -21,5 +21,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.0 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-deprecations.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-deprecations.yaml index be5158dff1..3ba5a98f0a 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-deprecations.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-deprecations.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.2.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: example-operator.v0.2.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:0.2.0 properties: - type: olm.gvk @@ -22,15 +22,15 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.1 --- schema: olm.deprecations -package: packageA +package: test-package entries: - reference: schema: olm.package - message: packageA has been deprecated. Please switch to packageB. + message: test-package has been deprecated. Please switch to another-package. - reference: schema: olm.channel name: stable diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-invalid-csv.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-invalid-csv.yaml index 030708d012..538a017d3e 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-invalid-csv.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-invalid-csv.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.2.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: example-operator.v0.2.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:0.2.0-invalid-csv properties: - type: olm.gvk @@ -22,5 +22,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.1 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-non-existent-tag.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-non-existent-tag.yaml index 555242e536..51950ae7ec 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-non-existent-tag.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0-non-existent-tag.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.2.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: example-operator.v0.2.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:non-existent-tag properties: - type: olm.gvk @@ -22,5 +22,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.1 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0.yaml index 3058376dd5..096c942399 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.2.0.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.2.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: example-operator.v0.2.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:0.2.0 properties: - type: olm.gvk @@ -22,5 +22,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 1.0.1 diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0-deprecations.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0-deprecations.yaml index 261308fbc7..c82ae5581e 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0-deprecations.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0-deprecations.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.3.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: example-operator.v0.3.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:0.3.0 properties: - type: olm.gvk @@ -22,15 +22,15 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 0.3.0 --- schema: olm.deprecations -package: packageA +package: test-package entries: - reference: schema: olm.package - message: packageA has been deprecated. Please switch to packageB. + message: test-package has been deprecated. Please switch to another-package. - reference: schema: olm.channel name: stable diff --git a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0.yaml b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0.yaml index 1f6189eb74..e27d66a2f7 100644 --- a/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0.yaml +++ b/staging/operator-lifecycle-manager/test/e2e/testdata/subscription/example-operator.v0.3.0.yaml @@ -1,10 +1,10 @@ --- schema: olm.package -name: packageA +name: test-package defaultChannel: stable --- schema: olm.channel -package: packageA +package: test-package name: stable entries: - name: example-operator.v0.3.0 @@ -12,7 +12,7 @@ entries: --- schema: olm.bundle name: example-operator.v0.3.0 -package: packageA +package: test-package image: quay.io/olmtest/example-operator-bundle:0.3.0 properties: - type: olm.gvk @@ -22,5 +22,5 @@ properties: version: v1alpha1 - type: olm.package value: - packageName: packageA + packageName: test-package version: 0.3.0 From d22e45e74ec6946872b00be1d0312c4e42879f26 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Mon, 27 May 2024 10:23:06 +0200 Subject: [PATCH 2/9] :seedling: patch flakes (#3281) * patch flakes Signed-off-by: Per Goncalves da Silva * Update test/e2e/subscription_e2e_test.go Co-authored-by: Mikalai Radchuk <509198+m1kola@users.noreply.github.com> --------- Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Co-authored-by: Mikalai Radchuk <509198+m1kola@users.noreply.github.com> Upstream-repository: operator-lifecycle-manager Upstream-commit: 161b89ca70027d720347ee9ce7729df4018584ba --- .../controller/operators/olm/operator_test.go | 2 +- .../test/e2e/subscription_e2e_test.go | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/staging/operator-lifecycle-manager/pkg/controller/operators/olm/operator_test.go b/staging/operator-lifecycle-manager/pkg/controller/operators/olm/operator_test.go index 492cc020ce..8c688326da 100644 --- a/staging/operator-lifecycle-manager/pkg/controller/operators/olm/operator_test.go +++ b/staging/operator-lifecycle-manager/pkg/controller/operators/olm/operator_test.go @@ -4030,7 +4030,7 @@ func TestUpdates(t *testing.T) { csvsToSync = syncCSVs(csvsToSync, deletedCSVs(e.shouldBe)) current = csvsToSync[e.whenIn.name] fmt.Printf("waiting for (when) %s to be %s\n", e.whenIn.name, e.whenIn.phase) - time.Sleep(1 * time.Millisecond) + time.Sleep(1 * time.Second) } // sync the other csvs until they're in the expected status diff --git a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go index 4f625114b6..602cd9185d 100644 --- a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go @@ -2597,14 +2597,20 @@ var _ = Describe("Subscription", func() { err = magicCatalog.UpdateCatalog(context.Background(), provider) Expect(err).To(BeNil()) - By("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition") - sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCondition( - operatorsv1alpha1.SubscriptionPackageDeprecated, - corev1.ConditionTrue, - "", - "olm.package/test-package: test-package has been deprecated. Please switch to another-package.")) + By("waiting for the subscription to have v0.3.0 installed") + sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCurrentCSV("example-operator.v0.3.0")) Expect(err).Should(BeNil()) + By("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition") + sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, + subscriptionHasCondition( + operatorsv1alpha1.SubscriptionPackageDeprecated, + corev1.ConditionTrue, + "", + "olm.package/test-package: test-package has been deprecated. Please switch to another-package.", + ), + ) + By("checking for the deprecated conditions") By(`Operator is deprecated at only Package and Channel levels`) packageCondition := sub.Status.GetCondition(operatorsv1alpha1.SubscriptionPackageDeprecated) From 562d968f251892cc36f4b6aaaf65cbc4ef74d117 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Fri, 24 May 2024 13:52:07 +0200 Subject: [PATCH 3/9] :seedling: parameterizes the e2e target and pins opm images (#3275) * parameterize e2e target Signed-off-by: Per Goncalves da Silva * pin opm image Signed-off-by: Per Goncalves da Silva * update default chart values to point to pinned opm image Signed-off-by: Per Goncalves da Silva --------- Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Upstream-repository: operator-lifecycle-manager Upstream-commit: 1f5e0dc8e55aba20f3cd637e0b021f081e5761bb --- .../.github/workflows/e2e-tests.yml | 60 ++++++++++++- staging/operator-lifecycle-manager/Makefile | 89 +++++++++++++------ .../deploy/chart/values.yaml | 1 + .../test/e2e/magic_catalog.go | 7 +- 4 files changed, 124 insertions(+), 33 deletions(-) diff --git a/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml b/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml index a93fc4a243..e786f44863 100644 --- a/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml +++ b/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml @@ -20,9 +20,63 @@ jobs: - uses: actions/setup-go@v4 with: go-version-file: "go.mod" - - run: mkdir -p artifacts - - run: make e2e-local E2E_TEST_CHUNK=${{ matrix.parallel-id }} E2E_TEST_NUM_CHUNKS=${{ strategy.job-total }} E2E_NODES=2 ARTIFACT_DIR=./artifacts/ SKIP='\[FLAKE\]' - - name: Archive Test Artifacts # test results, failed or not, are always uploaded. + + # load the olm image + - name: Load OLM Docker image + uses: actions/download-artifact@v4 + with: + name: olm-image.tar + path: . + - run: docker load < olm-image.tar + + # set e2e environment variables + # Set ginkgo output and parallelism + - run: echo "GINKGO_OPTS=-output-dir ${ARTIFACT_DIR} -junit-report junit_e2e.xml -nodes ${E2E_NODES}" >> $GITHUB_ENV + + # Setting -kubeconfig-root tells the e2e test suite to look for kubeconfigs + # in /kubeconfig- + # This is used to run tests in parallel on multiple clusters as the current e2e + # test suite does not support running tests in parallel on a single cluster + - run: echo "E2E_OPTS=-kubeconfig-root=${E2E_KUBECONFIG_ROOT}" >> $GITHUB_ENV + + # run e2e tests + # create artifacts directory + - run: mkdir -p ${ARTIFACT_DIR} + + # deploy test clusters + - name: Deploy test cluster(s) + # create kubeconfig root and store the kubeconfig for each cluster within it as you create the clusters + # Add kind and helm options to specify kubeconfig location + # Deploy the new cluster and helm install olm for testing + run: | + mkdir -p ${E2E_KUBECONFIG_ROOT} + for i in $(seq 1 ${E2E_NODES}); do + KIND_CLUSTER_NAME="kind-olmv0-${i}" \ + KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \ + HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \ + make kind-create deploy; + done + + # run non-flakes if matrix-id is not 'flakes' + - name: Run e2e tests + if: ${{ matrix.parallel-id != 'flakes' }} + # calculate the number of chunks as the number of parallel jobs minus 1 (flakes job) + # use the split tool to split the test suite into chunks and run the chunk corresponding to the matrix-id + # focus on those tests and skip tests marked as FLAKE + run: | + E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} - 1 )) \ + GINKGO_OPTS="${GINKGO_OPTS} -focus '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \ + make e2e; + + # run e2e tests for flakes if matrix-id is 'flakes' + - name: Run flaky e2e tests + if: ${{ matrix.parallel-id == 'flakes' }} + # focus on tests marked as FLAKE + run: | + GINKGO_OPTS="${GINKGO_OPTS} -focus '\[FLAKE\]'" make e2e + + # archive test results + - name: Archive Test Artifacts if: ${{ always() }} uses: actions/upload-artifact@v3 with: diff --git a/staging/operator-lifecycle-manager/Makefile b/staging/operator-lifecycle-manager/Makefile index 06df094021..9419126273 100644 --- a/staging/operator-lifecycle-manager/Makefile +++ b/staging/operator-lifecycle-manager/Makefile @@ -34,6 +34,27 @@ ARCH := arm64 else ARCH := 386 endif + +# Track the minor version of kubernetes we are building against by looking at the client-go dependency version +# For example, a client-go version of v0.28.5 will map to kube version 1.28 +KUBE_MINOR ?= $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1/') + +# Unit test against the latest available version for the minor version of kubernetes we are building against e.g. 1.30.x +ENVTEST_KUBE_VERSION ?= $(KUBE_MINOR).x + +# Kind node image tags are in the format x.y.z we pin to version x.y.0 because patch releases and node images +# are not guaranteed to be available when a new version of the kube apis is released +KIND_NODE_VERSION ?= $(KUBE_MINOR).0 +KIND_CLUSTER_NAME ?= kind-olmv0 +KIND_CLUSTER_IMAGE := kindest/node:v$(KIND_NODE_VERSION) + +# Take operator registry tag from operator registry version in go.mod +export OPERATOR_REGISTRY_TAG ?= $(shell go list -m github.com/operator-framework/operator-registry | cut -d" " -f2) + +# Pin operator registry images to the OPERATOR_REGISTRY_TAG +export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm:$(OPERATOR_REGISTRY_TAG) +export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry:$(OPERATOR_REGISTRY_TAG) + # Phony prerequisite for targets that rely on the go build cache to determine staleness. .PHONY: build test clean vendor \ coverage coverage-html e2e \ @@ -123,29 +144,17 @@ deploy-local: e2e.namespace: @printf "e2e-tests-$(shell date +%s)-$$RANDOM" > e2e.namespace -# useful if running e2e directly with `go test -tags=bare` -setup-bare: clean e2e.namespace - . ./scripts/build_bare.sh - . ./scripts/package_release.sh 1.0.0 test/e2e/resources test/e2e/e2e-bare-values.yaml - . ./scripts/install_bare.sh $(shell cat ./e2e.namespace) test/e2e/resources - -E2E_NODES ?= 1 -E2E_FLAKE_ATTEMPTS ?= 1 +.PHONY: e2e E2E_TIMEOUT ?= 90m -# Optionally run an individual chunk of e2e test specs. -# Do not use this from the CLI; this is intended to be used by CI only. -E2E_TEST_CHUNK ?= all -E2E_TEST_NUM_CHUNKS ?= 4 -ifneq (all,$(E2E_TEST_CHUNK)) -TEST := $(shell go run ./test/e2e/split/... -chunks $(E2E_TEST_NUM_CHUNKS) -print-chunk $(E2E_TEST_CHUNK) ./test/e2e) -endif -E2E_OPTS ?= $(if $(E2E_SEED),-seed '$(E2E_SEED)') $(if $(SKIP), -skip '$(SKIP)') $(if $(TEST),-focus '$(TEST)') $(if $(ARTIFACT_DIR), -output-dir $(ARTIFACT_DIR) -junit-report junit_e2e.xml) -flake-attempts $(E2E_FLAKE_ATTEMPTS) -nodes $(E2E_NODES) -timeout $(E2E_TIMEOUT) -v -randomize-suites -race -trace -progress +E2E_TEST_NS ?= operators E2E_INSTALL_NS ?= operator-lifecycle-manager E2E_CATALOG_NS ?= $(E2E_INSTALL_NS) -E2E_TEST_NS ?= operators - +GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events e2e: - $(GINKGO) $(E2E_OPTS) $(or $(run), ./test/e2e) $< -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) -dummyImage=bitnami/nginx:latest $(or $(extra_args), -kubeconfig=${KUBECONFIG}) + $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) $(E2E_OPTS) + +.PHONY: e2e-local +e2e-local: e2e-build kind-create deploy e2e # See workflows/e2e-tests.yml See test/e2e/README.md for details. .PHONY: e2e-local @@ -161,15 +170,28 @@ e2e-local: e2e test/e2e/assets/chart/zz_chart.go: $(shell find deploy/chart -type f) $(BINDATA) -o $@ -pkg chart -prefix deploy/chart/ $^ -# execute kind and helm end to end tests -bin/e2e-local.test: FORCE test/e2e/assets/chart/zz_chart.go - $(GO) test -c -tags kind,helm -o $@ ./test/e2e - -# set go env and other vars, ensure that the dockerfile exists, and then build wait, cpb, and other command binaries and finally the kind image archive -test/e2e-local.image.tar: export GOOS=linux -test/e2e-local.image.tar: export GOARCH=386 -test/e2e-local.image.tar: build_cmd=build -test/e2e-local.image.tar: e2e.Dockerfile bin/wait bin/cpb $(CMDS) +.PHONY: deploy +OLM_IMAGE := quay.io/operator-framework/olm:local +deploy: + $(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME); \ + $(HELM) upgrade --install olm deploy/chart \ + --set debug=true \ + --set olm.image.ref=$(OLM_IMAGE) \ + --set olm.image.pullPolicy=IfNotPresent \ + --set catalog.image.ref=$(OLM_IMAGE) \ + --set catalog.image.pullPolicy=IfNotPresent \ + --set catalog.commandArgs=--configmapServerImage=$(CONFIGMAP_SERVER_IMAGE) \ + --set catalog.opmImageArgs=--opmImage=$(OPERATOR_REGISTRY_IMAGE) \ + --set package.image.ref=$(OLM_IMAGE) \ + --set package.image.pullPolicy=IfNotPresent \ + $(HELM_INSTALL_OPTS) \ + --wait; + +.PHONY: e2e-build +e2e-build: BUILD_TAGS="json1 e2e experimental_metrics" +e2e-build: export GOOS=linux +e2e-build: build_cmd=build +e2e-build: e2e.Dockerfile bin/wait bin/cpb $(CMDS) docker build -t quay.io/operator-framework/olm:local -f $< bin docker save -o $@ quay.io/operator-framework/olm:local @@ -230,15 +252,21 @@ verify-manifests: manifests verify: verify-codegen verify-mockgen verify-manifests +.PHONY: pull-opm +pull-opm: + docker pull $(OPERATOR_REGISTRY_IMAGE) + # before running release, bump the version in OLM_VERSION and push to master, # then tag those builds in quay with the version in OLM_VERSION release: ver=v$(shell cat OLM_VERSION) -release: manifests +# pull the opm image to get the digest +release: pull-opm manifests @echo "Generating the $(ver) release" docker pull $(IMAGE_REPO):$(ver) $(MAKE) target=upstream ver=$(ver) quickstart=true package package: olmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(ver)) +package: opmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE)) package: ifndef target $(error target is undefined) @@ -246,9 +274,12 @@ endif ifndef ver $(error ver is undefined) endif + @echo "Getting operator registry image" + docker pull $(OPERATOR_REGISTRY_IMAGE) $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml olm.image.ref $(olmref) $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml catalog.image.ref $(olmref) $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml package.image.ref $(olmref) + $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml -- catalog.opmImageArgs "--opmImage=$(opmref)" ./scripts/package_release.sh $(ver) deploy/$(target)/manifests/$(ver) deploy/$(target)/values.yaml ln -sfFn ./$(ver) deploy/$(target)/manifests/latest ifeq ($(quickstart), true) diff --git a/staging/operator-lifecycle-manager/deploy/chart/values.yaml b/staging/operator-lifecycle-manager/deploy/chart/values.yaml index 5870f3230a..ffb5891842 100644 --- a/staging/operator-lifecycle-manager/deploy/chart/values.yaml +++ b/staging/operator-lifecycle-manager/deploy/chart/values.yaml @@ -40,6 +40,7 @@ catalog: setWorkloadUserID: true replicaCount: 1 commandArgs: --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest + opmImageArgs: --opmImage=quay.io/operator-framework/opm:latest image: ref: quay.io/operator-framework/olm:master pullPolicy: Always diff --git a/staging/operator-lifecycle-manager/test/e2e/magic_catalog.go b/staging/operator-lifecycle-manager/test/e2e/magic_catalog.go index 06b5f282ba..2b89a4b3df 100644 --- a/staging/operator-lifecycle-manager/test/e2e/magic_catalog.go +++ b/staging/operator-lifecycle-manager/test/e2e/magic_catalog.go @@ -3,6 +3,7 @@ package e2e import ( "context" "fmt" + "os" operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" corev1 "k8s.io/api/core/v1" @@ -257,12 +258,16 @@ func (c *MagicCatalog) makeCatalogSource() *operatorsv1alpha1.CatalogSource { func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod { const ( - image = "quay.io/operator-framework/opm" readinessDelay int32 = 5 livenessDelay int32 = 10 volumeMountName string = "fbc-catalog" ) + var image = "quay.io/operator-framework/opm" + if os.Getenv("OPERATOR_REGISTRY_TAG") != "" { + image = fmt.Sprintf("quay.io/operator-framework/opm:%s", os.Getenv("OPERATOR_REGISTRY_TAG")) + } + return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: c.podName, From 7287fac0dc2061f393bbd4cdce457e3b9a5e0961 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Tue, 28 May 2024 14:26:06 +0200 Subject: [PATCH 4/9] :seedling: cleanup/tools (#3285) * move orthogonal tools to bingo Signed-off-by: Per Goncalves da Silva * update vendor Signed-off-by: Per Goncalves da Silva * remove no longer needed Dockerfile.goreleaser Signed-off-by: Per Goncalves da Silva --------- Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Upstream-repository: operator-lifecycle-manager Upstream-commit: 556637d4144fb782e93c207f55975b743ec2d419 Signed-off-by: Per Goncalves da Silva --- go.mod | 12 +- go.sum | 41 +- .../.bingo/.gitignore | 13 + .../.bingo/README.md | 14 + .../.bingo/Variables.mk | 55 + .../.bingo/bingo.mod | 7 + .../.bingo/bingo.sum | 29 + .../operator-lifecycle-manager/.bingo/go.mod | 1 + .../.bingo/golangci-lint.mod | 7 + .../.bingo/golangci-lint.sum | 910 +++++++ .../.bingo/helm.mod | 7 + .../.bingo/helm.sum | 484 ++++ .../.bingo/kind.mod | 7 + .../.bingo/kind.sum | 36 + .../.bingo/setup-envtest.mod | 7 + .../.bingo/setup-envtest.sum | 38 + .../.bingo/variables.env | 22 + .../operator-lifecycle-manager/.bingo/yq.mod | 7 + .../operator-lifecycle-manager/.bingo/yq.sum | 171 ++ staging/operator-lifecycle-manager/Makefile | 481 ++-- staging/operator-lifecycle-manager/go.mod | 38 +- staging/operator-lifecycle-manager/go.sum | 198 +- .../scripts/package_release.sh | 4 +- .../scripts/update_mockgen.sh | 8 - staging/operator-lifecycle-manager/tools.go | 24 +- vendor/github.com/itchyny/astgen-go/Makefile | 21 - vendor/github.com/itchyny/astgen-go/README.md | 55 - vendor/github.com/itchyny/astgen-go/build.go | 326 --- .../github.com/itchyny/astgen-go/is_zero.go | 37 - vendor/github.com/itchyny/astgen-go/type.go | 80 - vendor/github.com/itchyny/gojq/.dockerignore | 17 +- vendor/github.com/itchyny/gojq/.gitattributes | 3 + vendor/github.com/itchyny/gojq/.gitignore | 7 +- vendor/github.com/itchyny/gojq/CHANGELOG.md | 197 +- vendor/github.com/itchyny/gojq/Dockerfile | 10 +- vendor/github.com/itchyny/gojq/LICENSE | 2 +- vendor/github.com/itchyny/gojq/Makefile | 93 +- vendor/github.com/itchyny/gojq/README.md | 84 +- vendor/github.com/itchyny/gojq/_gojq | 56 +- vendor/github.com/itchyny/gojq/builtin.go | 139 +- vendor/github.com/itchyny/gojq/builtin.jq | 231 +- vendor/github.com/itchyny/gojq/code.go | 20 +- vendor/github.com/itchyny/gojq/compare.go | 94 +- vendor/github.com/itchyny/gojq/compiler.go | 1234 ++++++---- vendor/github.com/itchyny/gojq/debug.go | 112 +- vendor/github.com/itchyny/gojq/encoder.go | 193 ++ vendor/github.com/itchyny/gojq/env.go | 20 +- vendor/github.com/itchyny/gojq/error.go | 319 +-- vendor/github.com/itchyny/gojq/execute.go | 326 ++- vendor/github.com/itchyny/gojq/func.go | 2170 ++++++++++------- vendor/github.com/itchyny/gojq/go.dev.mod | 8 + vendor/github.com/itchyny/gojq/go.dev.sum | 4 + vendor/github.com/itchyny/gojq/gojq.go | 6 +- vendor/github.com/itchyny/gojq/iter.go | 46 +- vendor/github.com/itchyny/gojq/lexer.go | 313 ++- vendor/github.com/itchyny/gojq/math.go | 10 - .../github.com/itchyny/gojq/module_loader.go | 140 +- vendor/github.com/itchyny/gojq/normalize.go | 129 +- vendor/github.com/itchyny/gojq/operator.go | 316 ++- vendor/github.com/itchyny/gojq/option.go | 67 +- vendor/github.com/itchyny/gojq/parser.go | 1202 ++++----- vendor/github.com/itchyny/gojq/parser.go.y | 172 +- vendor/github.com/itchyny/gojq/prepend.go | 43 - vendor/github.com/itchyny/gojq/preview.go | 77 + vendor/github.com/itchyny/gojq/query.go | 637 +++-- vendor/github.com/itchyny/gojq/release.go | 7 +- vendor/github.com/itchyny/gojq/scope_stack.go | 52 + vendor/github.com/itchyny/gojq/stack.go | 24 +- vendor/github.com/itchyny/gojq/term_type.go | 7 +- vendor/github.com/itchyny/gojq/tools.go | 5 - vendor/github.com/itchyny/gojq/type.go | 29 + .../itchyny/timefmt-go/CHANGELOG.md | 21 + .../itchyny/{astgen-go => timefmt-go}/LICENSE | 2 +- vendor/github.com/itchyny/timefmt-go/Makefile | 20 + .../github.com/itchyny/timefmt-go/README.md | 69 + .../github.com/itchyny/timefmt-go/format.go | 537 ++++ vendor/github.com/itchyny/timefmt-go/parse.go | 408 ++++ .../github.com/itchyny/timefmt-go/timefmt.go | 2 + .../lestrrat-go/strftime/.gitignore | 24 - .../lestrrat-go/strftime/.travis.yml | 5 - .../github.com/lestrrat-go/strftime/LICENSE | 21 - .../github.com/lestrrat-go/strftime/Makefile | 4 - .../github.com/lestrrat-go/strftime/README.md | 202 -- .../lestrrat-go/strftime/appenders.go | 293 --- .../lestrrat-go/strftime/extension.go | 31 - .../lestrrat-go/strftime/options.go | 51 - .../lestrrat-go/strftime/specifications.go | 143 -- .../lestrrat-go/strftime/strftime.go | 213 -- .../github.com/mattn/go-isatty/isatty_bsd.go | 3 +- .../mattn/go-isatty/isatty_others.go | 5 +- .../mattn/go-isatty/isatty_tcgets.go | 3 +- .../mitchellh/hashstructure/README.md | 8 +- .../mitchellh/hashstructure/hashstructure.go | 82 +- .../mitchellh/hashstructure/include.go | 7 + vendor/github.com/pbnjay/strptime/README.md | 26 - vendor/github.com/pbnjay/strptime/strptime.go | 202 -- vendor/github.com/rivo/uniseg/README.md | 30 +- .../github.com/rivo/uniseg/eastasianwidth.go | 78 +- .../rivo/uniseg/emojipresentation.go | 18 +- .../github.com/rivo/uniseg/gen_breaktest.go | 10 +- .../github.com/rivo/uniseg/gen_properties.go | 13 +- vendor/github.com/rivo/uniseg/grapheme.go | 31 +- .../rivo/uniseg/graphemeproperties.go | 58 +- .../github.com/rivo/uniseg/graphemerules.go | 176 +- vendor/github.com/rivo/uniseg/line.go | 10 +- .../github.com/rivo/uniseg/lineproperties.go | 109 +- vendor/github.com/rivo/uniseg/linerules.go | 522 ++-- vendor/github.com/rivo/uniseg/properties.go | 48 +- .../rivo/uniseg/sentenceproperties.go | 54 +- .../github.com/rivo/uniseg/sentencerules.go | 265 +- vendor/github.com/rivo/uniseg/step.go | 24 +- vendor/github.com/rivo/uniseg/width.go | 9 +- .../github.com/rivo/uniseg/wordproperties.go | 71 +- vendor/github.com/rivo/uniseg/wordrules.go | 160 +- vendor/modules.txt | 24 +- 115 files changed, 9584 insertions(+), 6269 deletions(-) create mode 100644 staging/operator-lifecycle-manager/.bingo/.gitignore create mode 100644 staging/operator-lifecycle-manager/.bingo/README.md create mode 100644 staging/operator-lifecycle-manager/.bingo/Variables.mk create mode 100644 staging/operator-lifecycle-manager/.bingo/bingo.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/bingo.sum create mode 100644 staging/operator-lifecycle-manager/.bingo/go.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/golangci-lint.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/golangci-lint.sum create mode 100644 staging/operator-lifecycle-manager/.bingo/helm.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/helm.sum create mode 100644 staging/operator-lifecycle-manager/.bingo/kind.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/kind.sum create mode 100644 staging/operator-lifecycle-manager/.bingo/setup-envtest.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/setup-envtest.sum create mode 100644 staging/operator-lifecycle-manager/.bingo/variables.env create mode 100644 staging/operator-lifecycle-manager/.bingo/yq.mod create mode 100644 staging/operator-lifecycle-manager/.bingo/yq.sum delete mode 100755 staging/operator-lifecycle-manager/scripts/update_mockgen.sh delete mode 100644 vendor/github.com/itchyny/astgen-go/Makefile delete mode 100644 vendor/github.com/itchyny/astgen-go/README.md delete mode 100644 vendor/github.com/itchyny/astgen-go/build.go delete mode 100644 vendor/github.com/itchyny/astgen-go/is_zero.go delete mode 100644 vendor/github.com/itchyny/astgen-go/type.go create mode 100644 vendor/github.com/itchyny/gojq/.gitattributes create mode 100644 vendor/github.com/itchyny/gojq/encoder.go create mode 100644 vendor/github.com/itchyny/gojq/go.dev.mod create mode 100644 vendor/github.com/itchyny/gojq/go.dev.sum delete mode 100644 vendor/github.com/itchyny/gojq/math.go delete mode 100644 vendor/github.com/itchyny/gojq/prepend.go create mode 100644 vendor/github.com/itchyny/gojq/preview.go create mode 100644 vendor/github.com/itchyny/gojq/scope_stack.go delete mode 100644 vendor/github.com/itchyny/gojq/tools.go create mode 100644 vendor/github.com/itchyny/gojq/type.go create mode 100644 vendor/github.com/itchyny/timefmt-go/CHANGELOG.md rename vendor/github.com/itchyny/{astgen-go => timefmt-go}/LICENSE (97%) create mode 100644 vendor/github.com/itchyny/timefmt-go/Makefile create mode 100644 vendor/github.com/itchyny/timefmt-go/README.md create mode 100644 vendor/github.com/itchyny/timefmt-go/format.go create mode 100644 vendor/github.com/itchyny/timefmt-go/parse.go create mode 100644 vendor/github.com/itchyny/timefmt-go/timefmt.go delete mode 100644 vendor/github.com/lestrrat-go/strftime/.gitignore delete mode 100644 vendor/github.com/lestrrat-go/strftime/.travis.yml delete mode 100644 vendor/github.com/lestrrat-go/strftime/LICENSE delete mode 100644 vendor/github.com/lestrrat-go/strftime/Makefile delete mode 100644 vendor/github.com/lestrrat-go/strftime/README.md delete mode 100644 vendor/github.com/lestrrat-go/strftime/appenders.go delete mode 100644 vendor/github.com/lestrrat-go/strftime/extension.go delete mode 100644 vendor/github.com/lestrrat-go/strftime/options.go delete mode 100644 vendor/github.com/lestrrat-go/strftime/specifications.go delete mode 100644 vendor/github.com/lestrrat-go/strftime/strftime.go delete mode 100644 vendor/github.com/pbnjay/strptime/README.md delete mode 100644 vendor/github.com/pbnjay/strptime/strptime.go diff --git a/go.mod b/go.mod index d48f668ec8..75e939a1b8 100644 --- a/go.mod +++ b/go.mod @@ -127,8 +127,8 @@ require ( github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 // indirect - github.com/itchyny/gojq v0.11.0 // indirect + github.com/itchyny/gojq v0.12.15 // indirect + github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jmoiron/sqlx v1.3.5 // indirect github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d // indirect @@ -140,17 +140,16 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect - github.com/lestrrat-go/strftime v1.0.1 // indirect github.com/lib/pq v1.10.9 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/mitchellh/hashstructure v1.0.0 // indirect + github.com/mitchellh/hashstructure v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/locker v1.0.1 // indirect @@ -170,7 +169,6 @@ require ( github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/openshift/client-go v0.0.0-20220525160904-9e1acff93e4a // indirect github.com/otiai10/copy v1.14.0 // indirect - github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -178,7 +176,7 @@ require ( github.com/prometheus/client_model v0.6.0 // indirect github.com/prometheus/common v0.47.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rubenv/sql-migrate v1.5.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect diff --git a/go.sum b/go.sum index c52148bb3f..7e5d45410a 100644 --- a/go.sum +++ b/go.sum @@ -178,8 +178,6 @@ github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1 github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= -github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -392,7 +390,6 @@ github.com/hashicorp/golang-lru/arc/v2 v2.0.5/go.mod h1:ny6zBSQZi2JxIeYcv7kt2sH2 github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4= github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= @@ -405,15 +402,12 @@ github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+h github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 h1:3gyXljUyTWWTv/NMFPvwgxJSdE9Mamg2r3x8HMBl+Uo= -github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645/go.mod h1:296z3W7Xsrp2mlIY88ruDKscuvrkL6zXCNRtaYVshzw= -github.com/itchyny/go-flags v1.5.0/go.mod h1:lenkYuCobuxLBAd/HGFE4LRoW8D3B6iXRQfWYJ+MNbA= -github.com/itchyny/gojq v0.11.0 h1:z7HnaKZ6erVzxPo3BkhJBG7jHmzKdAW8Hcse5N6YAic= -github.com/itchyny/gojq v0.11.0/go.mod h1:my6D2qN2Sm6qa+/5GsPDUZlCWGR+U8Qsa9he76sudv0= +github.com/itchyny/gojq v0.12.15 h1:WC1Nxbx4Ifw5U2oQWACYz32JK8G9qxNtHzrvW4KEcqI= +github.com/itchyny/gojq v0.12.15/go.mod h1:uWAHCbCIla1jiNxmeT5/B5mOjSdfkCq6p8vxWg+BM10= +github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE= +github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= -github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= @@ -463,10 +457,6 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtB github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= -github.com/lestrrat-go/strftime v1.0.1 h1:o7qz5pmLzPDLyGW4lG6JvTKPUfTFXwe+vOamIYWtnVU= -github.com/lestrrat-go/strftime v1.0.1/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -486,7 +476,6 @@ github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2 github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -495,9 +484,8 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= @@ -518,8 +506,8 @@ github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HK github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= +github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -583,8 +571,6 @@ github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= -github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 h1:4lfz0keanz7/gAlvJ7lAe9zmE08HXxifBZJC0AdeGKo= -github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9/go.mod h1:6Hr+C/olSdkdL3z68MlyXWzwhvwmwN7KuUFXGb3PoOk= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -630,8 +616,8 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnA github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY= github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= @@ -686,7 +672,6 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -697,8 +682,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tebeka/strftime v0.1.3 h1:5HQXOqWKYRFfNyBMNVc9z5+QzuBtIXy03psIhtdJYto= -github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= @@ -892,11 +875,9 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -915,6 +896,7 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= @@ -1051,7 +1033,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/staging/operator-lifecycle-manager/.bingo/.gitignore b/staging/operator-lifecycle-manager/.bingo/.gitignore new file mode 100644 index 0000000000..9efccf683c --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/.gitignore @@ -0,0 +1,13 @@ + +# Ignore everything +* + +# But not these files: +!.gitignore +!*.mod +!*.sum +!README.md +!Variables.mk +!variables.env + +*tmp.mod diff --git a/staging/operator-lifecycle-manager/.bingo/README.md b/staging/operator-lifecycle-manager/.bingo/README.md new file mode 100644 index 0000000000..7a5c2d4f6d --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/README.md @@ -0,0 +1,14 @@ +# Project Development Dependencies. + +This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo. + +* Run `bingo get` to install all tools having each own module file in this directory. +* Run `bingo get ` to install that have own module file in this directory. +* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $() variable where is the .bingo/.mod. +* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool. +* For go: Import `.bingo/variables.go` to for variable names. +* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies. + +## Requirements + +* Go 1.14+ diff --git a/staging/operator-lifecycle-manager/.bingo/Variables.mk b/staging/operator-lifecycle-manager/.bingo/Variables.mk new file mode 100644 index 0000000000..bf290d0395 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/Variables.mk @@ -0,0 +1,55 @@ +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT. +# All tools are designed to be build inside $GOBIN. +BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +GOPATH ?= $(shell go env GOPATH) +GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin +GO ?= $(shell which go) + +# Below generated variables ensure that every time a tool under each variable is invoked, the correct version +# will be used; reinstalling only if needed. +# For example for bingo variable: +# +# In your main Makefile (for non array binaries): +# +#include .bingo/Variables.mk # Assuming -dir was set to .bingo . +# +#command: $(BINGO) +# @echo "Running bingo" +# @$(BINGO) +# +BINGO := $(GOBIN)/bingo-v0.9.0 +$(BINGO): $(BINGO_DIR)/bingo.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/bingo-v0.9.0" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.9.0 "github.com/bwplotka/bingo" + +GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.59.0 +$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/golangci-lint-v1.59.0" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.59.0 "github.com/golangci/golangci-lint/cmd/golangci-lint" + +HELM := $(GOBIN)/helm-v3.15.1 +$(HELM): $(BINGO_DIR)/helm.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/helm-v3.15.1" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.15.1 "helm.sh/helm/v3/cmd/helm" + +KIND := $(GOBIN)/kind-v0.23.0 +$(KIND): $(BINGO_DIR)/kind.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/kind-v0.23.0" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.23.0 "sigs.k8s.io/kind" + +SETUP_ENVTEST := $(GOBIN)/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60 +$(SETUP_ENVTEST): $(BINGO_DIR)/setup-envtest.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=setup-envtest.mod -o=$(GOBIN)/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60 "sigs.k8s.io/controller-runtime/tools/setup-envtest" + +YQ := $(GOBIN)/yq-v3.0.0-20201202084205-8846255d1c37 +$(YQ): $(BINGO_DIR)/yq.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/yq-v3.0.0-20201202084205-8846255d1c37" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=yq.mod -o=$(GOBIN)/yq-v3.0.0-20201202084205-8846255d1c37 "github.com/mikefarah/yq/v3" + diff --git a/staging/operator-lifecycle-manager/.bingo/bingo.mod b/staging/operator-lifecycle-manager/.bingo/bingo.mod new file mode 100644 index 0000000000..10786c05e5 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/bingo.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.0 + +toolchain go1.22.3 + +require github.com/bwplotka/bingo v0.9.0 diff --git a/staging/operator-lifecycle-manager/.bingo/bingo.sum b/staging/operator-lifecycle-manager/.bingo/bingo.sum new file mode 100644 index 0000000000..f231dd11b3 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/bingo.sum @@ -0,0 +1,29 @@ +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/bwplotka/bingo v0.9.0 h1:slnsdJYExR4iRalHR6/ZiYnr9vSazOuFGmc2LdX293g= +github.com/bwplotka/bingo v0.9.0/go.mod h1:GxC/y/xbmOK5P29cn+B3HuOSw0s2gruddT3r+rDizDw= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/efficientgo/core v1.0.0-rc.0 h1:jJoA0N+C4/knWYVZ6GrdHOtDyrg8Y/TR4vFpTaqTsqs= +github.com/efficientgo/core v1.0.0-rc.0/go.mod h1:kQa0V74HNYMfuJH6jiPiwNdpWXl4xd/K4tzlrcvYDQI= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg= +mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8= diff --git a/staging/operator-lifecycle-manager/.bingo/go.mod b/staging/operator-lifecycle-manager/.bingo/go.mod new file mode 100644 index 0000000000..610249af0b --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/go.mod @@ -0,0 +1 @@ +module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. \ No newline at end of file diff --git a/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod b/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod new file mode 100644 index 0000000000..0ea0215a3f --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.0 + +toolchain go1.22.3 + +require github.com/golangci/golangci-lint v1.59.0 // cmd/golangci-lint diff --git a/staging/operator-lifecycle-manager/.bingo/golangci-lint.sum b/staging/operator-lifecycle-manager/.bingo/golangci-lint.sum new file mode 100644 index 0000000000..b3d932f076 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/golangci-lint.sum @@ -0,0 +1,910 @@ +4d63.com/gocheckcompilerdirectives v1.2.1 h1:AHcMYuw56NPjq/2y615IGg2kYkBdTvOaojYCBcRE7MA= +4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= +4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= +4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= +github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= +github.com/Abirdcfly/dupword v0.0.14 h1:3U4ulkc8EUo+CaT105/GJ1BQwtgyj6+VaBVbAX11Ba8= +github.com/Abirdcfly/dupword v0.0.14/go.mod h1:VKDAbxdY8YbKUByLGg8EETzYSuC4crm9WwI6Y3S0cLI= +github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= +github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= +github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= +github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= +github.com/Antonboom/testifylint v1.3.0 h1:UiqrddKs1W3YK8R0TUuWwrVKlVAnS07DTUVWWs9c+y4= +github.com/Antonboom/testifylint v1.3.0/go.mod h1:NV0hTlteCkViPW9mSR4wEMfwp+Hs1T3dY60bkvSfhpM= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Crocmagnon/fatcontext v0.2.2 h1:OrFlsDdOj9hW/oBEJBNSuH7QWf+E9WPVHw+x52bXVbk= +github.com/Crocmagnon/fatcontext v0.2.2/go.mod h1:WSn/c/+MMNiD8Pri0ahRj0o9jVpeowzavOQplBJw6u0= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0/go.mod h1:Nl76DrGNJTA1KJ0LePKBw/vznBX1EHbAZX8mwjR82nI= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= +github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= +github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexkohler/nakedret/v2 v2.0.4 h1:yZuKmjqGi0pSmjGpOC016LtPJysIL0WEUiaXW5SUnNg= +github.com/alexkohler/nakedret/v2 v2.0.4/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= +github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= +github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= +github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= +github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= +github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= +github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= +github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= +github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= +github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM= +github.com/bombsimon/wsl/v4 v4.2.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= +github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= +github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= +github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= +github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= +github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= +github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= +github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= +github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= +github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= +github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= +github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= +github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= +github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI= +github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= +github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= +github.com/daixiang0/gci v0.13.4 h1:61UGkmpoAcxHM2hhNkZEf5SzwQtWJXTSws7jaPyqwlw= +github.com/daixiang0/gci v0.13.4/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= +github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= +github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= +github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= +github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= +github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU= +github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= +github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= +github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= +github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= +github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= +github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= +github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= +github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= +github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= +github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= +github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= +github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= +github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= +github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= +github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= +github.com/golangci/golangci-lint v1.59.0 h1:st69YDnAH/v2QXDcgUaZ0seQajHScPALBVkyitYLXEk= +github.com/golangci/golangci-lint v1.59.0/go.mod h1:QNA32UWdUdHXnu+Ap5/ZU4WVwyp2tL94UxEXrSErjg0= +github.com/golangci/misspell v0.5.1 h1:/SjR1clj5uDjNLwYzCahHwIOPmQgoH04AyQIiWGbhCM= +github.com/golangci/misspell v0.5.1/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= +github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= +github.com/golangci/modinfo v0.3.4/go.mod h1:wytF1M5xl9u0ij8YSvhkEVPP3M5Mc7XLl1pxH3B2aUM= +github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= +github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= +github.com/golangci/revgrep v0.5.3 h1:3tL7c1XBMtWHHqVpS5ChmiAAoe4PF/d5+ULzV9sLAzs= +github.com/golangci/revgrep v0.5.3/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= +github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= +github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= +github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= +github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= +github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= +github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= +github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= +github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= +github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jjti/go-spancheck v0.6.1 h1:ZK/wE5Kyi1VX3PJpUO2oEgeoI4FWOUm7Shb2Gbv5obI= +github.com/jjti/go-spancheck v0.6.1/go.mod h1:vF1QkOO159prdo6mHRxak2CpzDpHAfKiPUDP/NeRnX8= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= +github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= +github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= +github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= +github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= +github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= +github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= +github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= +github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= +github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= +github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= +github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0= +github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= +github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= +github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= +github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= +github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= +github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= +github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= +github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= +github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= +github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= +github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= +github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= +github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= +github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= +github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= +github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= +github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= +github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= +github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= +github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= +github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk= +github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/polyfloyd/go-errorlint v1.5.1 h1:5gHxDjLyyWij7fhfrjYNNlHsUNQeyx0LFQKUelO3RBo= +github.com/polyfloyd/go-errorlint v1.5.1/go.mod h1:sH1QC1pxxi0fFecsVIzBmxtrgd9IF/SkJpA6wqyKAJs= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= +github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= +github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= +github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= +github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryancurrah/gomodguard v1.3.2 h1:CuG27ulzEB1Gu5Dk5gP8PFxSOZ3ptSdP5iI/3IXxM18= +github.com/ryancurrah/gomodguard v1.3.2/go.mod h1:LqdemiFomEjcxOqirbQCb3JFvSxH2JUYMerTFd3sF2o= +github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= +github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= +github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= +github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= +github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= +github.com/sashamelentyev/usestdlibvars v1.25.0 h1:IK8SI2QyFzy/2OD2PYnhy84dpfNo9qADrRt6LH8vSzU= +github.com/sashamelentyev/usestdlibvars v1.25.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 h1:rnO6Zp1YMQwv8AyxzuwsVohljJgp4L0ZqiCgtACsPsc= +github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9/go.mod h1:dg7lPlu/xK/Ut9SedURCoZbVCR4yC7fM65DtH9/CDHs= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= +github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= +github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= +github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= +github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= +github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= +github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= +github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= +github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= +github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= +github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= +github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= +github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= +github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= +github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= +github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= +github.com/tomarrell/wrapcheck/v2 v2.8.3 h1:5ov+Cbhlgi7s/a42BprYoxsr73CbdMUTzE3bRDFASUs= +github.com/tomarrell/wrapcheck/v2 v2.8.3/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= +github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= +github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= +github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= +github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/Gk8VQ= +github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= +github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= +github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= +github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= +github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= +github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= +github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= +github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= +github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= +github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= +gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= +go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= +go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= +go-simpler.org/sloglint v0.7.0 h1:rMZRxD9MbaGoRFobIOicMxZzum7AXNFDlez6xxJs5V4= +go-simpler.org/sloglint v0.7.0/go.mod h1:g9SXiSWY0JJh4LS39/Q0GxzP/QX2cVcbTOYhDpXrJEs= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +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-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= +golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +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= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= +honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= +mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= +mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= +mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1 h1:Nykk7fggxChwLK4rUPYESzeIwqsuxXXlFEAh5YhaMRo= +mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1/go.mod h1:ZzZjEpJDOmx8TdVU6umamY3Xy0UAQUI2DHbf05USVbI= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/staging/operator-lifecycle-manager/.bingo/helm.mod b/staging/operator-lifecycle-manager/.bingo/helm.mod new file mode 100644 index 0000000000..b5958009c4 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/helm.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.0 + +toolchain go1.22.3 + +require helm.sh/helm/v3 v3.15.1 // cmd/helm diff --git a/staging/operator-lifecycle-manager/.bingo/helm.sum b/staging/operator-lifecycle-manager/.bingo/helm.sum new file mode 100644 index 0000000000..50672af6be --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/helm.sum @@ -0,0 +1,484 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +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/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= +github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= +github.com/Masterminds/vcs v1.13.3 h1:IIA2aBdXvfbIM+yl/eTnL4hb1XwdpvuQLglAix1gweE= +github.com/Masterminds/vcs v1.13.3/go.mod h1:TiE7xuEjl1N4j016moRd6vezp6e6Lz23gypeXfzXeW8= +github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= +github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= +github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= +github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= +github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= +github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= +github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= +github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= +github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= +github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs= +github.com/go-gorp/gorp/v3 v3.1.0/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= +github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= +github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +helm.sh/helm/v3 v3.15.1 h1:22ztacHz4gMqhXNqCQ9NAg6BFWoRUryNLvnkz6OVyw0= +helm.sh/helm/v3 v3.15.1/go.mod h1:fvfoRcB8UKRUV5jrIfOTaN/pG1TPhuqSb56fjYdTKXg= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= +k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= +k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= +k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= +k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= +k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/apiserver v0.30.0 h1:QCec+U72tMQ+9tR6A0sMBB5Vh6ImCEkoKkTDRABWq6M= +k8s.io/apiserver v0.30.0/go.mod h1:smOIBq8t0MbKZi7O7SyIpjPsiKJ8qa+llcFCluKyqiY= +k8s.io/cli-runtime v0.30.0 h1:0vn6/XhOvn1RJ2KJOC6IRR2CGqrpT6QQF4+8pYpWQ48= +k8s.io/cli-runtime v0.30.0/go.mod h1:vATpDMATVTMA79sZ0YUCzlMelf6rUjoBzlp+RnoM+cg= +k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ= +k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY= +k8s.io/component-base v0.30.0 h1:cj6bp38g0ainlfYtaOQuRELh5KSYjhKxM+io7AUIk4o= +k8s.io/component-base v0.30.0/go.mod h1:V9x/0ePFNaKeKYA3bOvIbrNoluTSG+fSJKjLdjOoeXQ= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kubectl v0.30.0 h1:xbPvzagbJ6RNYVMVuiHArC1grrV5vSmmIcSZuCdzRyk= +k8s.io/kubectl v0.30.0/go.mod h1:zgolRw2MQXLPwmic2l/+iHs239L49fhSeICuMhQQXTI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY= +oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/staging/operator-lifecycle-manager/.bingo/kind.mod b/staging/operator-lifecycle-manager/.bingo/kind.mod new file mode 100644 index 0000000000..2027645f30 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/kind.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.0 + +toolchain go1.22.3 + +require sigs.k8s.io/kind v0.23.0 diff --git a/staging/operator-lifecycle-manager/.bingo/kind.sum b/staging/operator-lifecycle-manager/.bingo/kind.sum new file mode 100644 index 0000000000..e38d89f615 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/kind.sum @@ -0,0 +1,36 @@ +github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= +github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= +github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= +github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= +github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +sigs.k8s.io/kind v0.23.0 h1:8fyDGWbWTeCcCTwA04v4Nfr45KKxbSPH1WO9K+jVrBg= +sigs.k8s.io/kind v0.23.0/go.mod h1:ZQ1iZuJLh3T+O8fzhdi3VWcFTzsdXtNv2ppsHc8JQ7s= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod b/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod new file mode 100644 index 0000000000..1ed2ee39ee --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.0 + +toolchain go1.22.3 + +require sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60 diff --git a/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum b/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum new file mode 100644 index 0000000000..bdb4c4df53 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum @@ -0,0 +1,38 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60 h1:ihaeBTCFuEYPL1T1/FqAavDY7z5UcKSnWpnb+I3DYeM= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60/go.mod h1:4+4tM2Es0ycqPedATtzPer5RTrUq3Xab59BYogt0mCE= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/staging/operator-lifecycle-manager/.bingo/variables.env b/staging/operator-lifecycle-manager/.bingo/variables.env new file mode 100644 index 0000000000..36fd50bd90 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/variables.env @@ -0,0 +1,22 @@ +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT. +# All tools are designed to be build inside $GOBIN. +# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. +GOBIN=${GOBIN:=$(go env GOBIN)} + +if [ -z "$GOBIN" ]; then + GOBIN="$(go env GOPATH)/bin" +fi + + +BINGO="${GOBIN}/bingo-v0.9.0" + +GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.59.0" + +HELM="${GOBIN}/helm-v3.15.1" + +KIND="${GOBIN}/kind-v0.23.0" + +SETUP_ENVTEST="${GOBIN}/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60" + +YQ="${GOBIN}/yq-v3.0.0-20201202084205-8846255d1c37" + diff --git a/staging/operator-lifecycle-manager/.bingo/yq.mod b/staging/operator-lifecycle-manager/.bingo/yq.mod new file mode 100644 index 0000000000..0da16a1ed1 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/yq.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.0 + +toolchain go1.22.3 + +require github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 diff --git a/staging/operator-lifecycle-manager/.bingo/yq.sum b/staging/operator-lifecycle-manager/.bingo/yq.sum new file mode 100644 index 0000000000..f952950436 --- /dev/null +++ b/staging/operator-lifecycle-manager/.bingo/yq.sum @@ -0,0 +1,171 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/goccy/go-yaml v1.8.1 h1:JuZRFlqLM5cWF6A+waL8AKVuCcqvKOuhJtUQI+L3ez0= +github.com/goccy/go-yaml v1.8.1/go.mod h1:wS4gNoLalDSJxo/SpngzPQ2BN4uuZVLCmbM4S3vd4+Y= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 h1:lPmsut5Sk7eK2BmDXuvNEvMbT7MkAJBu64Yxr7iJ6nk= +github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37/go.mod h1:dYWq+UWoFCDY1TndvFUQuhBbIYmZpjreC8adEAx93zE= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW8s2qTSe3wGBtvo0MbVQG/c5k8RE= +gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/staging/operator-lifecycle-manager/Makefile b/staging/operator-lifecycle-manager/Makefile index 9419126273..a29b2b6acd 100644 --- a/staging/operator-lifecycle-manager/Makefile +++ b/staging/operator-lifecycle-manager/Makefile @@ -1,6 +1,11 @@ -########################## -# OLM - Build and Test # -########################## +##################################################### +# Operator-Framework - Operator Lifecycle Manager # +##################################################### + +# Setting SHELL to bash allows bash commands to be executed by recipes. +# Options are set to exit when a recipe line exits non-zero or a piped command fails. +SHELL := /usr/bin/env bash -o pipefail +.SHELLFLAGS := -ec # Undefine GOFLAGS environment variable. ifdef GOFLAGS @@ -8,171 +13,206 @@ $(warning Undefining GOFLAGS set in CI) undefine GOFLAGS endif -SHELL := /bin/bash -ORG := github.com/operator-framework -PKG := $(ORG)/operator-lifecycle-manager -MOD_FLAGS := -mod=vendor -buildvcs=false -BUILD_TAGS := "json1" -CMDS := $(shell go list $(MOD_FLAGS) ./cmd/...) -TCMDS := $(shell go list $(MOD_FLAGS) ./test/e2e/...) -MOCKGEN := ./scripts/update_mockgen.sh -CODEGEN := ./scripts/update_codegen.sh -IMAGE_REPO := quay.io/operator-framework/olm +# Tools # + +# The tools required to build and test the project come from three sources: +# 1. .bingo/Variables.mk: tools that are orthogonal to OLM, e.g. +# - golangci-lint +# - helm +# - kind +# - setup-envtest +# - yq +# 2. go.mod/tools.go: imports testing libraries, modules that need to be vendored and/or have a low tolerance for skew with the main module +# or because they are already imported by the main module but we want to pull down the whole dependency +# to run some cmd or script, or get some resource (e.g. CRD yaml files). +# - OLM API CRDs +# - Code generation tools, e.g. k8s.io/code-generator + +# bingo manages the type 1 tools. If +# a) we don't want their dependencies affecting ours, and +# b) the tool's version doesn't need to track closely with OLM +# the tool goes here +include .bingo/Variables.mk + +# go.mod/tools.go manages type 2 tools. If +# a) we use the library for development, e.g testing, assertion, etc. +# b) we need some resource (e.g. yaml file) +# c) need to run a script that is in the library +# c) need to track tools closely with OLM (e.g. have the same k8s library version) +# the tools belongs in go.mod. If your normal imports don't pull down everything you need into vendor +# then add the import to tools.go +# Note: The code generation tools are either being used in go:generate directives or +# they are setup in a different script, e.g. ./scripts/update_codegen.sh +TOOL_EXEC := go run -mod=vendor +GINKGO := $(TOOL_EXEC) github.com/onsi/ginkgo/v2/ginkgo + +# Target environment and Dependencies # + +# Minor Kubernetes version to build against derived from the client-go dependency version +KUBE_MINOR ?= $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1/') + +# operator registry version to build against +OPERATOR_REGISTRY_VERSION ?= $(shell go list -m github.com/operator-framework/operator-registry | cut -d" " -f2 | sed 's/^v//') + +# Pin operator registry images to the same version as the operator registry +export OPERATOR_REGISTRY_TAG ?= v$(OPERATOR_REGISTRY_VERSION) +export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm:$(OPERATOR_REGISTRY_TAG) +export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry:$(OPERATOR_REGISTRY_TAG) + +# Artifact settings # + +PKG := github.com/operator-framework/operator-lifecycle-manager +IMAGE_REPO ?= quay.io/operator-framework/olm IMAGE_TAG ?= "dev" -SPECIFIC_UNIT_TEST := $(if $(TEST),-run $(TEST),) -LOCAL_NAMESPACE := "olm" -export GO111MODULE=on -YQ_INTERNAL := go run $(MOD_FLAGS) ./vendor/github.com/mikefarah/yq/v3/ -KUBEBUILDER_ASSETS := $(or $(or $(KUBEBUILDER_ASSETS),$(dir $(shell command -v kubebuilder))),/usr/local/kubebuilder/bin) -export KUBEBUILDER_ASSETS -GO := GO111MODULE=on GOFLAGS="$(MOD_FLAGS)" go -GINKGO := $(GO) run github.com/onsi/ginkgo/v2/ginkgo -BINDATA := $(GO) run github.com/go-bindata/go-bindata/v3/go-bindata -GIT_COMMIT := $(shell git rev-parse HEAD) -ifeq ($(shell arch), arm64) -ARCH := arm64 -else -ARCH := 386 -endif -# Track the minor version of kubernetes we are building against by looking at the client-go dependency version -# For example, a client-go version of v0.28.5 will map to kube version 1.28 -KUBE_MINOR ?= $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1/') +# Go build settings # + +export CGO_ENABLED ?= 0 +export GO111MODULE ?= on +export GIT_REPO := $(shell go list -m) +export GIT_COMMIT := $(shell git rev-parse HEAD) +export VERSION := $(shell cat OLM_VERSION) +export VERSION_PATH := ${GIT_REPO}/pkg/version + +# GO_BUILD flags are set with = to allow for re-evaluation of the variables +export GO_BUILD_ASMFLAGS = all=-trimpath=$(PWD) +export GO_BUILD_GCFLAGS = all=-trimpath=$(PWD) +export GO_BUILD_FLAGS = -mod=vendor -buildvcs=false +export GO_BUILD_LDFLAGS = -s -w -X '$(VERSION_PATH).version=$(VERSION)' -X '$(VERSION_PATH).gitCommit=$(GIT_COMMIT)' -extldflags "-static" +export GO_BUILD_TAGS = json1 + +# GO_TEST flags are set with = to allow for re-evaluation of the variables +# CGO_ENABLED=1 is required by the go test -race flag +GO_TEST_FLAGS = -race -count=1 $(if $(TEST),-run '$(TEST)',) +GO_TEST_ENV = CGO_ENABLED=1 + +# Test environment configuration # + +# By default setup-envtest will write to $XDG_DATA_HOME, or $HOME/.local/share if that is not defined. +# If $HOME is not set, we need to specify a binary directory to prevent an error in setup-envtest. +# Useful for some CI/CD environments that set neither $XDG_DATA_HOME nor $HOME. +SETUP_ENVTEST_BIN_DIR_OVERRIDE= +ifeq ($(shell [[ $$HOME == "" || $$HOME == "/" ]] && [[ $$XDG_DATA_HOME == "" ]] && echo true ), true) + SETUP_ENVTEST_BIN_DIR_OVERRIDE += --bin-dir /tmp/envtest-binaries +endif # Unit test against the latest available version for the minor version of kubernetes we are building against e.g. 1.30.x ENVTEST_KUBE_VERSION ?= $(KUBE_MINOR).x +KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use -p path $(KUBE_MINOR).x) # Kind node image tags are in the format x.y.z we pin to version x.y.0 because patch releases and node images # are not guaranteed to be available when a new version of the kube apis is released -KIND_NODE_VERSION ?= $(KUBE_MINOR).0 +KIND_CLUSTER_IMAGE := kindest/node:v$(KUBE_MINOR).0 KIND_CLUSTER_NAME ?= kind-olmv0 -KIND_CLUSTER_IMAGE := kindest/node:v$(KIND_NODE_VERSION) - -# Take operator registry tag from operator registry version in go.mod -export OPERATOR_REGISTRY_TAG ?= $(shell go list -m github.com/operator-framework/operator-registry | cut -d" " -f2) - -# Pin operator registry images to the OPERATOR_REGISTRY_TAG -export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm:$(OPERATOR_REGISTRY_TAG) -export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry:$(OPERATOR_REGISTRY_TAG) - -# Phony prerequisite for targets that rely on the go build cache to determine staleness. -.PHONY: build test clean vendor \ - coverage coverage-html e2e \ - kubebuilder -.PHONY: FORCE -FORCE: +# Targets # +# Disable -j flag for make +.NOTPARALLEL: -all: test build +.DEFAULT_GOAL := build -test: clean cover.out +#SECTION General -unit: kubebuilder - KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) go test $(MOD_FLAGS) $(SPECIFIC_UNIT_TEST) -tags "json1" -race -count=1 ./pkg/... ./test/e2e/split/... - -# Ensure kubectl installed before continuing -KUBEBUILDER_ASSETS_ERR := not detected in $(KUBEBUILDER_ASSETS), to override the assets path set the KUBEBUILDER_ASSETS environment variable, for install instructions see https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest -KUBECTL_ASSETS_ERR := kubectl not detected. -kubebuilder: -ifeq (, $(shell which kubectl)) - $(error $(KUBECTL_ASSETS_ERR)) -endif -ifeq (, $(wildcard $(KUBEBUILDER_ASSETS)/etcd)) - $(error etcd $(KUBEBUILDER_ASSETS_ERR)) -endif -ifeq (, $(wildcard $(KUBEBUILDER_ASSETS)/kube-apiserver)) - $(error kube-apiserver $(KUBEBUILDER_ASSETS_ERR)) -endif +.PHONY: all +all: test image #HELP Unit test, and build operator image -cover.out: - go test $(MOD_FLAGS) -tags "json1" -race -coverprofile=cover.out -covermode=atomic \ - -coverpkg ./pkg/controller/... ./pkg/... +.PHONY: help +help: #HELP Display this help message + @awk 'BEGIN {FS = ":.*#(EX)?HELP"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*#(EX)?HELP / { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^#SECTION / { printf "\n\033[1m%s\033[0m\n", substr($$0, 10) } ' $(MAKEFILE_LIST) -coverage: cover.out - go tool cover -func=cover.out +#SECTION Build -coverage-html: cover.out - go tool cover -html=cover.out +# Note: We want to use BUILDCMD = because we need it to be re-evaluated every time it is used +# since different targets might have different go build flags +BUILD_CMD = go build $(GO_BUILD_FLAGS) -ldflags '$(GO_BUILD_LDFLAGS)' -tags '$(GO_BUILD_TAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -build: build_cmd=build -build: clean $(CMDS) +CMDS := $(shell go list $(GO_BUILD_FLAGS) ./cmd/...) +$(CMDS): FORCE + @echo "Building $(@)" + $(BUILD_CMD) -o ./bin/$(shell basename $@) ./cmd/$(notdir $@) -test-bare: BUILD_TAGS=-tags=bare -test-bare: clean $(TCMDS) +.PHONY: build-utils +build-utils: #HELP Build utility binaries for local OS/ARCH + $(BUILD_CMD) -o ./bin/cpb ./util/cpb -test-bin: clean $(TCMDS) +.PHONY: build #HELP Build binaries for local OS/ARCH +build: build-utils $(CMDS) -# build versions of the binaries with coverage enabled -build-coverage: build_cmd=test -c -covermode=count -coverpkg ./pkg/controller/... -build-coverage: clean $(CMDS) +.PHONY: image +# Set GOOS to linux to build a linux binary for the image +# Don't set GOARCH because we want the default host architecture - this is important for developers on MacOS +image: export GOOS = linux +image: clean build #HELP Build image image for linux on host architecture + docker build -t $(IMAGE_REPO):$(IMAGE_TAG) -f Dockerfile bin -build-linux: build_cmd=build -build-linux: arch_flags=GOOS=linux GOARCH=$(ARCH) -build-linux: clean $(CMDS) +.PHONY: e2e-build +# the e2e and experimental_metrics tags are required to get e2e tests to pass +# search the code for go:build e2e or go:build experimental_metrics to see where these tags are used +e2e-build: export GO_BUILD_TAGS += e2e experimental_metrics #HELP Build image for e2e testing +e2e-build: IMAGE_TAG = local +e2e-build: image + +.PHONY: clean +clean: #HELP Clean up build artifacts + @rm -rf cover.out + @rm -rf bin -build-wait: clean bin/wait +#SECTION Development -bin/wait: FORCE - GOOS=linux GOARCH=$(ARCH) go build $(MOD_FLAGS) -o $@ $(PKG)/test/e2e/wait +.PHONY: lint +lint: $(GOLANGCI_LINT) #HELP Run linters + $(GOLANGCI_LINT) run $(GOLANGCI_LINT_ARGS) -build-util-linux: arch_flags=GOOS=linux GOARCH=$(ARCH) -build-util-linux: build-util +.PHONY: vet +vet: #HELP Run go vet + go vet $(GO_BUILD_FLAGS) ./... -build-util: bin/cpb bin/copy-content +.PHONY: fmt +fmt: #HELP Run go fmt + go fmt ./... -bin/cpb: FORCE - CGO_ENABLED=0 $(arch_flags) go build -buildvcs=false $(MOD_FLAGS) -ldflags '-extldflags "-static"' -o $@ ./util/cpb +vendor: #HELP Update vendored dependencies + go mod tidy + go mod vendor -bin/copy-content: FORCE - CGO_ENABLED=0 $(arch_flags) go build -buildvcs=false $(MOD_FLAGS) -ldflags '-extldflags "-static"' -o $@ ./cmd/copy-content +#SECTION Testing -$(CMDS): version_flags=-ldflags "-X $(PKG)/pkg/version.GitCommit=$(GIT_COMMIT) -X $(PKG)/pkg/version.OLMVersion=`cat OLM_VERSION`" -$(CMDS): - $(arch_flags) go $(build_cmd) $(MOD_FLAGS) $(version_flags) -tags $(BUILD_TAGS) -o bin/$(shell basename $@) $@ +# Note: We want to use TESTCMD = because we need it to be re-evaluated every time it is used +# since different targets might have different settings +UNIT_TEST_CMD = $(GO_TEST_ENV) go test $(GO_BUILD_FLAGS) -tags '$(GO_BUILD_TAGS)' $(GO_TEST_FLAGS) -build: clean $(CMDS) +.PHONE: test +test: clean unit test-split #HELP Run all tests -$(TCMDS): - go test -c $(BUILD_TAGS) $(MOD_FLAGS) -o bin/$(shell basename $@) $@ +.PHONY: unit +unit: GO_TEST_ENV += KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) +unit: $(SETUP_ENVTEST) #HELP Run OLM unit tests with setup-envtest for kubernetes $(KUBE_MINOR).x + $(UNIT_TEST_CMD) ./pkg/controller/... ./pkg/... -deploy-local: - mkdir -p build/resources - . ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml - . ./scripts/install_local.sh $(LOCAL_NAMESPACE) build/resources - rm -rf build +.PHONY: test-split +test-split: #HELP Run e2e test split utility unit tests + # Test the e2e test split utility + $(UNIT_TEST_CMD) ./test/e2e/split/... -e2e.namespace: - @printf "e2e-tests-$(shell date +%s)-$$RANDOM" > e2e.namespace +.PHONY: coverage +coverage: GO_TEST_FLAGS += -coverprofile=cover.out -covermode=atomic -coverpkg +coverage: unit #HELP Run OLM unit tests with coverage + go tool cover -func=cover.out -.PHONY: e2e -E2E_TIMEOUT ?= 90m -E2E_TEST_NS ?= operators -E2E_INSTALL_NS ?= operator-lifecycle-manager -E2E_CATALOG_NS ?= $(E2E_INSTALL_NS) -GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events -e2e: - $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) $(E2E_OPTS) +#SECTION Deployment -.PHONY: e2e-local -e2e-local: e2e-build kind-create deploy e2e +.PHONY: kind-clean +kind-clean: $(KIND) #HELP Delete kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0) + $(KIND) delete cluster --name $(KIND_CLUSTER_NAME) || true -# See workflows/e2e-tests.yml See test/e2e/README.md for details. -.PHONY: e2e-local -e2e-local: BUILD_TAGS="json1 e2e experimental_metrics" -e2e-local: extra_args=-kind.images=../test/e2e-local.image.tar -test-data-dir=../test/e2e/testdata -gather-artifacts-script-path=../test/e2e/collect-ci-artifacts.sh -e2e-local: run=bin/e2e-local.test -e2e-local: bin/e2e-local.test test/e2e-local.image.tar -e2e-local: e2e - -# this target updates the zz_chart.go file with files found in deploy/chart -# this will always fire since it has been marked as phony -.PHONY: test/e2e/assets/chart/zz_chart.go -test/e2e/assets/chart/zz_chart.go: $(shell find deploy/chart -type f) - $(BINDATA) -o $@ -pkg chart -prefix deploy/chart/ $^ +.PHONY: kind-create +kind-create: kind-clean #HELP Create a new kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0) + $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image $(KIND_CLUSTER_IMAGE) $(KIND_CREATE_OPTS) + $(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME) .PHONY: deploy OLM_IMAGE := quay.io/operator-framework/olm:local -deploy: +deploy: $(KIND) $(HELM) #HELP Deploy OLM to kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0) using $OLM_IMAGE (default: quay.io/operator-framework/olm:local) $(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME); \ $(HELM) upgrade --install olm deploy/chart \ --set debug=true \ @@ -187,137 +227,116 @@ deploy: $(HELM_INSTALL_OPTS) \ --wait; -.PHONY: e2e-build -e2e-build: BUILD_TAGS="json1 e2e experimental_metrics" -e2e-build: export GOOS=linux -e2e-build: build_cmd=build -e2e-build: e2e.Dockerfile bin/wait bin/cpb $(CMDS) - docker build -t quay.io/operator-framework/olm:local -f $< bin - docker save -o $@ quay.io/operator-framework/olm:local +.PHONY: undeploy +undeploy: $(KIND) $(HELM) #HELP Uninstall OLM from kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0) + $(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME) -e2e-bare: setup-bare - . ./scripts/run_e2e_bare.sh $(TEST) + # Uninstall Helm chart and remove CRDs + kubectl delete --all-namespaces --all sub + kubectl delete --all-namespaces --all ip + kubectl delete --all-namespaces --all csv + kubectl delete --all-namespaces --all catsrc + $(HELM) uninstall olm + kubectl delete -f deploy/chart/crds -e2e-local-docker: - . ./scripts/build_local.sh - . ./scripts/run_e2e_docker.sh $(TEST) +#SECTION e2e -vendor: - go mod tidy - go mod vendor +# E2E test configuration +# Can be overridden when running make e2e, e.g. E2E_TIMEOUT=60m make e2e/e2e-local +E2E_TIMEOUT ?= 90m +E2E_TEST_NS ?= operators +E2E_INSTALL_NS ?= operator-lifecycle-manager +E2E_CATALOG_NS ?= $(E2E_INSTALL_NS) +E2E_FLAKE_ATTEMPTS ?= 1 +GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events --flake-attempts=$(E2E_FLAKE_ATTEMPTS) $(if $(TEST),-focus '$(TEST)',) -container: - docker build -t $(IMAGE_REPO):$(IMAGE_TAG) . +.PHONY: e2e +e2e: #HELP Run e2e tests against a cluster running OLM (params: $E2E_TEST_NS (operator), $E2E_INSTALL_NS (operator-lifecycle-manager), $E2E_CATALOG_NS (operator-lifecycle-manager), $E2E_TIMEOUT (90m), $E2E_FLAKE_ATTEMPTS (1), $TEST(undefined)) + $(GO_TEST_ENV) $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) $(E2E_OPTS) -clean-e2e: - kubectl delete crds --all - kubectl delete apiservices.apiregistration.k8s.io v1.packages.operators.coreos.com || true - kubectl delete -f test/e2e/resources/0000_50_olm_00-namespace.yaml +.PHONY: e2e-local +e2e-local: e2e-build kind-create deploy e2e -clean: - @rm -rf cover.out - @rm -rf bin - @rm -rf test/e2e/resources - @rm -rf test/e2e/test-resources - @rm -rf test/e2e/log - @rm -rf e2e.namespace +#SECTION Code Generation -# Copy CRD manifests -manifests: vendor +.PHONY: gen-all #HELP Update OLM API, generate code and mocks +gen-all: manifests codegen mockgen + +.PHONY: manifests +manifests: vendor #HELP Copy OLM API CRD manifests to deploy/chart/crds ./scripts/copy_crds.sh -# Generate deepcopy, conversion, clients, listers, and informers -codegen: - # Clients, listers, and informers - $(CODEGEN) +.PHONY: codegen +codegen: #HELP Generate clients, deepcopy, listers, and informers + ./scripts/update_codegen.sh -# Generate mock types. -mockgen: - $(MOCKGEN) +.PHONY: mockgen +mockgen: #HELP Generate mocks + # Generate mocks and silence the followign warning: + # WARNING: Invoking counterfeiter multiple times from "go generate" is slow. + # Consider using counterfeiter:generate directives to speed things up. + # See https://github.com/maxbrunsfeld/counterfeiter#step-2b---add-counterfeitergenerate-directives for more information. + # Set the "COUNTERFEITER_NO_GENERATE_WARNING" environment variable to suppress this message. + COUNTERFEITER_NO_GENERATE_WARNING=1 go generate ./pkg/... -# Generates everything. -gen-all: codegen mockgen manifests +#SECTION Verification +.PHONY: diff diff: git diff --exit-code -verify-codegen: codegen +.PHONY: verify-codegen +verify-codegen: codegen #HELP Check client, deepcopy, listers, and informers are up to date + $(MAKE) diff + +.PHONY: verify-mockgen +verify-mockgen: mockgen #HELP Check mocks are up to date $(MAKE) diff -verify-mockgen: mockgen +.PHONY: verify-manifests +verify-manifests: manifests #HELP Check CRD manifests are up to date $(MAKE) diff -verify-manifests: manifests +.PHONY: verify +verify: vendor verify-codegen verify-mockgen verify-manifests #HELP Run all verification checks $(MAKE) diff -verify: verify-codegen verify-mockgen verify-manifests +#SECTION Release .PHONY: pull-opm pull-opm: docker pull $(OPERATOR_REGISTRY_IMAGE) -# before running release, bump the version in OLM_VERSION and push to master, -# then tag those builds in quay with the version in OLM_VERSION -release: ver=v$(shell cat OLM_VERSION) -# pull the opm image to get the digest -release: pull-opm manifests - @echo "Generating the $(ver) release" - docker pull $(IMAGE_REPO):$(ver) - $(MAKE) target=upstream ver=$(ver) quickstart=true package - -package: olmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(ver)) -package: opmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE)) +.PHONY: package +package: $(YQ) $(HELM) #HELP Package OLM for release +package: OLM_RELEASE_IMG_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(RELEASE_VERSION)) +package: OPM_IMAGE_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE)) +>>>>>>> a83c71d70 (:seedling: cleanup/tools (#3285)) package: -ifndef target - $(error target is undefined) +ifndef TARGET + $(error TARGET is undefined) endif -ifndef ver - $(error ver is undefined) +ifndef RELEASE_VERSION + $(error RELEASE_VERSION is undefined) endif @echo "Getting operator registry image" docker pull $(OPERATOR_REGISTRY_IMAGE) - $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml olm.image.ref $(olmref) - $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml catalog.image.ref $(olmref) - $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml package.image.ref $(olmref) - $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml -- catalog.opmImageArgs "--opmImage=$(opmref)" - ./scripts/package_release.sh $(ver) deploy/$(target)/manifests/$(ver) deploy/$(target)/values.yaml - ln -sfFn ./$(ver) deploy/$(target)/manifests/latest -ifeq ($(quickstart), true) - ./scripts/package_quickstart.sh deploy/$(target)/manifests/$(ver) deploy/$(target)/quickstart/olm.yaml deploy/$(target)/quickstart/crds.yaml deploy/$(target)/quickstart/install.sh + $(YQ) w -i deploy/$(TARGET)/values.yaml olm.image.ref $(OLM_RELEASE_IMG_REF) + $(YQ) w -i deploy/$(TARGET)/values.yaml catalog.image.ref $(OLM_RELEASE_IMG_REF) + $(YQ) w -i deploy/$(TARGET)/values.yaml package.image.ref $(OLM_RELEASE_IMG_REF) + $(YQ) w -i deploy/$(TARGET)/values.yaml -- catalog.opmImageArgs "--opmImage=$(OPM_IMAGE_REF)" + ./scripts/package_release.sh $(RELEASE_VERSION) deploy/$(TARGET)/manifests/$(RELEASE_VERSION) deploy/$(TARGET)/values.yaml + ln -sfFn ./$(RELEASE_VERSION) deploy/$(TARGET)/manifests/latest +ifeq ($(PACKAGE_QUICKSTART), true) + ./scripts/package_quickstart.sh deploy/$(TARGET)/manifests/$(RELEASE_VERSION) deploy/$(TARGET)/quickstart/olm.yaml deploy/$(TARGET)/quickstart/crds.yaml deploy/$(TARGET)/quickstart/install.sh endif -################################ -# OLM - Install/Uninstall/Run # -################################ - -.PHONY: uninstall -uninstall: - @echo Uninstalling OLM: - - kubectl delete -f deploy/upstream/quickstart/crds.yaml - - kubectl delete -f deploy/upstream/quickstart/olm.yaml - - kubectl delete catalogsources.operators.coreos.com - - kubectl delete clusterserviceversions.operators.coreos.com - - kubectl delete installplans.operators.coreos.com - - kubectl delete operatorgroups.operators.coreos.com subscriptions.operators.coreos.com - - kubectl delete apiservices.apiregistration.k8s.io v1.packages.operators.coreos.com - - kubectl delete ns olm - - kubectl delete ns openshift-operator-lifecycle-manager - - kubectl delete ns openshift-operators - - kubectl delete ns operators - - kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-edit - - kubectl delete clusterrole.rbac.authorization.k8s.io/aggregate-olm-view - - kubectl delete clusterrole.rbac.authorization.k8s.io/system:controller:operator-lifecycle-manager - - kubectl delete clusterroles.rbac.authorization.k8s.io "system:controller:operator-lifecycle-manager" - - kubectl delete clusterrolebindings.rbac.authorization.k8s.io "olm-operator-binding-openshift-operator-lifecycle-manager" - -.PHONY: build-local -build-local: build-linux build-wait build-util-linux - rm -rf build - . ./scripts/build_local.sh - -.PHONY: run-local -run-local: build-local - mkdir -p build/resources - . ./scripts/package_release.sh 1.0.0 build/resources doc/install/local-values.yaml - . ./scripts/install_local.sh $(LOCAL_NAMESPACE) build/resources - rm -rf build +.PHONY: release +release: RELEASE_VERSION=v$(shell cat OLM_VERSION) #HELP Generate an OLM release (NOTE: before running release, bump the version in ./OLM_VERSION and push to master, then tag those builds in quay with the version in ./OLM_VERSION) +release: pull-opm manifests # pull the opm image to get the digest + @echo "Generating the $(RELEASE_VERSION) release" + docker pull $(IMAGE_REPO):$(RELEASE_VERSION) + $(MAKE) TARGET=upstream RELEASE_VERSION=$(RELEASE_VERSION) PACKAGE_QUICKSTART=true package + +.PHONY: FORCE +FORCE: diff --git a/staging/operator-lifecycle-manager/go.mod b/staging/operator-lifecycle-manager/go.mod index 328079e015..fed22a86db 100644 --- a/staging/operator-lifecycle-manager/go.mod +++ b/staging/operator-lifecycle-manager/go.mod @@ -10,15 +10,11 @@ require ( github.com/fsnotify/fsnotify v1.7.0 github.com/ghodss/yaml v1.0.0 github.com/go-air/gini v1.0.4 - github.com/go-bindata/go-bindata/v3 v3.1.3 github.com/go-logr/logr v1.4.1 github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 - github.com/googleapis/gnostic v0.5.5 - github.com/itchyny/gojq v0.11.0 - github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 - github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 - github.com/mitchellh/hashstructure v1.0.0 + github.com/itchyny/gojq v0.12.15 + github.com/mitchellh/hashstructure v1.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/onsi/ginkgo/v2 v2.17.1 github.com/onsi/gomega v1.31.1 @@ -46,7 +42,6 @@ require ( k8s.io/apimachinery v0.29.3 k8s.io/apiserver v0.29.3 k8s.io/client-go v0.29.3 - k8s.io/code-generator v0.29.3 k8s.io/component-base v0.29.3 k8s.io/klog v1.0.0 k8s.io/klog/v2 v2.120.1 @@ -54,7 +49,6 @@ require ( k8s.io/kube-openapi v0.0.0-20240221221325-2ac9dc51f3f1 k8s.io/utils v0.0.0-20240102154912-e7106e64919e sigs.k8s.io/controller-runtime v0.17.2 - sigs.k8s.io/controller-tools v0.8.0 sigs.k8s.io/kind v0.20.0 ) @@ -67,7 +61,6 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Masterminds/squirrel v1.5.4 // indirect - github.com/Masterminds/vcs v1.13.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.12.0-rc.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect @@ -90,7 +83,6 @@ require ( github.com/containers/ocicrypt v1.1.9 // indirect github.com/containers/storage v1.51.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/reference v0.6.0 // indirect @@ -98,7 +90,7 @@ require ( github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v25.0.5+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.0 // indirect - github.com/docker/go-connections v0.5.0 // indirect + github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect @@ -106,7 +98,6 @@ require ( github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fvbommel/sortorder v1.1.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -115,10 +106,7 @@ require ( github.com/go-openapi/jsonreference v0.20.4 // indirect github.com/go-openapi/swag v0.22.9 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/gobuffalo/flect v0.2.3 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-yaml v1.8.1 // indirect - github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-migrate/migrate/v4 v4.17.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -144,22 +132,19 @@ require ( github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 // indirect + github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/jmoiron/sqlx v1.3.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kisielk/errcheck v1.5.0 // indirect github.com/klauspost/compress v1.17.4 // indirect github.com/klauspost/pgzip v1.2.6 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect - github.com/lestrrat-go/strftime v1.0.1 // indirect github.com/lib/pq v1.10.9 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -179,12 +164,11 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc6 // indirect github.com/opencontainers/runc v1.1.12 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect - github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rubenv/sql-migrate v1.5.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect @@ -216,14 +200,12 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect - golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.16.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect @@ -232,13 +214,11 @@ require ( google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect - gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/cli-runtime v0.29.3 // indirect - k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect + k8s.io/cli-runtime v0.29.0 // indirect k8s.io/kms v0.29.3 // indirect - k8s.io/kubectl v0.29.3 // indirect - oras.land/oras-go v1.2.5 // indirect + k8s.io/kubectl v0.29.0 // indirect + oras.land/oras-go v1.2.4 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect diff --git a/staging/operator-lifecycle-manager/go.sum b/staging/operator-lifecycle-manager/go.sum index 0fdabde147..1ec7a301cc 100644 --- a/staging/operator-lifecycle-manager/go.sum +++ b/staging/operator-lifecycle-manager/go.sum @@ -25,22 +25,18 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= -github.com/Masterminds/vcs v1.13.3 h1:IIA2aBdXvfbIM+yl/eTnL4hb1XwdpvuQLglAix1gweE= -github.com/Masterminds/vcs v1.13.3/go.mod h1:TiE7xuEjl1N4j016moRd6vezp6e6Lz23gypeXfzXeW8= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.12.0-rc.1 h1:Hy+xzYujv7urO5wrgcG58SPMOXNLrj4WCJbySs2XX/A= github.com/Microsoft/hcsshim v0.12.0-rc.1/go.mod h1:Y1a1S0QlYp1mBpyvGiuEdOfZqnao+0uX5AWHXQ5NhZU= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -56,7 +52,6 @@ github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= @@ -90,18 +85,11 @@ github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOj github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= github.com/containers/storage v1.51.0 h1:AowbcpiWXzAjHosKz7MKvPEqpyX+ryZA/ZurytRrFNA= github.com/containers/storage v1.51.0/go.mod h1:ybl8a3j1PPtpyaEi/5A6TOFs+5TrEyObeKJzVtkUlfc= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -110,10 +98,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/distribution/distribution v2.7.1+incompatible h1:aGFx4EvJWKEh//lHPLwFhFgwFHKH06TzNVPamrMn04M= github.com/distribution/distribution v2.7.1+incompatible/go.mod h1:EgLm2NgWtdKgzF9NpMzUKgzmR7AMmb0VQi2B+ZzDRjc= github.com/distribution/distribution/v3 v3.0.0-alpha.1 h1:jn7I1gvjOvmLztH1+1cLiUFud7aeJCIQcgzugtwjyJo= @@ -128,8 +114,8 @@ github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaP github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= -github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= -github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= @@ -138,7 +124,6 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= @@ -156,10 +141,6 @@ github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1 github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= -github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -168,17 +149,12 @@ github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6 github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= -github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-air/gini v1.0.4 h1:lteMAxHKNOAjIqazL/klOJJmxq6YxxSuJ17MnMXny+s= github.com/go-air/gini v1.0.4/go.mod h1:dd8RvT1xcv6N1da33okvBd8DhMh1/A4siGy6ErjTljs= -github.com/go-bindata/go-bindata/v3 v3.1.3 h1:F0nVttLC3ws0ojc7p60veTurcOm//D4QBODNM7EGrCI= -github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= @@ -193,7 +169,6 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -207,15 +182,11 @@ github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdX github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/gobuffalo/flect v0.2.3 h1:f/ZukRnSNA/DUpSNDadko7Qc0PhGvsew35p/2tu+CRY= -github.com/gobuffalo/flect v0.2.3/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= @@ -224,13 +195,8 @@ github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XE github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/goccy/go-yaml v1.8.1 h1:JuZRFlqLM5cWF6A+waL8AKVuCcqvKOuhJtUQI+L3ez0= -github.com/goccy/go-yaml v1.8.1/go.mod h1:wS4gNoLalDSJxo/SpngzPQ2BN4uuZVLCmbM4S3vd4+Y= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= @@ -238,7 +204,6 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang-migrate/migrate/v4 v4.17.0 h1:rd40H3QXU0AA4IoLllFcEAEo9dYKRHYND2gB4p7xcaU= github.com/golang-migrate/migrate/v4 v4.17.0/go.mod h1:+Cp2mtLP4/aXDTKb9wmXYitdrNx2HGs45rbWAo6OsKM= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -260,7 +225,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.17.7 h1:6ebJFzu1xO2n7TLtN+UBqShGBhlD85bhvglh5DpcfqQ= @@ -280,7 +244,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20230323073829-e72429f035bd h1:r8yyd+DJDmsUhGrRBxH5Pj7KeFK5l+Y3FsgT8keqKtk= @@ -293,13 +256,10 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -307,12 +267,10 @@ github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= @@ -331,8 +289,6 @@ github.com/hashicorp/golang-lru/arc/v2 v2.0.5 h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGN github.com/hashicorp/golang-lru/arc/v2 v2.0.5/go.mod h1:ny6zBSQZi2JxIeYcv7kt2sH2PXJtirBN7RDhRpxPkxU= github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4= github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -342,21 +298,17 @@ github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+h github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 h1:3gyXljUyTWWTv/NMFPvwgxJSdE9Mamg2r3x8HMBl+Uo= -github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645/go.mod h1:296z3W7Xsrp2mlIY88ruDKscuvrkL6zXCNRtaYVshzw= -github.com/itchyny/go-flags v1.5.0/go.mod h1:lenkYuCobuxLBAd/HGFE4LRoW8D3B6iXRQfWYJ+MNbA= -github.com/itchyny/gojq v0.11.0 h1:z7HnaKZ6erVzxPo3BkhJBG7jHmzKdAW8Hcse5N6YAic= -github.com/itchyny/gojq v0.11.0/go.mod h1:my6D2qN2Sm6qa+/5GsPDUZlCWGR+U8Qsa9he76sudv0= +github.com/itchyny/gojq v0.12.15 h1:WC1Nxbx4Ifw5U2oQWACYz32JK8G9qxNtHzrvW4KEcqI= +github.com/itchyny/gojq v0.12.15/go.mod h1:uWAHCbCIla1jiNxmeT5/B5mOjSdfkCq6p8vxWg+BM10= +github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE= +github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= -github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d h1:A2/B900ip/Z20TzkLeGRNy1s6J2HmH9AmGt+dHyqb4I= github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d/go.mod h1:7HQupe4vyNxMKXmM5DFuwXHsqwMyglcYmZBtlDPIcZ8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -368,9 +320,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= @@ -379,31 +328,21 @@ github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= -github.com/lestrrat-go/strftime v1.0.1 h1:o7qz5pmLzPDLyGW4lG6JvTKPUfTFXwe+vOamIYWtnVU= -github.com/lestrrat-go/strftime v1.0.1/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= @@ -412,43 +351,27 @@ github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 h1:NicmruxkeqHjDv03SfSxqmaLuisddudfP3h5wdXFbhM= -github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1/go.mod h1:eyp4DdUJAKkr9tvxR3jWhw2mDK7CWABMG5r9uyaKC7I= github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg= github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 h1:lPmsut5Sk7eK2BmDXuvNEvMbT7MkAJBu64Yxr7iJ6nk= -github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37/go.mod h1:dYWq+UWoFCDY1TndvFUQuhBbIYmZpjreC8adEAx93zE= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= +github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -479,11 +402,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= @@ -508,9 +426,6 @@ github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= -github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 h1:4lfz0keanz7/gAlvJ7lAe9zmE08HXxifBZJC0AdeGKo= -github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9/go.mod h1:6Hr+C/olSdkdL3z68MlyXWzwhvwmwN7KuUFXGb3PoOk= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -527,7 +442,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= @@ -537,20 +451,16 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= @@ -558,47 +468,33 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnA github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY= github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= -github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -608,8 +504,6 @@ github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -620,12 +514,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tebeka/strftime v0.1.3 h1:5HQXOqWKYRFfNyBMNVc9z5+QzuBtIXy03psIhtdJYto= -github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= @@ -641,12 +531,10 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c= @@ -701,15 +589,12 @@ go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxi go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -726,10 +611,6 @@ golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -739,11 +620,9 @@ golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -771,19 +650,11 @@ golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -798,6 +669,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -807,27 +679,20 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -838,8 +703,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -850,7 +713,6 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c h1:Zmyn5CV/jxzKnF+3d+xzbomACPwLQqVpLTpyXN5uTaQ= google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 h1:4++qSzdWBUy9/2x8L5KZgwZw+mjJZ2yDSCGMVM0YzRs= @@ -858,7 +720,6 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -874,7 +735,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -883,25 +743,15 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW8s2qTSe3wGBtvo0MbVQG/c5k8RE= -gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -909,8 +759,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= @@ -928,19 +776,14 @@ k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= k8s.io/apiserver v0.29.3 h1:xR7ELlJ/BZSr2n4CnD3lfA4gzFivh0wwfNfz9L0WZcE= k8s.io/apiserver v0.29.3/go.mod h1:hrvXlwfRulbMbBgmWRQlFru2b/JySDpmzvQwwk4GUOs= -k8s.io/cli-runtime v0.29.3 h1:r68rephmmytoywkw2MyJ+CxjpasJDQY7AGc3XY2iv1k= -k8s.io/cli-runtime v0.29.3/go.mod h1:aqVUsk86/RhaGJwDhHXH0jcdqBrgdF3bZWk4Z9D4mkM= +k8s.io/cli-runtime v0.29.0 h1:q2kC3cex4rOBLfPOnMSzV2BIrrQlx97gxHJs21KxKS4= +k8s.io/cli-runtime v0.29.0/go.mod h1:VKudXp3X7wR45L+nER85YUzOQIru28HQpXr0mTdeCrk= k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= -k8s.io/code-generator v0.29.3 h1:m7E25/t9R9NvejspO2zBdyu+/Gl0Z5m7dCRc680KS14= -k8s.io/code-generator v0.29.3/go.mod h1:x47ofBhN4gxYFcxeKA1PYXeaPreAGaDN85Y/lNUsPoM= k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo= k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kms v0.29.3 h1:ReljsAUhYlm2spdT4yXmY+9a8x8dc/OT4mXvwQPPteQ= @@ -949,18 +792,16 @@ k8s.io/kube-aggregator v0.29.3 h1:5KvTyFN8sQq2imq8tMAHWEKoE64Zg9WSMaGX78KV6ps= k8s.io/kube-aggregator v0.29.3/go.mod h1:xGJqV/SJJ1fbwTGfQLAZfwgqX1EMoaqfotDTkDrqqSk= k8s.io/kube-openapi v0.0.0-20240221221325-2ac9dc51f3f1 h1:rtdnaWfP40MTKv7izH81gkWpZB45pZrwIxyZdPSn1mI= k8s.io/kube-openapi v0.0.0-20240221221325-2ac9dc51f3f1/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= -k8s.io/kubectl v0.29.3 h1:RuwyyIU42MAISRIePaa8Q7A3U74Q9P4MoJbDFz9o3us= -k8s.io/kubectl v0.29.3/go.mod h1:yCxfY1dbwgVdEt2zkJ6d5NNLOhhWgTyrqACIoFhpdd4= +k8s.io/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI= +k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= -oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo= +oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY= +oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= -sigs.k8s.io/controller-tools v0.8.0 h1:uUkfTGEwrguqYYfcI2RRGUnC8mYdCFDqfwPKUcNJh1o= -sigs.k8s.io/controller-tools v0.8.0/go.mod h1:qE2DXhVOiEq5ijmINcFbqi9GZrrUjzB1TuJU0xa6eoY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kind v0.20.0 h1:f0sc3v9mQbGnjBUaqSFST1dwIuiikKVGgoTwpoP33a8= @@ -971,7 +812,6 @@ sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/staging/operator-lifecycle-manager/scripts/package_release.sh b/staging/operator-lifecycle-manager/scripts/package_release.sh index 5218597777..cd8b722c61 100755 --- a/staging/operator-lifecycle-manager/scripts/package_release.sh +++ b/staging/operator-lifecycle-manager/scripts/package_release.sh @@ -12,6 +12,8 @@ version=$1 chartdir=$2 values=$3 +source .bingo/variables.env + charttmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t charttmpdir) charttmpdir=${charttmpdir}/chart @@ -23,6 +25,6 @@ sed "s/^[Vv]ersion:.*\$/version: ${version}/" deploy/chart/Chart.yaml > "${chart mkdir -p "${chartdir}" -go run -mod=vendor helm.sh/helm/v3/cmd/helm template -n olm -f "${values}" --include-crds --output-dir "${charttmpdir}" "${charttmpdir}" +${HELM} template -n olm -f "${values}" --include-crds --output-dir "${charttmpdir}" "${charttmpdir}" cp -R "${charttmpdir}"/olm/{templates,crds}/. "${chartdir}" diff --git a/staging/operator-lifecycle-manager/scripts/update_mockgen.sh b/staging/operator-lifecycle-manager/scripts/update_mockgen.sh deleted file mode 100755 index 122d64f4b9..0000000000 --- a/staging/operator-lifecycle-manager/scripts/update_mockgen.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# install dependencies -go install -mod=vendor ./vendor/github.com/golang/mock/mockgen -go install -mod=vendor ./vendor/github.com/maxbrunsfeld/counterfeiter/v6 - -# generate fakes and mocks -go generate -mod=vendor ./pkg/... diff --git a/staging/operator-lifecycle-manager/tools.go b/staging/operator-lifecycle-manager/tools.go index 3d1b0026f1..dd236aa445 100644 --- a/staging/operator-lifecycle-manager/tools.go +++ b/staging/operator-lifecycle-manager/tools.go @@ -1,17 +1,31 @@ //go:build tools // +build tools +// This file imports packages that support the code generation required for the operators and their tests +// These tools do not belong in bingo they need to be part of the main module because, either: +// - It includes resources that are not directly imported (or importable) in go (e.g. yamls files) +// - They share dependencies (e.g. k8s libraries) with the main module and should be kept in sync package tools +// The OLM API CRDs used as input to the code generators +import _ "github.com/operator-framework/api/crds" // operators.coreos.com CRD manifests + +// mock-generation +// These tools are referenced in //go:generate directives in the code import ( - _ "github.com/go-bindata/go-bindata/v3/go-bindata" _ "github.com/golang/mock/mockgen" +<<<<<<< HEAD _ "github.com/googleapis/gnostic" +======= +>>>>>>> 32d36f043 (:seedling: cleanup/tools (#3285)) _ "github.com/maxbrunsfeld/counterfeiter/v6" - _ "github.com/mikefarah/yq/v3" - _ "github.com/onsi/ginkgo/v2/ginkgo" - _ "github.com/operator-framework/api/crds" // operators.coreos.com CRD manifests - _ "helm.sh/helm/v3/cmd/helm" +) + +// k8s code generators +// Kept in sync with the main module k8s libs +// Ensure underlying commands are executable +// Surface the k8s.io/code-generator/kube_codegen.sh script needed by scripts/update_codegen.sh +import ( _ "k8s.io/code-generator" _ "k8s.io/kube-openapi/cmd/openapi-gen" _ "sigs.k8s.io/controller-tools/cmd/controller-gen" diff --git a/vendor/github.com/itchyny/astgen-go/Makefile b/vendor/github.com/itchyny/astgen-go/Makefile deleted file mode 100644 index 0ff8dd9250..0000000000 --- a/vendor/github.com/itchyny/astgen-go/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -GOBIN ?= $(shell go env GOPATH)/bin -export GO111MODULE=on - -.PHONY: all -all: clean test - -.PHONY: test -test: - go test -v ./... - -.PHONY: lint -lint: $(GOBIN)/golint - go vet ./... - golint -set_exit_status ./... - -$(GOBIN)/golint: - cd && go get golang.org/x/lint/golint - -.PHONY: clean -clean: - go clean diff --git a/vendor/github.com/itchyny/astgen-go/README.md b/vendor/github.com/itchyny/astgen-go/README.md deleted file mode 100644 index 7ac42ea10a..0000000000 --- a/vendor/github.com/itchyny/astgen-go/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# astgen-go [![CI Status](https://github.com/itchyny/astgen-go/workflows/CI/badge.svg)](https://github.com/itchyny/astgen-go/actions) -Build Go code from arbitrary value in Go. - -## Usage -```go -package main - -import ( - "go/printer" - "go/token" - "log" - "os" - - "github.com/itchyny/astgen-go" -) - -type X struct { - x int - y Y - z *Z -} - -type Y struct { - y int -} - -type Z struct { - s string - t map[string]int -} - -func main() { - x := &X{1, Y{2}, &Z{"hello", map[string]int{"x": 42}}} - t, err := astgen.Build(x) - if err != nil { - log.Fatal(err) - } - err = printer.Fprint(os.Stdout, token.NewFileSet(), t) - if err != nil { - log.Fatal(err) - } -} -``` -```go -&X{x: 1, y: Y{y: 2}, z: &Z{s: "hello", t: map[string]int{"x": 42}}} -``` - -## Bug Tracker -Report bug at [Issues・itchyny/astgen-go - GitHub](https://github.com/itchyny/astgen-go/issues). - -## Author -itchyny (https://github.com/itchyny) - -## License -This software is released under the MIT License, see LICENSE. diff --git a/vendor/github.com/itchyny/astgen-go/build.go b/vendor/github.com/itchyny/astgen-go/build.go deleted file mode 100644 index 2c8ca63f15..0000000000 --- a/vendor/github.com/itchyny/astgen-go/build.go +++ /dev/null @@ -1,326 +0,0 @@ -package astgen - -import ( - "bytes" - "fmt" - "go/ast" - "go/printer" - "go/token" - "reflect" - "sort" - "strconv" - "strings" -) - -// Build ast from interface{}. -func Build(x interface{}) (ast.Node, error) { - return (&builder{}).build(reflect.ValueOf(x)) -} - -type builder struct { - vars []builderVar -} - -type builderVar struct { - name string - typ ast.Expr - expr ast.Expr - varptr bool -} - -func (b *builder) build(v reflect.Value) (ast.Node, error) { - n, err := b.buildInner(v) - if err != nil { - return nil, err - } - if len(b.vars) == 0 { - return n, nil - } - t, err := buildType(v.Type()) - if err != nil { - return nil, err - } - params := make([]*ast.Field, 0, len(b.vars)) - args := make([]ast.Expr, 0, len(b.vars)) - body := make([]ast.Stmt, 0, len(b.vars)) - var prevType ast.Expr - for i, bv := range b.vars { - if bv.varptr { - body = append(body, &ast.AssignStmt{ - Tok: token.DEFINE, - Lhs: []ast.Expr{&ast.Ident{Name: bv.name}}, - Rhs: []ast.Expr{bv.expr}, - }) - continue - } - args = append(args, bv.expr) - if i > 0 && reflect.DeepEqual(prevType, bv.typ) { - params[len(params)-1].Names = append( - params[len(params)-1].Names, - &ast.Ident{Name: bv.name}, - ) - continue - } - prevType = bv.typ - params = append(params, &ast.Field{ - Names: []*ast.Ident{&ast.Ident{Name: bv.name}}, - Type: bv.typ, - }) - } - return &ast.CallExpr{ - Fun: &ast.ParenExpr{ - X: &ast.FuncLit{ - Type: &ast.FuncType{ - Params: &ast.FieldList{List: params}, - Results: &ast.FieldList{ - List: []*ast.Field{ - &ast.Field{Type: t}, - }, - }, - }, - Body: &ast.BlockStmt{ - List: append(body, &ast.ReturnStmt{Results: []ast.Expr{n}}), - }, - }, - }, - Args: args, - }, nil -} - -func (b *builder) buildInner(v reflect.Value) (ast.Expr, error) { - switch v.Kind() { - case reflect.Invalid: - return &ast.Ident{Name: "nil"}, nil - case reflect.Bool: - if v.Bool() { - return &ast.Ident{Name: "true"}, nil - } - return &ast.Ident{Name: "false"}, nil - case reflect.Int: - return &ast.BasicLit{Kind: token.INT, Value: fmt.Sprint(v.Int())}, nil - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return callExpr(token.INT, v.Type().Name(), fmt.Sprint(v.Int())), nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return callExpr(token.INT, v.Type().Name(), fmt.Sprint(v.Uint())), nil - case reflect.Float32: - return callExpr(token.FLOAT, "float32", fmt.Sprint(v.Float())), nil - case reflect.Float64: - s := fmt.Sprint(v.Float()) - if !strings.ContainsRune(s, '.') { - s += ".0" - } - return &ast.BasicLit{Kind: token.FLOAT, Value: s}, nil - case reflect.Complex64, reflect.Complex128: - return callExpr(token.FLOAT, v.Type().Name(), fmt.Sprint(v.Complex())), nil - case reflect.String: - if strings.ContainsRune(v.String(), '"') && !strings.ContainsRune(v.String(), '`') { - s := strings.Replace(v.String(), `"`, "", -1) - if len(strconv.Quote(s)) == len(s)+2 { // check no escape characters - return &ast.BasicLit{Kind: token.STRING, Value: "`" + v.String() + "`"}, nil - } - } - return &ast.BasicLit{Kind: token.STRING, Value: strconv.Quote(v.String())}, nil - case reflect.Interface: - e, err := b.buildExpr(v.Elem()) - if err != nil { - return nil, err - } - t, err := buildType(v.Type()) - if err != nil { - return nil, err - } - return &ast.CallExpr{Fun: t, Args: []ast.Expr{e}}, nil - case reflect.Array, reflect.Slice: - exprs := make([]ast.Expr, v.Len()) - for i := 0; i < v.Len(); i++ { - w, err := b.buildExpr(v.Index(i)) - if err != nil { - return nil, err - } - exprs[i] = w - } - t, err := buildType(v.Type()) - if err != nil { - return nil, err - } - return &ast.CompositeLit{Type: t, Elts: exprs}, nil - case reflect.Map: - keys := make([]struct { - value reflect.Value - expr ast.Expr - str string - }, v.Len()) - for i, key := range v.MapKeys() { - expr, err := b.buildExpr(key) - if err != nil { - return nil, err - } - var buf bytes.Buffer - printer.Fprint(&buf, token.NewFileSet(), expr) - keys[i] = struct { - value reflect.Value - expr ast.Expr - str string - }{value: key, expr: expr, str: buf.String()} - } - sort.Slice(keys, func(i, j int) bool { - return keys[i].str < keys[j].str - }) - exprs := make([]ast.Expr, v.Len()) - for i, key := range keys { - v, err := b.buildExpr(v.MapIndex(key.value)) - if err != nil { - return nil, err - } - exprs[i] = &ast.KeyValueExpr{Key: key.expr, Value: v} - } - t, err := buildType(v.Type()) - if err != nil { - return nil, err - } - return &ast.CompositeLit{Type: t, Elts: exprs}, nil - case reflect.Struct: - exprs := make([]ast.Expr, 0, v.NumField()) - for i := 0; i < v.NumField(); i++ { - if isZero(v.Field(i)) { - continue - } - k := &ast.Ident{Name: v.Type().Field(i).Name} - v, err := b.buildExpr(v.Field(i)) - if err != nil { - return nil, err - } - exprs = append(exprs, &ast.KeyValueExpr{Key: k, Value: v}) - } - t, err := buildType(v.Type()) - if err != nil { - return nil, err - } - return &ast.CompositeLit{Type: t, Elts: exprs}, nil - case reflect.Ptr: - w, err := b.buildExpr(v.Elem()) - if err != nil { - return nil, err - } - switch v.Elem().Kind() { - case reflect.Invalid, reflect.Bool, reflect.String, reflect.Interface, reflect.Ptr, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: - return b.newPtrExpr(v.Elem(), w) - } - return &ast.UnaryExpr{Op: token.AND, X: w}, nil - default: - return nil, &unexpectedTypeError{v.Type()} - } -} - -type unexpectedTypeError struct{ t reflect.Type } - -func (err *unexpectedTypeError) Error() string { - return fmt.Sprintf("unexpected type: %s", err.t.Kind()) -} - -func callExpr(kind token.Token, name, value string) *ast.CallExpr { - return &ast.CallExpr{ - Fun: &ast.Ident{Name: name}, - Args: []ast.Expr{ - &ast.BasicLit{Kind: kind, Value: value}, - }, - } -} - -func (b *builder) buildExpr(v reflect.Value) (ast.Expr, error) { - w, err := b.buildInner(v) - if err != nil { - return nil, err - } - e, ok := w.(ast.Expr) - if !ok { - return nil, fmt.Errorf("expected ast.Expr but got: %T", w) - } - return e, nil -} - -func (b *builder) getVarName(v reflect.Value, t, e ast.Expr) string { - for _, bv := range b.vars { - if reflect.DeepEqual(t, bv.typ) && reflect.DeepEqual(e, bv.expr) { - return bv.name - } - } - var buf bytes.Buffer - printer.Fprint(&buf, token.NewFileSet(), e) - base := strings.Map(func(r rune) rune { - if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { - return r - } - return -1 - }, buf.String()) - typ := v.Type().Name() - if typ == "" { - var b bool - typ = strings.Map(func(r rune) rune { - if !b && ('0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z') { - return r - } - b = true - return -1 - }, buf.String()) - } - if len(typ) > 1 { - base = strings.ReplaceAll(base, typ, typ[:1]) - } - if len(base) == 0 || '0' <= base[0] && base[0] <= '9' { - base = "x" + base - } - if len(base) > 3 { - base = base[:3] - } - i := 1 - if len(base) < i { - i = len(base) - } - name := base[:i] - for { - var found bool - for _, bv := range b.vars { - if bv.name == name { - found = true - break - } - } - if !found { - break - } - i++ - if i <= len(base) { - name = base[:i] - } else { - name = base + strconv.Itoa(i-len(base)) - } - } - bv := builderVar{name: name, typ: t, expr: e, varptr: isIdentPtrExpr(e)} - b.vars = append(b.vars, bv) - return name -} - -func (b *builder) newPtrExpr(v reflect.Value, e ast.Expr) (ast.Expr, error) { - t, err := buildType(v.Type()) - if err != nil { - return nil, err - } - return &ast.UnaryExpr{ - Op: token.AND, - X: &ast.Ident{Name: b.getVarName(v, t, e)}, - }, nil -} - -func isIdentPtrExpr(e ast.Expr) bool { - if e, ok := e.(*ast.UnaryExpr); ok { - if e.Op == token.AND { - _, ok := e.X.(*ast.Ident) - return ok - } - } - return false -} diff --git a/vendor/github.com/itchyny/astgen-go/is_zero.go b/vendor/github.com/itchyny/astgen-go/is_zero.go deleted file mode 100644 index 08879246d9..0000000000 --- a/vendor/github.com/itchyny/astgen-go/is_zero.go +++ /dev/null @@ -1,37 +0,0 @@ -package astgen - -import "reflect" - -func isZero(val reflect.Value) bool { - switch val.Kind() { - case reflect.Bool: - return !val.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return val.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return val.Uint() == 0 - case reflect.Float32, reflect.Float64: - return val.Float() == 0 - case reflect.Complex64, reflect.Complex128: - return val.Complex() == 0 - case reflect.Array: - for i := 0; i < val.Len(); i++ { - if !isZero(val.Index(i)) { - return false - } - } - return true - case reflect.Map, reflect.Slice, reflect.String: - return val.Len() == 0 - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr: - return val.IsNil() - case reflect.Struct: - for i := 0; i < val.NumField(); i++ { - if !isZero(val.Field(i)) { - return false - } - } - return true - } - panic("unknown type: " + val.Type().String()) -} diff --git a/vendor/github.com/itchyny/astgen-go/type.go b/vendor/github.com/itchyny/astgen-go/type.go deleted file mode 100644 index efbfc34d8c..0000000000 --- a/vendor/github.com/itchyny/astgen-go/type.go +++ /dev/null @@ -1,80 +0,0 @@ -package astgen - -import ( - "fmt" - "go/ast" - "go/token" - "reflect" -) - -func buildType(t reflect.Type) (ast.Expr, error) { - if t.Name() != "" { - return &ast.Ident{Name: t.Name()}, nil - } - switch t.Kind() { - case reflect.Interface: - return &ast.InterfaceType{Methods: &ast.FieldList{}}, nil - case reflect.Array: - elem, err := buildType(t.Elem()) - if err != nil { - return nil, err - } - return &ast.ArrayType{ - Len: &ast.BasicLit{Kind: token.INT, Value: fmt.Sprint(t.Len())}, - Elt: elem, - }, nil - case reflect.Slice: - elem, err := buildType(t.Elem()) - if err != nil { - return nil, err - } - return &ast.ArrayType{Elt: elem}, nil - case reflect.Map: - k, err := buildType(t.Key()) - if err != nil { - return nil, err - } - v, err := buildType(t.Elem()) - if err != nil { - return nil, err - } - return &ast.MapType{Key: k, Value: v}, nil - case reflect.Struct: - if t.Name() != "" { - return &ast.Ident{Name: t.Name()}, nil - } - fs := make([]*ast.Field, 0, t.NumField()) - var prevType ast.Expr - var prevTag reflect.StructTag - for i := 0; i < t.NumField(); i++ { - sf := t.Field(i) - t, err := buildType(sf.Type) - if err != nil { - return nil, err - } - if reflect.DeepEqual(prevType, t) && prevTag == sf.Tag { - fs[len(fs)-1].Names = append(fs[len(fs)-1].Names, &ast.Ident{Name: sf.Name}) - continue - } - var tag *ast.BasicLit - if sf.Tag != "" { - tag = &ast.BasicLit{Value: "`" + string(sf.Tag) + "`"} - } - fs = append(fs, &ast.Field{ - Names: []*ast.Ident{&ast.Ident{Name: sf.Name}}, - Type: t, - Tag: tag, - }) - prevType, prevTag = t, sf.Tag - } - return &ast.StructType{Fields: &ast.FieldList{List: fs}}, nil - case reflect.Ptr: - t, err := buildType(t.Elem()) - if err != nil { - return nil, err - } - return &ast.StarExpr{X: t}, nil - default: - return nil, &unexpectedTypeError{t} - } -} diff --git a/vendor/github.com/itchyny/gojq/.dockerignore b/vendor/github.com/itchyny/gojq/.dockerignore index 8cdc04df4c..54095155cc 100644 --- a/vendor/github.com/itchyny/gojq/.dockerignore +++ b/vendor/github.com/itchyny/gojq/.dockerignore @@ -1,5 +1,16 @@ -/goxz /gojq -/._* +/goxz +/CREDITS /y.output -/.github/ +*.exe +*.test +*.out +*.md +*.y +**/*.jq +**/*.json +**/*.yaml +**/*_test.go +.github +_gojq +_tools diff --git a/vendor/github.com/itchyny/gojq/.gitattributes b/vendor/github.com/itchyny/gojq/.gitattributes new file mode 100644 index 0000000000..797f395939 --- /dev/null +++ b/vendor/github.com/itchyny/gojq/.gitattributes @@ -0,0 +1,3 @@ +**/testdata/** binary +/builtin.go eol=lf linguist-generated=true +/parser.go eol=lf linguist-generated=true diff --git a/vendor/github.com/itchyny/gojq/.gitignore b/vendor/github.com/itchyny/gojq/.gitignore index 77470e7ef7..bbeb991f8c 100644 --- a/vendor/github.com/itchyny/gojq/.gitignore +++ b/vendor/github.com/itchyny/gojq/.gitignore @@ -1,4 +1,7 @@ -/goxz /gojq -/._* +/goxz +/CREDITS /y.output +*.exe +*.test +*.out diff --git a/vendor/github.com/itchyny/gojq/CHANGELOG.md b/vendor/github.com/itchyny/gojq/CHANGELOG.md index cec4092283..599f62210d 100644 --- a/vendor/github.com/itchyny/gojq/CHANGELOG.md +++ b/vendor/github.com/itchyny/gojq/CHANGELOG.md @@ -1,4 +1,195 @@ # Changelog +## [v0.12.15](https://github.com/itchyny/gojq/compare/v0.12.14..v0.12.15) (2024-04-01) +* implement `ltrim`, `rtrim`, and `trim` functions +* implement `gojq.ParseError` for getting the offset and token of query parsing error +* implement `gojq.HaltError` for detecting halt errors and stopping outer iteration +* fix object construction with duplicate keys (`{x:0,y:1} | {a:.x,a:.y}`) +* fix `halt` and `halt_error` functions to stop the command execution immediately +* fix variable scope of binding syntax (`"a" as $v | def f: $v; "b" as $v | f`) +* fix pre-defined variables to be available in initial modules (`$ARGS` in `~/.jq`) +* fix `ltrimstr` and `rtrimstr` functions to emit error on non-string input +* fix `nearbyint` and `rint` functions to round ties to even +* improve parser to allow `reduce`, `foreach`, `if`, `try`-`catch` syntax as object values +* remove `pow10` in favor of `exp10`, define `scalbn` and `scalbln` by `ldexp` + +## [v0.12.14](https://github.com/itchyny/gojq/compare/v0.12.13..v0.12.14) (2023-12-01) +* implement `abs`, `pick`, and `debug/1` functions +* implement `--raw-output0` option, and remove `--nul-output` (`-0`) option +* fix string multiplication by zero to emit an empty string +* fix zero divided by zero to emit an error, not `nan` +* fix modulo operator to emit `nan` if either side is `nan` +* fix `implode` function to emit replacement characters on invalid code points +* fix `stderr` function to output strings in raw format +* fix `error` function to throw an error even for `null` +* fix `walk` function on multiple outputs arguments +* fix `--from-file` option to work with `--args` and `--jsonargs` options +* fix the default module search path `../lib` relative to the executable +* improve query parser to support comment continuation with backslash +* improve `modulemeta` function to include defined function names in the module +* improve search path of `import` and `include` directives to support `$ORIGIN` expansion +* remove deprecated `leaf_paths` function + +## [v0.12.13](https://github.com/itchyny/gojq/compare/v0.12.12..v0.12.13) (2023-06-01) +* implement `@urid` format string to decode URI values +* fix functions returning arrays not to emit nil slices (`flatten`, `group_by`, + `unique`, `unique_by`, `nth`, `indices`, `path`, and `modulemeta.deps`) + +## [v0.12.12](https://github.com/itchyny/gojq/compare/v0.12.11..v0.12.12) (2023-03-01) +* fix assignment operator (`=`) with overlapping paths and multiple values (`[[]] | .. = ..`) +* fix crash on multiplying large numbers to an empty string (`9223372036854775807 * ""`) +* improve zsh completion file + +## [v0.12.11](https://github.com/itchyny/gojq/compare/v0.12.10..v0.12.11) (2022-12-24) +* fix crash on assignment operator (`=`) with multiple values (`. = (0,0)`) +* fix `isnormal` and `normals` functions against subnormal numbers + +## [v0.12.10](https://github.com/itchyny/gojq/compare/v0.12.9..v0.12.10) (2022-12-01) +* fix `break` in `try`-`catch` query (`label $x | try break $x catch .`) +* fix path value validation for `getpath` function (`path(getpath([[0]][0]))`) +* fix path value validation for custom iterator functions +* fix `walk` function with argument emitting multiple values (`[1],{x:1} | walk(.,0)`) +* fix `@csv`, `@tsv`, `@sh` to escape the null character (`["\u0000"] | @csv,@tsv,@sh`) +* improve performance of assignment operator (`=`), update-assignment operator (`|=`), + `map_values`, `del`, `delpaths`, `walk`, `ascii_downcase`, and `ascii_upcase` functions + +## [v0.12.9](https://github.com/itchyny/gojq/compare/v0.12.8..v0.12.9) (2022-09-01) +* fix `fromjson` to emit error on unexpected trailing string +* fix path analyzer on variable argument evaluation (`def f($x): .y; path(f(.x))`) +* fix raw input option `--raw-input` (`-R`) to keep carriage returns and support 64KiB+ lines + +## [v0.12.8](https://github.com/itchyny/gojq/compare/v0.12.7..v0.12.8) (2022-06-01) +* implement `gojq.Compare` for comparing values in custom internal functions +* implement `gojq.TypeOf` for obtaining type name of values in custom internal functions +* implement `gojq.Preview` for previewing values for error messages of custom internal functions +* fix query lexer to parse string literals as JSON to support surrogate pairs (`"\ud83d\ude04"`) +* fix priority bug of declared and builtin functions (`def empty: .; null | select(.)`) +* fix string indexing by index out of bounds to emit `null` (`"abc" | .[3]`) +* fix array binding pattern not to match against strings (`"abc" as [$a] ?// $a | $a`) +* fix `sub` and `gsub` functions to emit results in the same order of jq +* fix `fromjson` to keep integer precision (`"10000000000000000" | fromjson + 1`) +* fix stream option to raise error against incomplete JSON input +* improve array updating index and string repetition to increase limitations +* improve `mktime` to support nanoseconds, just like `gmtime` and `now` +* improve query lexer to report unterminated string literals +* improve performance of string indexing and slicing by reducing allocations +* improve performance of object and array indexing, slicing, and iteration, + by validating path values by comparing data addresses. This change improves jq + compatibility of path value validation (`{} | {}.x = 0`, `[0] | [.[]][] = 1`). + Also optimize constant indexing and slicing by specialized instruction +* improve performance of `add` (on array of strings), `flatten`, `min`, `max`, + `sort`, `unique`, `join`, `to_entries`, `from_entries`, `indices`, `index`, + `rindex`, `startswith`, `endswith`, `ltrimstr`, `rtrimstr`, `explode`, + `capture`, `sub`, and `gsub` functions + +## [v0.12.7](https://github.com/itchyny/gojq/compare/v0.12.6..v0.12.7) (2022-03-01) +* fix precedence of try expression against operators (`try 0 * error(0)`) +* fix iterator suffix with optional operator (`0 | .x[]?`) +* fix stream option with slurp option or `input`, `inputs` functions +* fix the command flag parser to support equal sign in short options with argument +* fix string conversion of query including empty strings in module and import metadata +* improve performance of `isempty` function + +## [v0.12.6](https://github.com/itchyny/gojq/compare/v0.12.5..v0.12.6) (2021-12-01) +* implement options for consuming remaining arguments (`--args`, `--jsonargs`, `$ARGS.positional`) +* fix `delpaths` function with overlapped paths +* fix `--exit-status` flag with `halt`, `halt_error` functions +* fix `input_filename` function with null input option +* fix path value validation for `nan` +* fix crash on branch optimization (`if 0 then . else 0|0 end`) +* add validation on regular expression flags to reject unsupported ones +* improve performance of `range`, `join`, `flatten` functions +* improve constant value optimization for object with quoted keys +* remove dependency on forked `go-flags` package + +## [v0.12.5](https://github.com/itchyny/gojq/compare/v0.12.4..v0.12.5) (2021-09-01) +* implement `input_filename` function for the command +* fix priority bug of declared functions and arguments (`def g: 1; def f(g): g; f(2)`) +* fix label handling to catch the correct break error (`first((0, 0) | first(0))`) +* fix `null|error` and `error(null)` to behave like `empty` (`null | [0, error, error(null), 1]`) +* fix integer division to keep precision when divisible (`1 / 1 * 1000000000000000000000`) +* fix modulo operator on negative number and large number (`(-1) % 10000000000`) +* fix combination of slurp (`--slurp`) and raw input option (`--raw-input`) to keep newlines +* change the default module paths to `~/.jq`, `$ORIGIN/../lib/gojq`, `$ORIGIN/lib` + where `$ORIGIN` is the directory where the executable is located in +* improve command argument parser to recognize query with leading hyphen, + allow hyphen for standard input, and force posix style on Windows +* improve `@base64d` to allow input without padding characters +* improve `fromdate`, `fromdateiso8601` to parse date time strings with timezone offset +* improve `halt_error` to print error values without prefix +* improve `sub`, `gsub` to allow the replacement string emitting multiple values +* improve encoding `\b` and `\f` in strings +* improve module loader for search path in query, and absolute path +* improve query lexer to support string literal including newlines +* improve performance of `index`, `rindex`, `indices`, `transpose`, and `walk` functions +* improve performance of value preview in errors and debug mode +* improve runtime performance including tail call optimization +* switch Docker base image to `distroless/static:debug` + +## [v0.12.4](https://github.com/itchyny/gojq/compare/v0.12.3..v0.12.4) (2021-06-01) +* fix numeric conversion of large floating-point numbers in modulo operator +* implement a compiler option for adding custom iterator functions +* implement `gojq.NewIter` function for creating a new iterator from values +* implement `$ARGS.named` for listing command line variables +* remove `debug` and `stderr` functions from the library +* stop printing newlines on `stderr` function for jq compatibility + +## [v0.12.3](https://github.com/itchyny/gojq/compare/v0.12.2..v0.12.3) (2021-04-01) +* fix array slicing with infinities and large numbers (`[0][-infinite:infinite], [0][:1e20]`) +* fix multiplying strings and modulo by infinities on MIPS 64 architecture +* fix git revision information in Docker images +* release multi-platform Docker images for ARM 64 +* switch to `distroless` image for Docker base image + +## [v0.12.2](https://github.com/itchyny/gojq/compare/v0.12.1..v0.12.2) (2021-03-01) +* implement `GOJQ_COLORS` environment variable to configure individual colors +* respect `--color-output` (`-C`) option even if `NO_COLOR` is set +* implement `gojq.ValueError` interface for custom internal functions +* fix crash on timestamps in YAML input +* fix calculation on `infinite` (`infinite-infinite | isnan`) +* fix comparison on `nan` (`nan < nan`) +* fix validation of `implode` (`[-1] | implode`) +* fix number normalization for custom JSON module loader +* print error line numbers on invalid JSON and YAML +* improve `strftime`, `strptime` for time zone offsets +* improve performance on reading a large JSON file given by command line argument +* improve performance and reduce memory allocation of the lexer, compiler and executor + +## [v0.12.1](https://github.com/itchyny/gojq/compare/v0.12.0..v0.12.1) (2021-01-17) +* skip adding `$HOME/.jq` to module paths when `$HOME` is unset +* fix optional operator followed by division operator (`1?/1`) +* fix undefined format followed by optional operator (`@foo?`) +* fix parsing invalid consecutive dots while scanning a number (`0..[empty]`) +* fix panic on printing a query with `%#v` +* improve performance and reduce memory allocation of `query.String()` +* change all methods of `ModuleLoader` optional + +## [v0.12.0](https://github.com/itchyny/gojq/compare/v0.11.2..v0.12.0) (2020-12-24) +* implement tab indentation option (`--tab`) +* implement a compiler option for adding custom internal functions +* implement `gojq.Marshal` function for jq-flavored encoding +* fix slurp option with JSON file arguments +* fix escaping characters in object keys +* fix normalizing negative `int64` to `int` on 32-bit architecture +* fix crash on continuing iteration after emitting an error +* `iter.Next()` does not normalize `NaN` and infinities anymore. Library users + should take care of them. To handle them for encoding as JSON bytes, use + `gojq.Marshal`. Also, `iter.Next()` does not clone values deeply anymore for + performance reason. Users must not update the elements of the returned arrays + and objects +* improve performance of outputting JSON values by about 3.5 times + +## [v0.11.2](https://github.com/itchyny/gojq/compare/v0.11.1..v0.11.2) (2020-10-01) +* fix build for 32bit architecture +* release to [GitHub Container Registry](https://github.com/users/itchyny/packages/container/package/gojq) + +## [v0.11.1](https://github.com/itchyny/gojq/compare/v0.11.0..v0.11.1) (2020-08-22) +* improve compatibility of `strftime`, `strptime` functions with jq +* fix YAML input with numbers in keys +* fix crash on multiplying a large number or `infinite` to a string +* fix crash on error while slicing a string (`""[:{}]`) +* fix crash on modulo by a number near 0.0 (`1 % 0.1`) +* include `CREDITS` file in artifacts + ## [v0.11.0](https://github.com/itchyny/gojq/compare/v0.10.4..v0.11.0) (2020-07-08) * improve parsing performance significantly * rewrite the parser from `participle` library to `goyacc` generated parser @@ -78,7 +269,7 @@ ## [v0.7.0](https://github.com/itchyny/gojq/compare/v0.6.0..v0.7.0) (2019-12-22) * implement YAML input (`--yaml-input`) and output (`--yaml-output`) * fix pipe in object value -* fix precedence of if, try, reduce and foreach expressions +* fix precedence of `if`, `try`, `reduce` and `foreach` expressions * release from GitHub Actions ## [v0.6.0](https://github.com/itchyny/gojq/compare/v0.5.0..v0.6.0) (2019-08-26) @@ -120,7 +311,6 @@ * implement `setpath` function ## [v0.3.0](https://github.com/itchyny/gojq/compare/v0.2.0..v0.3.0) (2019-06-05) - * implement `reduce`, `foreach`, `label`, `break` syntax * improve binding variable syntax to bind to an object or an array * implement string interpolation @@ -149,7 +339,6 @@ * implement `-s` flag for reading all inputs into an array ## [v0.2.0](https://github.com/itchyny/gojq/compare/v0.1.0..v0.2.0) (2019-05-06) - * implement binding variable syntax (`... as $var`) * implement `try` `catch` syntax * implement alternative operator (`//`) @@ -161,7 +350,6 @@ * support indexing against strings ## [v0.1.0](https://github.com/itchyny/gojq/compare/v0.0.1..v0.1.0) (2019-05-02) - * implement binary operators (`+`, `-`, `*`, `/`, `%`, `==`, `!=`, `>`, `<`, `>=`, `<=`, `and`, `or`) * implement unary operators (`+`, `-`) @@ -181,5 +369,4 @@ * support json file name arguments ## [v0.0.1](https://github.com/itchyny/gojq/compare/0fa3241..v0.0.1) (2019-04-14) - * initial implementation diff --git a/vendor/github.com/itchyny/gojq/Dockerfile b/vendor/github.com/itchyny/gojq/Dockerfile index 97eeae60dc..d5e0dce63e 100644 --- a/vendor/github.com/itchyny/gojq/Dockerfile +++ b/vendor/github.com/itchyny/gojq/Dockerfile @@ -1,12 +1,14 @@ -FROM golang:1.14 as builder +FROM golang:1.22 AS builder WORKDIR /app +COPY go.* ./ +RUN go mod download COPY . . ENV CGO_ENABLED 0 RUN make build -FROM alpine:3.12 +FROM gcr.io/distroless/static:debug -COPY --from=builder /app/gojq /usr/local/bin/ -ENTRYPOINT ["/usr/local/bin/gojq"] +COPY --from=builder /app/gojq / +ENTRYPOINT ["/gojq"] CMD ["--help"] diff --git a/vendor/github.com/itchyny/gojq/LICENSE b/vendor/github.com/itchyny/gojq/LICENSE index 6f620828dc..fe59004071 100644 --- a/vendor/github.com/itchyny/gojq/LICENSE +++ b/vendor/github.com/itchyny/gojq/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019-2020 itchyny +Copyright (c) 2019-2024 itchyny Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/github.com/itchyny/gojq/Makefile b/vendor/github.com/itchyny/gojq/Makefile index 22176da3a8..b7cdb4001f 100644 --- a/vendor/github.com/itchyny/gojq/Makefile +++ b/vendor/github.com/itchyny/gojq/Makefile @@ -1,71 +1,81 @@ BIN := gojq VERSION := $$(make -s show-version) VERSION_PATH := cli -CURRENT_REVISION := $(shell git rev-parse --short HEAD) -BUILD_LDFLAGS := "-s -w -X github.com/itchyny/$(BIN)/cli.revision=$(CURRENT_REVISION)" +CURRENT_REVISION = $(shell git rev-parse --short HEAD) +BUILD_LDFLAGS = "-s -w -X github.com/itchyny/$(BIN)/cli.revision=$(CURRENT_REVISION)" GOBIN ?= $(shell go env GOPATH)/bin -export GO111MODULE=on +SHELL := /bin/bash .PHONY: all all: build .PHONY: build -build: parser.go builtin.go +build: + go build -ldflags=$(BUILD_LDFLAGS) -o $(BIN) ./cmd/$(BIN) + +.PHONY: build-dev +build-dev: parser.go builtin.go go build -ldflags=$(BUILD_LDFLAGS) -o $(BIN) ./cmd/$(BIN) .PHONY: build-debug build-debug: parser.go builtin.go - go build -tags debug -ldflags=$(BUILD_LDFLAGS) -o $(BIN) ./cmd/$(BIN) + go build -tags gojq_debug -ldflags=$(BUILD_LDFLAGS) -o $(BIN) ./cmd/$(BIN) builtin.go: builtin.jq parser.go.y parser.go query.go operator.go _tools/* GOOS= GOARCH= go generate .SUFFIXES: -parser.go: parser.go.y lexer.go $(GOBIN)/goyacc +parser.go: parser.go.y $(GOBIN)/goyacc goyacc -o $@ $< $(GOBIN)/goyacc: - @cd && go get golang.org/x/tools/cmd/goyacc + @go install golang.org/x/tools/cmd/goyacc@latest .PHONY: install -install: builtin.go - go install -ldflags=$(BUILD_LDFLAGS) ./... +install: + go install -ldflags=$(BUILD_LDFLAGS) ./cmd/$(BIN) + +.PHONY: install-dev +install-dev: parser.go builtin.go + go install -ldflags=$(BUILD_LDFLAGS) ./cmd/$(BIN) .PHONY: install-debug -install-debug: builtin.go - go install -tags debug -ldflags=$(BUILD_LDFLAGS) ./... +install-debug: parser.go builtin.go + go install -tags gojq_debug -ldflags=$(BUILD_LDFLAGS) ./cmd/$(BIN) .PHONY: show-version show-version: $(GOBIN)/gobump - @gobump show -r $(VERSION_PATH) + @gobump show -r "$(VERSION_PATH)" $(GOBIN)/gobump: - @cd && go get github.com/x-motemen/gobump/cmd/gobump + @go install github.com/x-motemen/gobump/cmd/gobump@latest .PHONY: cross -cross: $(GOBIN)/goxz - goxz -n $(BIN) -pv=v$(VERSION) -include _$(BIN) -build-ldflags=$(BUILD_LDFLAGS) ./cmd/$(BIN) +cross: $(GOBIN)/goxz CREDITS + goxz -n $(BIN) -pv=v$(VERSION) -include _$(BIN) \ + -build-ldflags=$(BUILD_LDFLAGS) ./cmd/$(BIN) $(GOBIN)/goxz: - cd && go get github.com/Songmu/goxz/cmd/goxz + go install github.com/Songmu/goxz/cmd/goxz@latest + +CREDITS: $(GOBIN)/gocredits go.sum + go mod tidy + gocredits -w . + +$(GOBIN)/gocredits: + go install github.com/Songmu/gocredits/cmd/gocredits@latest .PHONY: test test: build - go test -v ./... + go test -v -race ./... .PHONY: lint -lint: $(GOBIN)/golint - golint -set_exit_status ./... +lint: $(GOBIN)/staticcheck + go vet ./... + staticcheck -checks all -tags gojq_debug ./... -$(GOBIN)/golint: - cd && go get golang.org/x/lint/golint - -.PHONY: maligned -maligned: $(GOBIN)/maligned - ! maligned *.go | grep ^ - -$(GOBIN)/maligned: - cd && go get github.com/mdempsky/maligned +$(GOBIN)/staticcheck: + go install honnef.co/go/tools/cmd/staticcheck@latest .PHONY: check-tools check-tools: @@ -73,26 +83,21 @@ check-tools: .PHONY: clean clean: - rm -rf $(BIN) goxz + rm -rf $(BIN) goxz CREDITS go clean +.PHONY: update +update: export GOPROXY=direct +update: + go get -u -d ./... && go mod tidy + go mod edit -modfile=go.dev.mod -droprequire=github.com/itchyny/{astgen,timefmt}-go + go get -u -d -modfile=go.dev.mod github.com/itchyny/{astgen,timefmt}-go && go generate + .PHONY: bump bump: $(GOBIN)/gobump -ifneq ($(shell git status --porcelain),) - $(error git workspace is dirty) -endif -ifneq ($(shell git rev-parse --abbrev-ref HEAD),master) - $(error current branch is not master) -endif + test -z "$$(git status --porcelain || echo .)" + test "$$(git branch --show-current)" = "main" @gobump up -w "$(VERSION_PATH)" git commit -am "bump up version to $(VERSION)" git tag "v$(VERSION)" - git push origin master - git push origin "refs/tags/v$(VERSION)" - -.PHONY: upload -upload: $(GOBIN)/ghr - ghr "v$(VERSION)" goxz - -$(GOBIN)/ghr: - cd && go get github.com/tcnksm/ghr + git push --atomic origin main tag "v$(VERSION)" diff --git a/vendor/github.com/itchyny/gojq/README.md b/vendor/github.com/itchyny/gojq/README.md index f342546d0a..7b34f93c34 100644 --- a/vendor/github.com/itchyny/gojq/README.md +++ b/vendor/github.com/itchyny/gojq/README.md @@ -1,5 +1,13 @@ -# gojq [![CI Status](https://github.com/itchyny/gojq/workflows/CI/badge.svg)](https://github.com/itchyny/gojq/actions) -Pure Go implementation of [jq](https://github.com/stedolan/jq). +# gojq +[![CI Status](https://github.com/itchyny/gojq/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/itchyny/gojq/actions?query=branch:main) +[![Go Report Card](https://goreportcard.com/badge/github.com/itchyny/gojq)](https://goreportcard.com/report/github.com/itchyny/gojq) +[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/itchyny/gojq/blob/main/LICENSE) +[![release](https://img.shields.io/github/release/itchyny/gojq/all.svg)](https://github.com/itchyny/gojq/releases) +[![pkg.go.dev](https://pkg.go.dev/badge/github.com/itchyny/gojq)](https://pkg.go.dev/github.com/itchyny/gojq) + +### Pure Go implementation of [jq](https://github.com/jqlang/jq) +This is an implementation of jq command written in Go language. +You can also embed gojq as a library to your Go products. ## Usage ```sh @@ -25,14 +33,14 @@ Pure Go implementation of [jq](https://github.com/stedolan/jq). 2 3 $ echo '{"foo": 4722366482869645213696}' | gojq .foo -4722366482869645213696 # keeps the precision of number while jq does not +4722366482869645213696 # keeps the precision of large numbers $ gojq -n 'def fact($n): if $n < 1 then 1 else $n * fact($n - 1) end; fact(50)' 30414093201713378043612608166064768844377641568960512000000000000 # arbitrary-precision integer calculation ``` Nice error messages. ```sh - $ echo '[1,2,3]' | gojq '.foo & .bar' + $ echo '[1,2,3]' | gojq '.foo & .bar' gojq: invalid query: .foo & .bar .foo & .bar ^ unexpected token "&" @@ -45,25 +53,42 @@ gojq: invalid json: ## Installation ### Homebrew ```sh -brew install itchyny/tap/gojq +brew install gojq +``` + +### Zero Install +```sh +0install add gojq https://apps.0install.net/utils/gojq.xml ``` ### Build from source ```sh -env GO111MODULE=on go get github.com/itchyny/gojq/cmd/gojq +go install github.com/itchyny/gojq/cmd/gojq@latest ``` ### Docker ```sh docker run -i --rm itchyny/gojq +docker run -i --rm ghcr.io/itchyny/gojq ``` ## Difference to jq - gojq is purely implemented with Go language and is completely portable. jq depends on the C standard library so the availability of math functions depends on the library. jq also depends on the regular expression library and it makes build scripts complex. - gojq implements nice error messages for invalid query and JSON input. The error message of jq is sometimes difficult to tell where to fix the query. -- gojq does not keep the order of object keys. I understand this might cause problems for some scripts but basically we should not rely on the order of object keys. I would implement when ordered map is implemented in the standard library of Go but I'm less motivated. -- gojq supports arbitrary-precision integer calculation while jq does not. This is important to keeping the precision of numeric IDs or nanosecond values. You can use gojq to solve some mathematical problems which require big integers. -- gojq supports reading from YAML input while jq does not. gojq also supports YAML output. +- gojq does not keep the order of object keys. I understand this might cause problems for some scripts but basically, we should not rely on the order of object keys. Due to this limitation, gojq does not have `keys_unsorted` function and `--sort-keys` (`-S`) option. I would implement when ordered map is implemented in the standard library of Go but I'm less motivated. +- gojq supports arbitrary-precision integer calculation while jq does not; jq loses the precision of large integers when calculation is involved. Note that even with gojq, all mathematical functions, including `floor` and `round`, convert integers to floating-point numbers; only addition, subtraction, multiplication, modulo, and division operators (when divisible) keep the integer precision. To calculate floor division of integers without losing the precision, use `def idivide($n): (. - . % $n) / $n;`. To round down floating-point numbers to integers, use `def ifloor: floor | tostring | tonumber;`, but note that this function does not work with large floating-point numbers and also loses the precision of large integers. +- gojq behaves differently than jq in some features, hoping that jq will fix the behaviors in the future. gojq consistently counts by characters (not by bytes) in `index`, `rindex`, and `indices` functions; `"12345" | .[index("3"):]` results in `"345"` ([jq#1430](https://github.com/jqlang/jq/issues/1430), [jq#1624](https://github.com/jqlang/jq/issues/1624)). gojq supports string indexing; `"abcde"[2]` ([jq#1520](https://github.com/jqlang/jq/issues/1520)). gojq fixes handling files with no newline characters at the end ([jq#2374](https://github.com/jqlang/jq/issues/2374)). gojq consistently truncates down floating-point number indices both in indexing (`[0] | .[0.5]` results in `0`), and slicing (`[0,1,2] | .[0.5:1.5]` results in `[0]`). gojq parses unary operators with higher precedence than variable binding (`[-1 as $x | 1,$x]` results in `[1,-1]` not `[-1,-1]`) ([jq#3053](https://github.com/jqlang/jq/pull/3053)). gojq fixes `@base64d` to allow binary string as the decoded string ([jq#1931](https://github.com/jqlang/jq/issues/1931)). gojq improves time formatting and parsing; deals with `%f` in `strftime` and `strptime` ([jq#1409](https://github.com/jqlang/jq/issues/1409)), parses timezone offsets with `fromdate` and `fromdateiso8601` ([jq#1053](https://github.com/jqlang/jq/issues/1053)), supports timezone name/offset with `%Z`/`%z` in `strptime` ([jq#929](https://github.com/jqlang/jq/issues/929), [jq#2195](https://github.com/jqlang/jq/issues/2195)), and looks up correct timezone during daylight saving time on formatting with `%Z` ([jq#1912](https://github.com/jqlang/jq/issues/1912)). gojq supports nanoseconds in date and time functions. +- gojq does not support some functions intentionally; `get_jq_origin`, `get_prog_origin`, `get_search_list` (unstable, not listed in jq document), `input_line_number`, `$__loc__` (performance issue). gojq does not support some flags; `--ascii-output, -a` (performance issue), `--seq` (not used commonly), `--sort-keys, -S` (sorts by default because `map[string]any` does not keep the order), `--unbuffered` (unbuffered by default). gojq does not parse JSON extensions supported by jq; `NaN`, `Infinity`, and `[000]`. gojq normalizes floating-point numbers to fit to double-precision floating-point numbers. gojq does not support some regular expression metacharacters, backreferences, look-around assertions, and some flags (regular expression engine differences). gojq does not support BOM (`encoding/json` does not support this). gojq disallows using keywords for function names (`def true: .; true` is a confusing query), and module name prefixes in function declarations (using module prefixes like `def m::f: .;` is undocumented). +- gojq supports reading from YAML input (`--yaml-input`) while jq does not. gojq also supports YAML output (`--yaml-output`). gojq supports `@urid` format string ([jq#798](https://github.com/jqlang/jq/issues/798), [jq#2261](https://github.com/jqlang/jq/issues/2261)). + +### Color configuration +The gojq command automatically disables coloring output when the output is not a tty. +To force coloring output, specify `--color-output` (`-C`) option. +When [`NO_COLOR` environment variable](https://no-color.org/) is present or `--monochrome-output` (`-M`) option is specified, gojq disables coloring output. + +Use `GOJQ_COLORS` environment variable to configure individual colors. +The variable is a colon-separated list of ANSI escape sequences of `null`, `false`, `true`, numbers, strings, object keys, arrays, and objects. +The default configuration is `90:33:33:36:32:34;1`. ## Usage as a library You can use the gojq parser and interpreter from your Go products. @@ -83,7 +108,7 @@ func main() { if err != nil { log.Fatalln(err) } - input := map[string]interface{}{"foo": []interface{}{1, 2, 3}} + input := map[string]any{"foo": []any{1, 2, 3}} iter := query.Run(input) // or query.RunWithContext for { v, ok := iter.Next() @@ -91,6 +116,9 @@ func main() { break } if err, ok := v.(error); ok { + if err, ok := err.(*gojq.HaltError); ok && err.Value() == nil { + break + } log.Fatalln(err) } fmt.Printf("%#v\n", v) @@ -98,25 +126,35 @@ func main() { } ``` -- Firstly, use [`gojq.Parse(string) (*Query, error)`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Parse) to get the query from a string. +- Firstly, use [`gojq.Parse(string) (*Query, error)`](https://pkg.go.dev/github.com/itchyny/gojq#Parse) to get the query from a string. + - Use [`gojq.ParseError`](https://pkg.go.dev/github.com/itchyny/gojq#ParseError) to get the error position and token of the parsing error. - Secondly, get the result iterator - - using [`query.Run`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Query.Run) or [`query.RunWithContext`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Query.RunWithContext) - - or alternatively, compile the query using [`gojq.Compile`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Compile) and then [`code.Run`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Code.Run) or [`code.RunWithContext`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Code.RunWithContext). You can reuse the `*Code` against multiple inputs to avoid compiling the same query. - - In either case, the query input should have type `[]interface{}` for an array and `map[string]interface{}` for a map (just like decoded to an `interface{}` using the [encoding/json](https://golang.org/pkg/encoding/json/) package). You can't use `[]int` or `map[string]string`, for example. -- Thirdly, iterate through the results using [`iter.Next() (interface{}, bool)`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Iter). The iterater can emit an error so make sure to handle it. Termination is notified by the second returned value of `Next()`. - -[`gojq.Compile`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Compile) allows to configure the following compiler options. - -- [`gojq.WithModuleLoader`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#WithModuleLoader) allows to load modules. By default, the module feature is disabled. If you want to load modules from the filesystem, use [`gojq.NewModuleLoader`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#NewModuleLoader). -- [`gojq.WithEnvironLoader`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#WithEnvironLoader) allows to configure the environment variables referenced by `env` and `$ENV`. By default, OS environment variables are not accessible due to security reason. You can use `gojq.WithEnvironLoader(os.Environ)` if you want. -- [`gojq.WithVariables`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#WithVariables) allows to configure the variables which can be used in the query. Pass the values of the variables to [`code.Run`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#Code.Run) in the same order. -- [`gojq.WithInputIter`](https://pkg.go.dev/github.com/itchyny/gojq?tab=doc#WithInputIter) allows to use `input` and `inputs` functions. By default, these functions are disabled. + - using [`query.Run`](https://pkg.go.dev/github.com/itchyny/gojq#Query.Run) or [`query.RunWithContext`](https://pkg.go.dev/github.com/itchyny/gojq#Query.RunWithContext) + - or alternatively, compile the query using [`gojq.Compile`](https://pkg.go.dev/github.com/itchyny/gojq#Compile) and then [`code.Run`](https://pkg.go.dev/github.com/itchyny/gojq#Code.Run) or [`code.RunWithContext`](https://pkg.go.dev/github.com/itchyny/gojq#Code.RunWithContext). You can reuse the `*Code` against multiple inputs to avoid compilation of the same query. But for arguments of `code.Run`, do not give values sharing same data between multiple calls. + - In either case, you cannot use custom type values as the query input. The type should be `[]any` for an array and `map[string]any` for a map (just like decoded to an `any` using the [encoding/json](https://golang.org/pkg/encoding/json/) package). You can't use `[]int` or `map[string]string`, for example. If you want to query your custom struct, marshal to JSON, unmarshal to `any` and use it as the query input. +- Thirdly, iterate through the results using [`iter.Next() (any, bool)`](https://pkg.go.dev/github.com/itchyny/gojq#Iter). The iterator can emit an error so make sure to handle it. The method returns `true` with results, and `false` when the iterator terminates. + - The return type is not `(any, error)` because the iterator may emit multiple errors. The `jq` and `gojq` commands stop the iteration on the first error, but the library user can choose to stop the iteration on errors, or to continue until it terminates. + - In any case, it is recommended to stop the iteration on [`gojq.HaltError`](https://pkg.go.dev/github.com/itchyny/gojq#HaltError), which is emitted by `halt` and `halt_error` functions, although these functions are rarely used. + The error implements [`gojq.ValueError`](https://pkg.go.dev/github.com/itchyny/gojq#ValueError), and if the error value is `nil`, stop the iteration without handling the error. + Technically speaking, we can fix the iterator to terminate on the halting error, but it does not terminate at the moment. + The `halt` function in jq not only stops the iteration, but also terminates the command execution, even if there are still input values. + So, gojq leaves it up to the library user how to handle the halting error. + - Note that the result iterator may emit infinite number of values; `repeat(0)` and `range(infinite)`. It may stuck with no output value; `def f: f; f`. Use `RunWithContext` when you want to limit the execution time. + +[`gojq.Compile`](https://pkg.go.dev/github.com/itchyny/gojq#Compile) allows to configure the following compiler options. + +- [`gojq.WithModuleLoader`](https://pkg.go.dev/github.com/itchyny/gojq#WithModuleLoader) allows to load modules. By default, the module feature is disabled. If you want to load modules from the file system, use [`gojq.NewModuleLoader`](https://pkg.go.dev/github.com/itchyny/gojq#NewModuleLoader). +- [`gojq.WithEnvironLoader`](https://pkg.go.dev/github.com/itchyny/gojq#WithEnvironLoader) allows to configure the environment variables referenced by `env` and `$ENV`. By default, OS environment variables are not accessible due to security reasons. You can use `gojq.WithEnvironLoader(os.Environ)` if you want. +- [`gojq.WithVariables`](https://pkg.go.dev/github.com/itchyny/gojq#WithVariables) allows to configure the variables which can be used in the query. Pass the values of the variables to [`code.Run`](https://pkg.go.dev/github.com/itchyny/gojq#Code.Run) in the same order. +- [`gojq.WithFunction`](https://pkg.go.dev/github.com/itchyny/gojq#WithFunction) allows to add a custom internal function. An internal function can return a single value (which can be an error) each invocation. To add a jq function (which may include a comma operator to emit multiple values, `empty` function, accept a filter for its argument, or call another built-in function), use `LoadInitModules` of the module loader. +- [`gojq.WithIterFunction`](https://pkg.go.dev/github.com/itchyny/gojq#WithIterFunction) allows to add a custom iterator function. An iterator function returns an iterator to emit multiple values. You cannot define both iterator and non-iterator functions of the same name (with possibly different arities). You can use [`gojq.NewIter`](https://pkg.go.dev/github.com/itchyny/gojq#NewIter) to convert values or an error to a [`gojq.Iter`](https://pkg.go.dev/github.com/itchyny/gojq#Iter). +- [`gojq.WithInputIter`](https://pkg.go.dev/github.com/itchyny/gojq#WithInputIter) allows to use `input` and `inputs` functions. By default, these functions are disabled. ## Bug Tracker Report bug at [Issues・itchyny/gojq - GitHub](https://github.com/itchyny/gojq/issues). ## Author -itchyny (https://github.com/itchyny) +itchyny () ## License This software is released under the MIT License, see LICENSE. diff --git a/vendor/github.com/itchyny/gojq/_gojq b/vendor/github.com/itchyny/gojq/_gojq index b4d3184c90..01e4c4f77f 100644 --- a/vendor/github.com/itchyny/gojq/_gojq +++ b/vendor/github.com/itchyny/gojq/_gojq @@ -2,28 +2,42 @@ _gojq() { - _arguments -C \ - '(-c --compact-output)'{-c,--compact-output}'[compact output]' \ - '(-r --raw-output)'{-r,--raw-output}'[output raw strings]' \ - '(-j --join-output)'{-j,--join-output}'[stop printing a newline after each output]' \ - '(-0 --nul-output)'{-0,--nul-output}'[print NUL after each ouput]' \ - '(-C --color-output)'{-C,--color-output}'[colorize output even if piped]' \ - '(-M --monochrome-output)'{-M,--monochrome-output}'[stop colorizing output]' \ - '(--yaml-output)'--yaml-output'[output by YAML]' \ - '(--indent)'--indent'[number of spaces for indentation]' \ + _arguments -s -S \ + '(-r --raw-output --raw-output0 -j --join-output)'{-r,--raw-output}'[output raw strings]' \ + '(-r --raw-output -j --join-output)--raw-output0[implies -r with NUL character delimiter]' \ + '(-r --raw-output --raw-output0 -j --join-output)'{-j,--join-output}'[implies -r with no newline delimiter]' \ + '(-c --compact-output --indent --tab --yaml-output)'{-c,--compact-output}'[output without pretty-printing]' \ + '(-c --compact-output --tab --yaml-output)--indent=[number of spaces for indentation]:indentation count:(2 4 8)' \ + '(-c --compact-output --indent --yaml-output)--tab[use tabs for indentation]' \ + '(-c --compact-output --indent --tab )--yaml-output[output in YAML format]' \ + '(-C --color-output -M --monochrome-output)'{-C,--color-output}'[output with colors even if piped]' \ + '(-C --color-output -M --monochrome-output)'{-M,--monochrome-output}'[output without colors]' \ '(-n --null-input)'{-n,--null-input}'[use null as input value]' \ - '(-R --raw-input)'{-R,--raw-input}'[read input as raw strings]' \ + '(-R --raw-input --stream --yaml-input)'{-R,--raw-input}'[read input as raw strings]' \ + '(-R --raw-input --yaml-input)--stream[parse input in stream fashion]' \ + '(-R --raw-input --stream )--yaml-input[read input as YAML format]' \ '(-s --slurp)'{-s,--slurp}'[read all inputs into an array]' \ - '(--stream)'--stream'[parse input in stream fashon]' \ - '(--yaml-input)'--yaml-input'[read input as YAML]' \ - '(-f --from-file)'{-f,--from-file}'[load query from file]' \ - '(-L)'-L'[directory to search modules from]' \ - '(--arg)'--arg'[set variable to string value]' \ - '(--argjson)'--argjson'[set variable to JSON value]' \ - '(--slurpfile)'--slurpfile'[set variable to the JSON contents of the file]' \ - '(--rawfile)'--rawfile'[set variable to the contents of the file]' \ + '(-f --from-file 1)'{-f,--from-file}'[load query from file]:filename of jq query:_files' \ + '*-L=[directory to search modules from]:module directory:_directories' \ + '*--arg[set a string value to a variable]:variable name: :string value' \ + '*--argjson[set a JSON value to a variable]:variable name: :JSON value' \ + '*--slurpfile[set the JSON contents of a file to a variable]:variable name: :JSON file:_files' \ + '*--rawfile[set the contents of a file to a variable]:variable name: :file:_files' \ + '*--args[consume remaining arguments as positional string values]' \ + '*--jsonargs[consume remaining arguments as positional JSON values]' \ '(-e --exit-status)'{-e,--exit-status}'[exit 1 when the last value is false or null]' \ - '(-v --version)'{-v,--version}'[print version]' \ - '(-h --help)'{-h,--help}'[print help]' \ - && ret=0 + '(- 1 *)'{-v,--version}'[display version information]' \ + '(- 1 *)'{-h,--help}'[display help information]' \ + '1: :_guard "^-([[:alpha:]0]#|-*)" "jq query"' \ + '*: :_gojq_args' +} + +_gojq_args() { + if (($words[(I)--args] > $words[(I)--jsonargs])); then + _message 'string value' + elif (($words[(I)--args] < $words[(I)--jsonargs])); then + _message 'JSON value' + else + _arguments '*:input file:_files' + fi } diff --git a/vendor/github.com/itchyny/gojq/builtin.go b/vendor/github.com/itchyny/gojq/builtin.go index bf82d464f4..7da4a93eae 100644 --- a/vendor/github.com/itchyny/gojq/builtin.go +++ b/vendor/github.com/itchyny/gojq/builtin.go @@ -4,83 +4,66 @@ package gojq func init() { builtinFuncDefs = map[string][]*FuncDef{ - "IN": []*FuncDef{&FuncDef{Name: "IN", Args: []string{"s"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{&Query{Left: &Query{Func: "s"}, Op: OpEq, Right: &Query{Func: "."}}, &Query{Func: "."}}}}}}, &FuncDef{Name: "IN", Args: []string{"src", "s"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{&Query{Left: &Query{Func: "src"}, Op: OpEq, Right: &Query{Func: "s"}}, &Query{Func: "."}}}}}}}, - "INDEX": []*FuncDef{&FuncDef{Name: "INDEX", Args: []string{"stream", "idx_expr"}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "stream"}}, Pattern: &Pattern{Name: "$row"}, Start: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{}}}, Update: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Left: &Query{Func: "$row"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "idx_expr"}, Op: OpPipe, Right: &Query{Func: "tostring"}}}}}}, Op: OpAssign, Right: &Query{Func: "$row"}}}}}}, &FuncDef{Name: "INDEX", Args: []string{"idx_expr"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "INDEX", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, &Query{Func: "idx_expr"}}}}}}}, - "JOIN": []*FuncDef{&FuncDef{Name: "JOIN", Args: []string{"$idx", "idx_expr"}, Body: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$idx"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Func: "idx_expr"}}}}}}}}}}}}}}}, &FuncDef{Name: "JOIN", Args: []string{"$idx", "stream", "idx_expr"}, Body: &Query{Left: &Query{Func: "stream"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$idx"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Func: "idx_expr"}}}}}}}}}}}}, &FuncDef{Name: "JOIN", Args: []string{"$idx", "stream", "idx_expr", "join_expr"}, Body: &Query{Left: &Query{Func: "stream"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$idx"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Func: "idx_expr"}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "join_expr"}}}}}, - "all": []*FuncDef{&FuncDef{Name: "all", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "all", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, &Query{Func: "."}}}}}}, &FuncDef{Name: "all", Args: []string{"y"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "all", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, &Query{Func: "y"}}}}}}, &FuncDef{Name: "all", Args: []string{"g", "y"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "isempty", Args: []*Query{&Query{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "y"}, Op: OpAnd, Right: &Query{Func: "empty"}}}}}}}}}, - "any": []*FuncDef{&FuncDef{Name: "any", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, &Query{Func: "."}}}}}}, &FuncDef{Name: "any", Args: []string{"y"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, &Query{Func: "y"}}}}}}, &FuncDef{Name: "any", Args: []string{"g", "y"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "isempty", Args: []*Query{&Query{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "y"}, Op: OpOr, Right: &Query{Func: "empty"}}}}}}}, Op: OpPipe, Right: &Query{Func: "not"}}}}, - "arrays": []*FuncDef{&FuncDef{Name: "arrays", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}}}}}}}, - "ascii_downcase": []*FuncDef{&FuncDef{Name: "ascii_downcase", Body: &Query{Left: &Query{Func: "explode"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Left: &Query{Term: &Term{Type: TermTypeNumber, Number: "65"}}, Op: OpLe, Right: &Query{Func: "."}}, Op: OpAnd, Right: &Query{Left: &Query{Func: "."}, Op: OpLe, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "90"}}}}, Then: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "32"}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "implode"}}}}}, - "ascii_upcase": []*FuncDef{&FuncDef{Name: "ascii_upcase", Body: &Query{Left: &Query{Func: "explode"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Left: &Query{Term: &Term{Type: TermTypeNumber, Number: "97"}}, Op: OpLe, Right: &Query{Func: "."}}, Op: OpAnd, Right: &Query{Left: &Query{Func: "."}, Op: OpLe, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "122"}}}}, Then: &Query{Left: &Query{Func: "."}, Op: OpSub, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "32"}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "implode"}}}}}, - "assign": []*FuncDef{&FuncDef{Name: "_assign", Args: []string{"ps", "$v"}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{&Query{Func: "ps"}}}}, Pattern: &Pattern{Name: "$p"}, Start: &Query{Func: "."}, Update: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{&Query{Func: "$p"}, &Query{Func: "$v"}}}}}}}}}}, - "booleans": []*FuncDef{&FuncDef{Name: "booleans", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "boolean"}}}}}}}}}}, - "capture": []*FuncDef{&FuncDef{Name: "capture", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "capture", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "null"}}}}}}, &FuncDef{Name: "capture", Args: []string{"$re", "$flags"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "$flags"}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "captures"}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "name"}}}, Op: OpNe, Right: &Query{Func: "null"}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{&ObjectKeyVal{KeyQuery: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "name"}}}, Val: &ObjectVal{Queries: []*Query{&Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}}}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "add"}, Op: OpAlt, Right: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{}}}}}}}}, - "combinations": []*FuncDef{&FuncDef{Name: "combinations", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}, Else: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, SuffixList: []*Suffix{&Suffix{Iter: true}, &Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$x"}}, Body: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}, IsSlice: true}}}, Op: OpPipe, Right: &Query{Func: "combinations"}}, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$y"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "$x"}}}}, Op: OpAdd, Right: &Query{Func: "$y"}}}}}}}}}}}}}}}}, &FuncDef{Name: "combinations", Args: []string{"n"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$dot"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "range", Args: []*Query{&Query{Func: "n"}}}}}, Op: OpPipe, Right: &Query{Func: "$dot"}}}}}, Op: OpPipe, Right: &Query{Func: "combinations"}}}}}}}}}, - "del": []*FuncDef{&FuncDef{Name: "del", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "delpaths", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{&Query{Func: "f"}}}}}}}}}}}}}}, - "endswith": []*FuncDef{&FuncDef{Name: "endswith", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}, Then: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "length"}}}}}}, IsSlice: true}}}, Op: OpEq, Right: &Query{Func: "$x"}}, Else: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_type_error", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "endswith"}}}}}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_type_error", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "endswith"}}}}}}}}}}}}, - "finites": []*FuncDef{&FuncDef{Name: "finites", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Func: "isfinite"}}}}}}}, - "first": []*FuncDef{&FuncDef{Name: "first", Body: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}, &FuncDef{Name: "first", Args: []string{"g"}, Body: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}}}}}}}}, - "flatten": []*FuncDef{&FuncDef{Name: "_flatten", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}, Pattern: &Pattern{Name: "$i"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}, Update: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$i"}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpAnd, Right: &Query{Left: &Query{Func: "$x"}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, Then: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$i"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_flatten", Args: []*Query{&Query{Left: &Query{Func: "$x"}, Op: OpSub, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}}, Else: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "$i"}}}}}}}}}}}}, &FuncDef{Name: "flatten", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$x"}, Op: OpLt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "error", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "flatten depth must not be negative"}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_flatten", Args: []*Query{&Query{Func: "$x"}}}}}}}}}, &FuncDef{Name: "flatten", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_flatten", Args: []*Query{&Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}, - "from_entries": []*FuncDef{&FuncDef{Name: "from_entries", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{&ObjectKeyVal{KeyQuery: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "key"}}}, Op: OpAlt, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "Key"}}}, Op: OpAlt, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "name"}}}, Op: OpAlt, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "Name"}}}}}}, Val: &ObjectVal{Queries: []*Query{&Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "has", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "value"}}}}}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "value"}}}, Else: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "Value"}}}}}}}}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "add"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "."}, Op: OpUpdateAlt, Right: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{}}}}}}}}, - "fromdate": []*FuncDef{&FuncDef{Name: "fromdate", Body: &Query{Func: "fromdateiso8601"}}}, - "fromdateiso8601": []*FuncDef{&FuncDef{Name: "fromdateiso8601", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "strptime", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "%Y-%m-%dT%H:%M:%SZ"}}}}}}}, Op: OpPipe, Right: &Query{Func: "mktime"}}}}, - "fromstream": []*FuncDef{&FuncDef{Name: "fromstream", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{&ObjectKeyVal{Key: "x", Val: &ObjectVal{Queries: []*Query{&Query{Func: "null"}}}}, &ObjectKeyVal{Key: "e", Val: &ObjectVal{Queries: []*Query{&Query{Func: "false"}}}}}}, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$init"}}, Body: &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "f"}}, Pattern: &Pattern{Name: "$i"}, Start: &Query{Func: "$init"}, Update: &Query{Left: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "e"}}}, Then: &Query{Func: "$init"}, Else: &Query{Func: "."}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$i"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "2"}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "e"}}}}}}, &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{&Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "x"}}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}, &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "e"}}}}}}, &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}}}, Extract: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "e"}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "x"}}}, Else: &Query{Func: "empty"}}}}}}}}}}}}}}, - "group_by": []*FuncDef{&FuncDef{Name: "group_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_group_by", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, - "gsub": []*FuncDef{&FuncDef{Name: "gsub", Args: []string{"$re", "str"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sub", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "str"}, &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "g"}}}}}}}}, &FuncDef{Name: "gsub", Args: []string{"$re", "str", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sub", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "str"}, &Query{Left: &Query{Func: "$flags"}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "g"}}}}}}}}}}, - "in": []*FuncDef{&FuncDef{Name: "in", Args: []string{"xs"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$x"}}, Body: &Query{Left: &Query{Func: "xs"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "has", Args: []*Query{&Query{Func: "$x"}}}}}}}}}}}}}, - "index": []*FuncDef{&FuncDef{Name: "index", Args: []string{"$x"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "indices", Args: []*Query{&Query{Func: "$x"}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}, - "indices": []*FuncDef{&FuncDef{Name: "indices", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpAnd, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "type"}}}}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Func: "$x"}}}}, Elif: []*IfElif{&IfElif{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "$x"}}}}}}}}, &IfElif{Cond: &Query{Left: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}, Op: OpAnd, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "type"}}}}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}, Then: &Query{Left: &Query{Func: "explode"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "explode"}}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Func: "$x"}}}}}}}}}, - "inputs": []*FuncDef{&FuncDef{Name: "inputs", Body: &Query{Term: &Term{Type: TermTypeTry, Try: &Try{Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "repeat", Args: []*Query{&Query{Func: "input"}}}}}, Catch: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "break"}}}}, Then: &Query{Func: "empty"}, Else: &Query{Func: "error"}}}}}}}}}, - "inside": []*FuncDef{&FuncDef{Name: "inside", Args: []string{"xs"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$x"}}, Body: &Query{Left: &Query{Func: "xs"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "contains", Args: []*Query{&Query{Func: "$x"}}}}}}}}}}}}}, - "isempty": []*FuncDef{&FuncDef{Name: "isempty", Args: []string{"g"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "first", Args: []*Query{&Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Func: "false"}}}}, Op: OpComma, Right: &Query{Func: "true"}}}}}}}}, - "iterables": []*FuncDef{&FuncDef{Name: "iterables", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpOr, Right: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}}}}}, - "join": []*FuncDef{&FuncDef{Name: "join", Args: []string{"$x"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}, Pattern: &Pattern{Name: "$i"}, Start: &Query{Func: "null"}, Update: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Func: "null"}}, Then: &Query{Term: &Term{Type: TermTypeString, Str: &String{}}}, Else: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Func: "$x"}}}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$i"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "boolean"}}}}, Op: OpOr, Right: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "number"}}}}}, Then: &Query{Func: "tostring"}, Else: &Query{Left: &Query{Func: "."}, Op: OpAlt, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{}}}}}}}}}}}}}}, Op: OpAlt, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{}}}}}}, - "last": []*FuncDef{&FuncDef{Name: "last", Body: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}, &FuncDef{Name: "last", Args: []string{"g"}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "g"}}, Pattern: &Pattern{Name: "$item"}, Start: &Query{Func: "null"}, Update: &Query{Func: "$item"}}}}}}, - "leaf_paths": []*FuncDef{&FuncDef{Name: "leaf_paths", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "paths", Args: []*Query{&Query{Func: "scalars"}}}}}}}, - "limit": []*FuncDef{&FuncDef{Name: "limit", Args: []string{"$n", "g"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$n"}, Op: OpGt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "g"}}, Pattern: &Pattern{Name: "$item"}, Start: &Query{Func: "$n"}, Update: &Query{Left: &Query{Func: "."}, Op: OpSub, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}, Extract: &Query{Left: &Query{Func: "$item"}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpLe, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}, Else: &Query{Func: "empty"}}}}}}}}}}}, Elif: []*IfElif{&IfElif{Cond: &Query{Left: &Query{Func: "$n"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Func: "empty"}}}, Else: &Query{Func: "g"}}}}}}, - "ltrimstr": []*FuncDef{&FuncDef{Name: "ltrimstr", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Left: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}, Op: OpAnd, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}}}}, Op: OpAnd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "startswith", Args: []*Query{&Query{Func: "$x"}}}}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "length"}}, IsSlice: true}}}}}}}}, - "map": []*FuncDef{&FuncDef{Name: "map", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Op: OpPipe, Right: &Query{Func: "f"}}}}}}}, - "map_values": []*FuncDef{&FuncDef{Name: "map_values", Args: []string{"f"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Op: OpModify, Right: &Query{Func: "f"}}}}, - "match": []*FuncDef{&FuncDef{Name: "match", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "null"}}}}}}, &FuncDef{Name: "match", Args: []string{"$re", "$flags"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_match", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "$flags"}, &Query{Func: "false"}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}}}}, - "max": []*FuncDef{&FuncDef{Name: "max", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "max_by", Args: []*Query{&Query{Func: "."}}}}}}}, - "max_by": []*FuncDef{&FuncDef{Name: "max_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_max_by", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, - "min": []*FuncDef{&FuncDef{Name: "min", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "min_by", Args: []*Query{&Query{Func: "."}}}}}}}, - "min_by": []*FuncDef{&FuncDef{Name: "min_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_min_by", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, - "modify": []*FuncDef{&FuncDef{Name: "_modify", Args: []string{"ps", "f"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{&Query{Func: "ps"}}}}, Pattern: &Pattern{Name: "$p"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}}}}}, Update: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, Op: OpAdd, Right: &Query{Func: "$p"}}, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$q"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{&Query{Func: "$q"}, &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "getpath", Args: []*Query{&Query{Func: "$q"}}}}}, Op: OpPipe, Right: &Query{Func: "f"}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}}}}}}}}}}, Op: OpComma, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}, Op: OpUpdateAdd, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "$p"}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$x"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$x"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "delpaths", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$x"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}}}}}}}}}}}, - "normals": []*FuncDef{&FuncDef{Name: "normals", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Func: "isnormal"}}}}}}}, - "not": []*FuncDef{&FuncDef{Name: "not", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "."}, Then: &Query{Func: "false"}, Else: &Query{Func: "true"}}}}}}, - "nth": []*FuncDef{&FuncDef{Name: "nth", Args: []string{"$n"}, Body: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Func: "$n"}}}}}, &FuncDef{Name: "nth", Args: []string{"$n", "g"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$n"}, Op: OpLt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "error", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "nth doesn't support negative indices"}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "g"}}, Pattern: &Pattern{Name: "$item"}, Start: &Query{Func: "$n"}, Update: &Query{Left: &Query{Func: "."}, Op: OpSub, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}, Extract: &Query{Left: &Query{Left: &Query{Left: &Query{Func: "."}, Op: OpLt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Op: OpOr, Right: &Query{Func: "empty"}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "$item"}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}}}}}}}}}}}}}}, - "nulls": []*FuncDef{&FuncDef{Name: "nulls", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Func: "null"}}}}}}}}, - "numbers": []*FuncDef{&FuncDef{Name: "numbers", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "number"}}}}}}}}}}, - "objects": []*FuncDef{&FuncDef{Name: "objects", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}}}, - "paths": []*FuncDef{&FuncDef{Name: "paths", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "recurse", Args: []*Query{&Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "type"}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpOr, Right: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}, Then: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Else: &Query{Func: "empty"}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "length"}, Op: OpGt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}}, &FuncDef{Name: "paths", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$x"}}, Body: &Query{Left: &Query{Func: "paths"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$p"}}, Body: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "getpath", Args: []*Query{&Query{Func: "$p"}}}}}, Op: OpPipe, Right: &Query{Func: "f"}}}}}}}}}}}}}}}}}}}}, - "range": []*FuncDef{&FuncDef{Name: "range", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "range", Args: []*Query{&Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}, &Query{Func: "$x"}}}}}}, &FuncDef{Name: "range", Args: []string{"$start", "$end"}, Body: &Query{Left: &Query{Func: "$start"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "while", Args: []*Query{&Query{Left: &Query{Func: "."}, Op: OpLt, Right: &Query{Func: "$end"}}, &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}, &FuncDef{Name: "range", Args: []string{"$start", "$end", "$step"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$step"}, Op: OpGt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Left: &Query{Func: "$start"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "while", Args: []*Query{&Query{Left: &Query{Func: "."}, Op: OpLt, Right: &Query{Func: "$end"}}, &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Func: "$step"}}}}}}}, Elif: []*IfElif{&IfElif{Cond: &Query{Left: &Query{Func: "$step"}, Op: OpLt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Left: &Query{Func: "$start"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "while", Args: []*Query{&Query{Left: &Query{Func: "."}, Op: OpGt, Right: &Query{Func: "$end"}}, &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Func: "$step"}}}}}}}}}, Else: &Query{Func: "empty"}}}}}}, - "recurse": []*FuncDef{&FuncDef{Name: "recurse", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "recurse", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}, &Suffix{Optional: true}}}}}}}}}, &FuncDef{Name: "recurse", Args: []string{"f"}, Body: &Query{FuncDefs: []*FuncDef{&FuncDef{Name: "r", Body: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Func: "r"}}}}}}}, Func: "r"}}, &FuncDef{Name: "recurse", Args: []string{"f", "cond"}, Body: &Query{FuncDefs: []*FuncDef{&FuncDef{Name: "r", Body: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Func: "cond"}}}}}, Op: OpPipe, Right: &Query{Func: "r"}}}}}}}}, Func: "r"}}}, - "repeat": []*FuncDef{&FuncDef{Name: "repeat", Args: []string{"f"}, Body: &Query{FuncDefs: []*FuncDef{&FuncDef{Name: "_repeat", Body: &Query{Left: &Query{Func: "f"}, Op: OpComma, Right: &Query{Func: "_repeat"}}}}, Func: "_repeat"}}}, - "rindex": []*FuncDef{&FuncDef{Name: "rindex", Args: []string{"$x"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "indices", Args: []*Query{&Query{Func: "$x"}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeNumber, Number: "1"}}}}, IsSlice: true}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}}}, - "rtrimstr": []*FuncDef{&FuncDef{Name: "rtrimstr", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Left: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}, Op: OpAnd, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}}}}, Op: OpAnd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "endswith", Args: []*Query{&Query{Func: "$x"}}}}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{End: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "length"}}}}}}}}}}}}}}, - "scalars": []*FuncDef{&FuncDef{Name: "scalars", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpAnd, Right: &Query{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}}}}}, - "scan": []*FuncDef{&FuncDef{Name: "scan", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "scan", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "null"}}}}}}, &FuncDef{Name: "scan", Args: []string{"$re", "$flags"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{&Query{Func: "$re"}, &Query{Left: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "g"}}}, Op: OpAdd, Right: &Query{Func: "$flags"}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "captures"}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpGt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}, Then: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "captures"}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}}}}}}}, - "select": []*FuncDef{&FuncDef{Name: "select", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "f"}, Then: &Query{Func: "."}, Else: &Query{Func: "empty"}}}}}}, - "sort": []*FuncDef{&FuncDef{Name: "sort", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sort_by", Args: []*Query{&Query{Func: "."}}}}}}}, - "sort_by": []*FuncDef{&FuncDef{Name: "sort_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_sort_by", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, - "splits": []*FuncDef{&FuncDef{Name: "splits", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "splits", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "null"}}}}}}, &FuncDef{Name: "splits", Args: []string{"$re", "$flags"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "split", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "$flags"}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}}}}, - "startswith": []*FuncDef{&FuncDef{Name: "startswith", Args: []string{"$x"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}, Then: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{End: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Func: "length"}}}}}, Op: OpEq, Right: &Query{Func: "$x"}}, Else: &Query{Left: &Query{Func: "$x"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_type_error", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "startswith"}}}}}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_type_error", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "startswith"}}}}}}}}}}}}, - "strings": []*FuncDef{&FuncDef{Name: "strings", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}}}}}}, - "sub": []*FuncDef{&FuncDef{Name: "sub", Args: []string{"$re", "str"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sub", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "str"}, &Query{Func: "null"}}}}}}, &FuncDef{Name: "sub", Args: []string{"$re", "str", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$in"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "$flags"}}}}, Pattern: &Pattern{Name: "$r"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeString, Str: &String{}}}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}, Update: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$x"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "$r"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "captures"}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "name"}}}, Op: OpNe, Right: &Query{Func: "null"}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{&ObjectKeyVal{KeyQuery: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "name"}}}, Val: &ObjectVal{Queries: []*Query{&Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}}}}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "add"}, Op: OpAlt, Right: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Left: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$x"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$in"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$x"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}, IsSlice: true, End: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$r"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Name: "offset"}}}}}}}}}}}, Op: OpAdd, Right: &Query{Func: "str"}}, Op: OpComma, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$r"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Name: "offset"}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$r"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Name: "length"}}}}}}}}}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$in"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}, IsSlice: true}}}}}}}}}}}}}}, - "test": []*FuncDef{&FuncDef{Name: "test", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "test", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "null"}}}}}}, &FuncDef{Name: "test", Args: []string{"$re", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_match", Args: []*Query{&Query{Func: "$re"}, &Query{Func: "$flags"}, &Query{Func: "true"}}}}}}}, - "to_entries": []*FuncDef{&FuncDef{Name: "to_entries", Body: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "keys"}, SuffixList: []*Suffix{&Suffix{Iter: true}, &Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$k"}}, Body: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{&ObjectKeyVal{Key: "key", Val: &ObjectVal{Queries: []*Query{&Query{Func: "$k"}}}}, &ObjectKeyVal{Key: "value", Val: &ObjectVal{Queries: []*Query{&Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Func: "$k"}}}}}}}}}}}}}}}}}}}}}, - "todate": []*FuncDef{&FuncDef{Name: "todate", Body: &Query{Func: "todateiso8601"}}}, - "todateiso8601": []*FuncDef{&FuncDef{Name: "todateiso8601", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "strftime", Args: []*Query{&Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "%Y-%m-%dT%H:%M:%SZ"}}}}}}}}}, - "tostream": []*FuncDef{&FuncDef{Name: "tostream", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{&Query{FuncDefs: []*FuncDef{&FuncDef{Name: "r", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}, &Suffix{Optional: true}}}}, Op: OpPipe, Right: &Query{Func: "r"}}}}, Op: OpComma, Right: &Query{Func: "."}}}}, Func: "r"}}}, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$p"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "getpath", Args: []*Query{&Query{Func: "$p"}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{&Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Iter: true}, &Suffix{Optional: true}}}}}}}, Pattern: &Pattern{Name: "$q"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "$p"}, Op: OpComma, Right: &Query{Func: "."}}}}}, Update: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "$p"}, Op: OpAdd, Right: &Query{Func: "$q"}}}}}}}}}}}}}}}}, - "transpose": []*FuncDef{&FuncDef{Name: "transpose", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}}, Then: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}, Else: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$in"}}, Body: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Func: "length"}}}}}, Op: OpPipe, Right: &Query{Func: "max"}}, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$max"}}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "length"}, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$length"}}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "range", Args: []*Query{&Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}, &Query{Func: "$max"}}}}, Pattern: &Pattern{Name: "$j"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}, Update: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "range", Args: []*Query{&Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}, &Query{Func: "$length"}}}}, Pattern: &Pattern{Name: "$i"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}, Update: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$in"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Func: "$i"}}}, &Suffix{Index: &Index{Start: &Query{Func: "$j"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}, - "truncate_stream": []*FuncDef{&FuncDef{Name: "truncate_stream", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$n"}}, Body: &Query{Left: &Query{Func: "null"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$input"}}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, Op: OpPipe, Right: &Query{Func: "length"}}}}, Op: OpGt, Right: &Query{Func: "$n"}}, Then: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$input"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}, &Suffix{Index: &Index{Start: &Query{Func: "$n"}, IsSlice: true}}}}}}}}}, Else: &Query{Func: "empty"}}}}}}}}}}}}}}}}}}, - "unique": []*FuncDef{&FuncDef{Name: "unique", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "unique_by", Args: []*Query{&Query{Func: "."}}}}}}}, - "unique_by": []*FuncDef{&FuncDef{Name: "unique_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_unique_by", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, - "until": []*FuncDef{&FuncDef{Name: "until", Args: []string{"cond", "next"}, Body: &Query{FuncDefs: []*FuncDef{&FuncDef{Name: "_until", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "cond"}, Then: &Query{Func: "."}, Else: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "next"}, Op: OpPipe, Right: &Query{Func: "_until"}}}}}}}}}, Func: "_until"}}}, - "values": []*FuncDef{&FuncDef{Name: "values", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{&Query{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Func: "null"}}}}}}}}, - "walk": []*FuncDef{&FuncDef{Name: "walk", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{&Suffix{Bind: &Bind{Patterns: []*Pattern{&Pattern{Name: "$in"}}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "keys"}, SuffixList: []*Suffix{&Suffix{Iter: true}}}, Pattern: &Pattern{Name: "$key"}, Start: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{}}}, Update: &Query{Left: &Query{Func: "."}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{&ObjectKeyVal{KeyQuery: &Query{Func: "$key"}, Val: &ObjectVal{Queries: []*Query{&Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$in"}, SuffixList: []*Suffix{&Suffix{Index: &Index{Start: &Query{Func: "$key"}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "walk", Args: []*Query{&Query{Func: "f"}}}}}}}}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "f"}}, Elif: []*IfElif{&IfElif{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "walk", Args: []*Query{&Query{Func: "f"}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "f"}}}}, Else: &Query{Func: "f"}}}}}}}}}}}, - "while": []*FuncDef{&FuncDef{Name: "while", Args: []string{"cond", "update"}, Body: &Query{FuncDefs: []*FuncDef{&FuncDef{Name: "_while", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "cond"}, Then: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "update"}, Op: OpPipe, Right: &Query{Func: "_while"}}}}}, Else: &Query{Func: "empty"}}}}}}, Func: "_while"}}}, - "with_entries": []*FuncDef{&FuncDef{Name: "with_entries", Args: []string{"f"}, Body: &Query{Left: &Query{Func: "to_entries"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{&Query{Func: "f"}}}}}, Op: OpPipe, Right: &Query{Func: "from_entries"}}}}}, + "IN": {{Name: "IN", Args: []string{"s"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{{Left: &Query{Func: "s"}, Op: OpEq, Right: &Query{Func: "."}}, {Func: "."}}}}}}, {Name: "IN", Args: []string{"src", "s"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{{Left: &Query{Func: "src"}, Op: OpEq, Right: &Query{Func: "s"}}, {Func: "."}}}}}}}, + "INDEX": {{Name: "INDEX", Args: []string{"stream", "idx_expr"}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "stream"}}, Pattern: &Pattern{Name: "$row"}, Start: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{}}}, Update: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Left: &Query{Func: "$row"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "idx_expr"}, Op: OpPipe, Right: &Query{Func: "tostring"}}}}}}, Op: OpAssign, Right: &Query{Func: "$row"}}}}}}, {Name: "INDEX", Args: []string{"idx_expr"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "INDEX", Args: []*Query{{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}}, {Func: "idx_expr"}}}}}}}, + "JOIN": {{Name: "JOIN", Args: []string{"$idx", "idx_expr"}, Body: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$idx"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Func: "idx_expr"}}}}}}}}}}}}}}}, {Name: "JOIN", Args: []string{"$idx", "stream", "idx_expr"}, Body: &Query{Left: &Query{Func: "stream"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$idx"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Func: "idx_expr"}}}}}}}}}}}}, {Name: "JOIN", Args: []string{"$idx", "stream", "idx_expr", "join_expr"}, Body: &Query{Left: &Query{Func: "stream"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$idx"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Func: "idx_expr"}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "join_expr"}}}}}, + "_assign": {}, + "_modify": {}, + "all": {{Name: "all", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "all", Args: []*Query{{Func: "."}}}}}}, {Name: "all", Args: []string{"y"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "all", Args: []*Query{{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}}, {Func: "y"}}}}}}, {Name: "all", Args: []string{"g", "y"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "isempty", Args: []*Query{{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "y"}, Op: OpPipe, Right: &Query{Func: "not"}}}}}}}}}}}}}, + "any": {{Name: "any", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{{Func: "."}}}}}}, {Name: "any", Args: []string{"y"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "any", Args: []*Query{{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}}, {Func: "y"}}}}}}, {Name: "any", Args: []string{"g", "y"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "isempty", Args: []*Query{{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Func: "y"}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "not"}}}}, + "arrays": {{Name: "arrays", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}}}}}}}, + "booleans": {{Name: "booleans", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "boolean"}}}}}}}}}}, + "capture": {{Name: "capture", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "capture", Args: []*Query{{Func: "$re"}, {Func: "null"}}}}}}, {Name: "capture", Args: []string{"$re", "$flags"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{{Func: "$re"}, {Func: "$flags"}}}}}, Op: OpPipe, Right: &Query{Func: "_capture"}}}}, + "combinations": {{Name: "combinations", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}, Else: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, SuffixList: []*Suffix{{Iter: true}, {Bind: &Bind{Patterns: []*Pattern{{Name: "$x"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "$x"}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}, IsSlice: true}}}, Op: OpPipe, Right: &Query{Func: "combinations"}}}}}}}}}}}}}}, {Name: "combinations", Args: []string{"n"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "limit", Args: []*Query{{Func: "n"}, {Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "repeat", Args: []*Query{{Func: "."}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "combinations"}}}}, + "debug": {{Name: "debug", Args: []string{"f"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "debug"}, Op: OpPipe, Right: &Query{Func: "empty"}}}}}, Op: OpComma, Right: &Query{Func: "."}}}}, + "del": {{Name: "del", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "delpaths", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{{Func: "f"}}}}}}}}}}}}}}, + "finites": {{Name: "finites", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Func: "isfinite"}}}}}}}, + "first": {{Name: "first", Body: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}, {Name: "first", Args: []string{"g"}, Body: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}}}}}}}}, + "fromdate": {{Name: "fromdate", Body: &Query{Func: "fromdateiso8601"}}}, + "fromdateiso8601": {{Name: "fromdateiso8601", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "strptime", Args: []*Query{{Term: &Term{Type: TermTypeString, Str: &String{Str: "%Y-%m-%dT%H:%M:%S%z"}}}}}}}, Op: OpPipe, Right: &Query{Func: "mktime"}}}}, + "fromstream": {{Name: "fromstream", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{{Key: "x", Val: &ObjectVal{Queries: []*Query{{Func: "null"}}}}, {Key: "e", Val: &ObjectVal{Queries: []*Query{{Func: "false"}}}}}}, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$init"}}, Body: &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "f"}}, Pattern: &Pattern{Name: "$i"}, Start: &Query{Func: "$init"}, Update: &Query{Left: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "e"}}}, Then: &Query{Func: "$init"}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$i"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "2"}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "e"}}}}}}, {Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{{Left: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "x"}}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}}, {Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "e"}}}}}}, {Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$i"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}}}}}, Extract: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "e"}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "x"}}}, Else: &Query{Func: "empty"}}}}}}}}}}}}}}, + "group_by": {{Name: "group_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_group_by", Args: []*Query{{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, + "gsub": {{Name: "gsub", Args: []string{"$re", "str"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sub", Args: []*Query{{Func: "$re"}, {Func: "str"}, {Term: &Term{Type: TermTypeString, Str: &String{Str: "g"}}}}}}}}, {Name: "gsub", Args: []string{"$re", "str", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sub", Args: []*Query{{Func: "$re"}, {Func: "str"}, {Left: &Query{Func: "$flags"}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "g"}}}}}}}}}}, + "in": {{Name: "in", Args: []string{"xs"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$x"}}, Body: &Query{Left: &Query{Func: "xs"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "has", Args: []*Query{{Func: "$x"}}}}}}}}}}}}}, + "inputs": {{Name: "inputs", Body: &Query{Term: &Term{Type: TermTypeTry, Try: &Try{Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "repeat", Args: []*Query{{Func: "input"}}}}}, Catch: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "break"}}}}, Then: &Query{Func: "empty"}, Else: &Query{Func: "error"}}}}}}}}}, + "inside": {{Name: "inside", Args: []string{"xs"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$x"}}, Body: &Query{Left: &Query{Func: "xs"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "contains", Args: []*Query{{Func: "$x"}}}}}}}}}}}}}, + "isempty": {{Name: "isempty", Args: []string{"g"}, Body: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "g"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "false"}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}}}}}, Op: OpComma, Right: &Query{Func: "true"}}}}}}}, + "iterables": {{Name: "iterables", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpOr, Right: &Query{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}}}}}, + "last": {{Name: "last", Body: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}}, {Name: "last", Args: []string{"g"}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "g"}}, Pattern: &Pattern{Name: "$item"}, Start: &Query{Func: "null"}, Update: &Query{Func: "$item"}}}}}}, + "limit": {{Name: "limit", Args: []string{"$n", "g"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$n"}, Op: OpGt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "g"}}, Pattern: &Pattern{Name: "$item"}, Start: &Query{Func: "$n"}, Update: &Query{Left: &Query{Func: "."}, Op: OpSub, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}, Extract: &Query{Left: &Query{Func: "$item"}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpLe, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}, Else: &Query{Func: "empty"}}}}}}}}}}}, Elif: []*IfElif{{Cond: &Query{Left: &Query{Func: "$n"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Func: "empty"}}}, Else: &Query{Func: "g"}}}}}}, + "map": {{Name: "map", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}}, Op: OpPipe, Right: &Query{Func: "f"}}}}}}}, + "map_values": {{Name: "map_values", Args: []string{"f"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}}, Op: OpModify, Right: &Query{Func: "f"}}}}, + "match": {{Name: "match", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{{Func: "$re"}, {Func: "null"}}}}}}, {Name: "match", Args: []string{"$re", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_match", Args: []*Query{{Func: "$re"}, {Func: "$flags"}, {Func: "false"}}}, SuffixList: []*Suffix{{Iter: true}}}}}}, + "max_by": {{Name: "max_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_max_by", Args: []*Query{{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, + "min_by": {{Name: "min_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_min_by", Args: []*Query{{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, + "normals": {{Name: "normals", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Func: "isnormal"}}}}}}}, + "not": {{Name: "not", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "."}, Then: &Query{Func: "false"}, Else: &Query{Func: "true"}}}}}}, + "nth": {{Name: "nth", Args: []string{"$n"}, Body: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Func: "$n"}}}}}, {Name: "nth", Args: []string{"$n", "g"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "$n"}, Op: OpLt, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "error", Args: []*Query{{Term: &Term{Type: TermTypeString, Str: &String{Str: "nth doesn't support negative indices"}}}}}}}, Else: &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{Ident: "$out", Body: &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "g"}}, Pattern: &Pattern{Name: "$item"}, Start: &Query{Left: &Query{Func: "$n"}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}, Update: &Query{Left: &Query{Func: "."}, Op: OpSub, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "1"}}}, Extract: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "."}, Op: OpLe, Right: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}, Then: &Query{Left: &Query{Func: "$item"}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeBreak, Break: "$out"}}}, Else: &Query{Func: "empty"}}}}}}}}}}}}}}}, + "nulls": {{Name: "nulls", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "."}, Op: OpEq, Right: &Query{Func: "null"}}}}}}}}, + "numbers": {{Name: "numbers", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "number"}}}}}}}}}}, + "objects": {{Name: "objects", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}}}, + "paths": {{Name: "paths", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{{Func: ".."}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}}}}}}}}, {Name: "paths", Args: []string{"f"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{{Left: &Query{Func: ".."}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Func: "f"}}}}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}}}}}}}}}, + "pick": {{Name: "pick", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$v"}}, Body: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{{Func: "f"}}}}, Pattern: &Pattern{Name: "$p"}, Start: &Query{Func: "null"}, Update: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "setpath", Args: []*Query{{Func: "$p"}, {Left: &Query{Func: "$v"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "getpath", Args: []*Query{{Func: "$p"}}}}}}}}}}}}}}}}}}}}, + "range": {{Name: "range", Args: []string{"$end"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_range", Args: []*Query{{Term: &Term{Type: TermTypeNumber, Number: "0"}}, {Func: "$end"}, {Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}, {Name: "range", Args: []string{"$start", "$end"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_range", Args: []*Query{{Func: "$start"}, {Func: "$end"}, {Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}}, {Name: "range", Args: []string{"$start", "$end", "$step"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_range", Args: []*Query{{Func: "$start"}, {Func: "$end"}, {Func: "$step"}}}}}}}, + "recurse": {{Name: "recurse", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "recurse", Args: []*Query{{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}, {Optional: true}}}}}}}}}, {Name: "recurse", Args: []string{"f"}, Body: &Query{FuncDefs: []*FuncDef{{Name: "r", Body: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Func: "r"}}}}}}}, Func: "r"}}, {Name: "recurse", Args: []string{"f", "cond"}, Body: &Query{FuncDefs: []*FuncDef{{Name: "r", Body: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Func: "cond"}}}}}, Op: OpPipe, Right: &Query{Func: "r"}}}}}}}}, Func: "r"}}}, + "repeat": {{Name: "repeat", Args: []string{"f"}, Body: &Query{FuncDefs: []*FuncDef{{Name: "_repeat", Body: &Query{Left: &Query{Func: "f"}, Op: OpComma, Right: &Query{Func: "_repeat"}}}}, Func: "_repeat"}}}, + "scalars": {{Name: "scalars", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpPipe, Right: &Query{Left: &Query{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Op: OpAnd, Right: &Query{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}}}}}}}}}, + "scan": {{Name: "scan", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "scan", Args: []*Query{{Func: "$re"}, {Func: "null"}}}}}}, {Name: "scan", Args: []string{"$re", "$flags"}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{{Func: "$re"}, {Left: &Query{Func: "$flags"}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "g"}}}}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "captures"}}}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}}, Then: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}, Else: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "captures"}, SuffixList: []*Suffix{{Iter: true}, {Index: &Index{Name: "string"}}}}}}}}}}}}}}, + "select": {{Name: "select", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "f"}, Then: &Query{Func: "."}, Else: &Query{Func: "empty"}}}}}}, + "sort_by": {{Name: "sort_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_sort_by", Args: []*Query{{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, + "splits": {{Name: "splits", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "splits", Args: []*Query{{Func: "$re"}, {Func: "null"}}}}}}, {Name: "splits", Args: []string{"$re", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "split", Args: []*Query{{Func: "$re"}, {Func: "$flags"}}}, SuffixList: []*Suffix{{Iter: true}}}}}}, + "strings": {{Name: "strings", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "string"}}}}}}}}}}, + "sub": {{Name: "sub", Args: []string{"$re", "str"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "sub", Args: []*Query{{Func: "$re"}, {Func: "str"}, {Func: "null"}}}}}}, {Name: "sub", Args: []string{"$re", "str", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$str"}}, Body: &Query{FuncDefs: []*FuncDef{{Name: "_sub", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "matches"}}}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{}}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$str"}, SuffixList: []*Suffix{{Index: &Index{End: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "offset"}}}, IsSlice: true}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}}, Else: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "matches"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeNumber, Number: "1"}}}}}}, {Bind: &Bind{Patterns: []*Pattern{{Name: "$r"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{{Key: "string", Val: &ObjectVal{Queries: []*Query{{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "$r"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "_capture"}, Op: OpPipe, Right: &Query{Func: "str"}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$str"}, SuffixList: []*Suffix{{Index: &Index{Start: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$r"}, SuffixList: []*Suffix{{Index: &Index{Name: "offset"}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$r"}, SuffixList: []*Suffix{{Index: &Index{Name: "length"}}}}}}, End: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "offset"}}}, IsSlice: true}}}}}}, Op: OpAdd, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "string"}}}}}}}}}, {Key: "offset", Val: &ObjectVal{Queries: []*Query{{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "$r"}, SuffixList: []*Suffix{{Index: &Index{Name: "offset"}}}}}}}}, {Key: "matches", Val: &ObjectVal{Queries: []*Query{{Term: &Term{Type: TermTypeIndex, Index: &Index{Name: "matches"}, SuffixList: []*Suffix{{Index: &Index{End: &Query{Term: &Term{Type: TermTypeUnary, Unary: &Unary{Op: OpSub, Term: &Term{Type: TermTypeNumber, Number: "1"}}}}, IsSlice: true}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "_sub"}}}}}}}}}}}}, Left: &Query{Term: &Term{Type: TermTypeObject, Object: &Object{KeyVals: []*ObjectKeyVal{{Key: "string", Val: &ObjectVal{Queries: []*Query{{Term: &Term{Type: TermTypeString, Str: &String{}}}}}}, {Key: "matches", Val: &ObjectVal{Queries: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "match", Args: []*Query{{Func: "$re"}, {Func: "$flags"}}}}}}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "_sub"}}}}}}}}}, + "test": {{Name: "test", Args: []string{"$re"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "test", Args: []*Query{{Func: "$re"}, {Func: "null"}}}}}}, {Name: "test", Args: []string{"$re", "$flags"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_match", Args: []*Query{{Func: "$re"}, {Func: "$flags"}, {Func: "true"}}}}}}}, + "todate": {{Name: "todate", Body: &Query{Func: "todateiso8601"}}}, + "todateiso8601": {{Name: "todateiso8601", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "strftime", Args: []*Query{{Term: &Term{Type: TermTypeString, Str: &String{Str: "%Y-%m-%dT%H:%M:%SZ"}}}}}}}}}, + "tostream": {{Name: "tostream", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{{FuncDefs: []*FuncDef{{Name: "r", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}, {Optional: true}}}}, Op: OpPipe, Right: &Query{Func: "r"}}}}, Op: OpComma, Right: &Query{Func: "."}}}}, Func: "r"}}}, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$p"}}, Body: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "getpath", Args: []*Query{{Func: "$p"}}}}}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "path", Args: []*Query{{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}, {Optional: true}}}}}}}, Pattern: &Pattern{Name: "$q"}, Start: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "$p"}, Op: OpComma, Right: &Query{Func: "."}}}}}, Update: &Query{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Left: &Query{Func: "$p"}, Op: OpAdd, Right: &Query{Func: "$q"}}}}}}}}}}}}}}}}, + "truncate_stream": {{Name: "truncate_stream", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Bind: &Bind{Patterns: []*Pattern{{Name: "$n"}}, Body: &Query{Left: &Query{Func: "null"}, Op: OpPipe, Right: &Query{Left: &Query{Func: "f"}, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, Op: OpPipe, Right: &Query{Left: &Query{Func: "length"}, Op: OpGt, Right: &Query{Func: "$n"}}}, Then: &Query{Left: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Term: &Term{Type: TermTypeNumber, Number: "0"}}}}}, Op: OpModify, Right: &Query{Term: &Term{Type: TermTypeIndex, Index: &Index{Start: &Query{Func: "$n"}, IsSlice: true}}}}, Else: &Query{Func: "empty"}}}}}}}}}}}}}, + "unique_by": {{Name: "unique_by", Args: []string{"f"}, Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "_unique_by", Args: []*Query{{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Term: &Term{Type: TermTypeArray, Array: &Array{Query: &Query{Func: "f"}}}}}}}}}}}}}}, + "until": {{Name: "until", Args: []string{"cond", "next"}, Body: &Query{FuncDefs: []*FuncDef{{Name: "_until", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "cond"}, Then: &Query{Func: "."}, Else: &Query{Left: &Query{Func: "next"}, Op: OpPipe, Right: &Query{Func: "_until"}}}}}}}, Func: "_until"}}}, + "values": {{Name: "values", Body: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "select", Args: []*Query{{Left: &Query{Func: "."}, Op: OpNe, Right: &Query{Func: "null"}}}}}}}}, + "walk": {{Name: "walk", Args: []string{"f"}, Body: &Query{FuncDefs: []*FuncDef{{Name: "_walk", Body: &Query{Left: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "array"}}}}, Then: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Func: "_walk"}}}}}, Elif: []*IfElif{{Cond: &Query{Left: &Query{Func: "type"}, Op: OpEq, Right: &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: "object"}}}}, Then: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map_values", Args: []*Query{{Func: "_walk"}}}}}}}}}}, Op: OpPipe, Right: &Query{Func: "f"}}}}, Func: "_walk"}}}, + "while": {{Name: "while", Args: []string{"cond", "update"}, Body: &Query{FuncDefs: []*FuncDef{{Name: "_while", Body: &Query{Term: &Term{Type: TermTypeIf, If: &If{Cond: &Query{Func: "cond"}, Then: &Query{Left: &Query{Func: "."}, Op: OpComma, Right: &Query{Term: &Term{Type: TermTypeQuery, Query: &Query{Left: &Query{Func: "update"}, Op: OpPipe, Right: &Query{Func: "_while"}}}}}, Else: &Query{Func: "empty"}}}}}}, Func: "_while"}}}, + "with_entries": {{Name: "with_entries", Args: []string{"f"}, Body: &Query{Left: &Query{Func: "to_entries"}, Op: OpPipe, Right: &Query{Left: &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{Name: "map", Args: []*Query{{Func: "f"}}}}}, Op: OpPipe, Right: &Query{Func: "from_entries"}}}}}, } } diff --git a/vendor/github.com/itchyny/gojq/builtin.jq b/vendor/github.com/itchyny/gojq/builtin.jq index 22913ba524..24c972900e 100644 --- a/vendor/github.com/itchyny/gojq/builtin.jq +++ b/vendor/github.com/itchyny/gojq/builtin.jq @@ -1,10 +1,6 @@ def not: if . then false else true end; def in(xs): . as $x | xs | has($x); def map(f): [.[] | f]; -def to_entries: [keys[] as $k | {key: $k, value: .[$k]}]; -def from_entries: - map({ (.key // .Key // .name // .Name): (if has("value") then .value else .Value end) }) - | add | . //= {}; def with_entries(f): to_entries | map(f) | from_entries; def select(f): if f then . else empty end; def recurse: recurse(.[]?); @@ -15,44 +11,24 @@ def while(cond; update): def _while: if cond then ., (update | _while) else empty end; _while; def until(cond; next): - def _until: if cond then . else (next | _until) end; + def _until: if cond then . else next | _until end; _until; def repeat(f): def _repeat: f, _repeat; _repeat; -def range($x): range(0; $x); -def range($start; $end): - $start | while(. < $end; . + 1); -def range($start; $end; $step): - if $step > 0 then $start|while(. < $end; . + $step) - elif $step < 0 then $start|while(. > $end; . + $step) - else empty end; +def range($end): _range(0; $end; 1); +def range($start; $end): _range($start; $end; 1); +def range($start; $end; $step): _range($start; $end; $step); -def _flatten($x): - reduce .[] as $i - ( []; - if $i | type == "array" and $x != 0 - then . + ($i | _flatten($x-1)) - else . + [$i] - end); -def flatten($x): - if $x < 0 - then error("flatten depth must not be negative") - else _flatten($x) end; -def flatten: _flatten(-1); -def min: min_by(.); def min_by(f): _min_by(map([f])); -def max: max_by(.); def max_by(f): _max_by(map([f])); -def sort: sort_by(.); def sort_by(f): _sort_by(map([f])); def group_by(f): _group_by(map([f])); -def unique: unique_by(.); def unique_by(f): _unique_by(map([f])); def arrays: select(type == "array"); def objects: select(type == "object"); -def iterables: select(type |. == "array" or . == "object"); +def iterables: select(type | . == "array" or . == "object"); def booleans: select(type == "boolean"); def numbers: select(type == "number"); def finites: select(isfinite); @@ -60,98 +36,44 @@ def normals: select(isnormal); def strings: select(type == "string"); def nulls: select(. == null); def values: select(. != null); -def scalars: select(type |. != "array" and . != "object"); -def leaf_paths: paths(scalars); +def scalars: select(type | . != "array" and . != "object"); -def indices($x): - if type == "array" and ($x|type) == "array" then .[$x] - elif type == "array" then .[[$x]] - elif type == "string" and ($x|type) == "string" then explode | .[$x|explode] - else .[$x] end; -def index($x): indices($x) | .[0]; -def rindex($x): indices($x) | .[-1:][0]; def inside(xs): . as $x | xs | contains($x); -def startswith($x): - if type == "string" then - if $x|type == "string" then - .[:$x | length] == $x - else - $x | _type_error("startswith") - end - else - _type_error("startswith") - end; -def endswith($x): - if type == "string" then - if $x|type == "string" then - .[- ($x | length):] == $x - else - $x | _type_error("endswith") - end - else - _type_error("endswith") - end; -def ltrimstr($x): - if type == "string" and ($x|type == "string") and startswith($x) then - .[$x | length:] - end; -def rtrimstr($x): - if type == "string" and ($x|type == "string") and endswith($x) then - .[:- ($x | length)] - end; - def combinations: if length == 0 then [] else - .[0][] as $x | (.[1:] | combinations) as $y | [$x] + $y + .[0][] as $x | [$x] + (.[1:] | combinations) end; -def combinations(n): - . as $dot | [range(n) | $dot] | combinations; -def join($x): reduce .[] as $i (null; - (if . == null then "" else . + $x end) + - ($i | if type == "boolean" or type == "number" then tostring else . // "" end) - ) // ""; -def ascii_downcase: - explode | map(if 65 <= . and . <= 90 then . + 32 end) | implode; -def ascii_upcase: - explode | map(if 97 <= . and . <= 122 then . - 32 end) | implode; +def combinations(n): [limit(n; repeat(.))] | combinations; def walk(f): - . as $in - | if type == "object" then - reduce keys[] as $key ({}; . + { ($key): ($in[$key] | walk(f)) }) | f - elif type == "array" then - map(walk(f)) | f - else - f - end; -def transpose: - if . == [] then - [] - else - . as $in - | (map(length) | max) as $max - | length as $length - | reduce range(0; $max) as $j - ([]; . + [reduce range(0; $length) as $i ([]; . + [ $in[$i][$j] ] )] ) - end; + def _walk: + if type == "array" then + map(_walk) + elif type == "object" then + map_values(_walk) + end | f; + _walk; def first: .[0]; def first(g): label $out | g | ., break $out; def last: .[-1]; def last(g): reduce g as $item (null; $item); -def isempty(g): first((g|false), true); -def all: all(.[]; .); +def isempty(g): label $out | (g | false, break $out), true; +def all: all(.); def all(y): all(.[]; y); -def all(g; y): isempty(g|y and empty); -def any: any(.[]; .); +def all(g; y): isempty(g | select(y | not)); +def any: any(.); def any(y): any(.[]; y); -def any(g; y): isempty(g|y or empty) | not; +def any(g; y): isempty(g | select(y)) | not; def limit($n; g): if $n > 0 then - label $out - | foreach g as $item - ($n; .-1; $item, if . <= 0 then break $out else empty end) + label $out | + foreach g as $item ( + $n; + . - 1; + $item, if . <= 0 then break $out else empty end + ) elif $n == 0 then empty else @@ -162,75 +84,83 @@ def nth($n; g): if $n < 0 then error("nth doesn't support negative indices") else - label $out - | foreach g as $item - ($n; .-1; . < 0 or empty|$item, break $out) + label $out | + foreach g as $item ( + $n + 1; + . - 1; + if . <= 0 then $item, break $out else empty end + ) end; def truncate_stream(f): - . as $n | null | f | . as $input - | if (.[0] | length) > $n then setpath([0]; $input[0][$n:]) else empty end; + . as $n | null | f | + if .[0] | length > $n then .[0] |= .[$n:] else empty end; def fromstream(f): - { x: null, e: false } as $init - | foreach f as $i - ( $init; - if .e then $init else . end - | if $i | length == 2 - then setpath(["e"]; $i[0] | length==0) | setpath(["x"] + $i[0]; $i[1]) - else setpath(["e"]; $i[0] | length==1) end; - if .e then .x else empty end); + { x: null, e: false } as $init | + foreach f as $i ( + $init; + if .e then $init end | + if $i | length == 2 then + setpath(["e"]; $i[0] | length == 0) | + setpath(["x"] + $i[0]; $i[1]) + else + setpath(["e"]; $i[0] | length == 1) + end; + if .e then .x else empty end + ); def tostream: - path(def r: (.[]? | r), .; r) as $p - | getpath($p) - | reduce path(.[]?) as $q ([$p, .]; [$p + $q]); + path(def r: (.[]? | r), .; r) as $p | + getpath($p) | + reduce path(.[]?) as $q ([$p, .]; [$p + $q]); -def _assign(ps; $v): - reduce path(ps) as $p (.; setpath($p; $v)); -def _modify(ps; f): - reduce path(ps) as $p - ([., []]; label $out | (([0] + $p) as $q | setpath($q; getpath($q) | f) | ., break $out), .[1] += [$p]) - | . as $x | $x[0] | delpaths($x[1]); def map_values(f): .[] |= f; def del(f): delpaths([path(f)]); -def paths: - path(recurse(if (type | . == "array" or . == "object") then .[] else empty end)) - | select(length > 0); -def paths(f): - . as $x | paths | select(. as $p | $x | getpath($p) | f); +def paths: path(..) | select(. != []); +def paths(f): path(.. | select(f)) | select(. != []); +def pick(f): . as $v | + reduce path(f) as $p (null; setpath($p; $v | getpath($p))); -def fromdateiso8601: strptime("%Y-%m-%dT%H:%M:%SZ") | mktime; +def fromdateiso8601: strptime("%Y-%m-%dT%H:%M:%S%z") | mktime; def todateiso8601: strftime("%Y-%m-%dT%H:%M:%SZ"); def fromdate: fromdateiso8601; def todate: todateiso8601; def match($re): match($re; null); -def match($re; $flags): _match($re; $flags; false) | .[]; +def match($re; $flags): _match($re; $flags; false)[]; def test($re): test($re; null); def test($re; $flags): _match($re; $flags; true); def capture($re): capture($re; null); -def capture($re; $flags): - match($re; $flags) - | [.captures | .[] | select(.name != null) | { (.name): .string }] - | add // {}; +def capture($re; $flags): match($re; $flags) | _capture; def scan($re): scan($re; null); def scan($re; $flags): - match($re; "g" + $flags) - | if (.captures|length > 0) then [ .captures | .[] | .string ] else .string end; + match($re; $flags + "g") | + if .captures == [] then + .string + else + [.captures[].string] + end; def splits($re): splits($re; null); -def splits($re; $flags): split($re; $flags) | .[]; +def splits($re; $flags): split($re; $flags)[]; def sub($re; str): sub($re; str; null); def sub($re; str; $flags): - . as $in - | reduce match($re; $flags) as $r - ( ["", 0]; - . as $x - | [$r | .captures | .[] | select(.name != null) | { (.name) : .string }] - | add // {} - | [$x[0] + $in[$x[1]:$r.offset] + str, $r.offset + $r.length] ) - | .[0] + $in[.[1]:]; + . as $str | + def _sub: + if .matches == [] then + $str[:.offset] + .string + else + .matches[-1] as $r | + { + string: (($r | _capture | str) + $str[$r.offset+$r.length:.offset] + .string), + offset: $r.offset, + matches: .matches[:-1], + } | + _sub + end; + { string: "", matches: [match($re; $flags)] } | _sub; def gsub($re; str): sub($re; str; "g"); def gsub($re; str; $flags): sub($re; str; $flags + "g"); +def debug(f): (f | debug | empty), .; def inputs: try repeat(input) @@ -238,8 +168,9 @@ def inputs: if . == "break" then empty else error end; def INDEX(stream; idx_expr): - reduce stream as $row ({}; .[$row|idx_expr|tostring] = $row); -def INDEX(idx_expr): INDEX(.[]; idx_expr); + reduce stream as $row ({}; .[$row | idx_expr | tostring] = $row); +def INDEX(idx_expr): + INDEX(.[]; idx_expr); def JOIN($idx; idx_expr): [.[] | [., $idx[idx_expr]]]; def JOIN($idx; stream; idx_expr): diff --git a/vendor/github.com/itchyny/gojq/code.go b/vendor/github.com/itchyny/gojq/code.go index da4306198b..33505bde05 100644 --- a/vendor/github.com/itchyny/gojq/code.go +++ b/vendor/github.com/itchyny/gojq/code.go @@ -1,8 +1,8 @@ package gojq type code struct { + v any op opcode - v interface{} } type opcode int @@ -25,17 +25,19 @@ const ( opbacktrack opjump opjumpifnot + opindex + opindexarray opcall + opcallrec oppushpc opcallpc opscope opret - opeach + opiter opexpbegin opexpend oppathbegin oppathend - opdebug ) func (op opcode) String() string { @@ -74,8 +76,14 @@ func (op opcode) String() string { return "jump" case opjumpifnot: return "jumpifnot" + case opindex: + return "index" + case opindexarray: + return "indexarray" case opcall: return "call" + case opcallrec: + return "callrec" case oppushpc: return "pushpc" case opcallpc: @@ -84,8 +92,8 @@ func (op opcode) String() string { return "scope" case opret: return "ret" - case opeach: - return "each" + case opiter: + return "iter" case opexpbegin: return "expbegin" case opexpend: @@ -94,8 +102,6 @@ func (op opcode) String() string { return "pathbegin" case oppathend: return "pathend" - case opdebug: - return "debug" default: panic(op) } diff --git a/vendor/github.com/itchyny/gojq/compare.go b/vendor/github.com/itchyny/gojq/compare.go index 4b39f64249..e70c1fbbb7 100644 --- a/vendor/github.com/itchyny/gojq/compare.go +++ b/vendor/github.com/itchyny/gojq/compare.go @@ -1,22 +1,23 @@ package gojq -import "math/big" +import ( + "math" + "math/big" +) -func compare(l, r interface{}) int { +// Compare l and r, and returns jq-flavored comparison value. +// The result will be 0 if l == r, -1 if l < r, and +1 if l > r. +// This comparison is used by built-in operators and functions. +func Compare(l, r any) int { + return compare(l, r) +} + +func compare(l, r any) int { return binopTypeSwitch(l, r, - func(l, r int) interface{} { - switch { - case l < r: - return -1 - case l == r: - return 0 - default: - return 1 - } - }, - func(l, r float64) interface{} { + compareInt, + func(l, r float64) any { switch { - case l < r: + case l < r || math.IsNaN(l): return -1 case l == r: return 0 @@ -24,10 +25,10 @@ func compare(l, r interface{}) int { return 1 } }, - func(l, r *big.Int) interface{} { + func(l, r *big.Int) any { return l.Cmp(r) }, - func(l, r string) interface{} { + func(l, r string) any { switch { case l < r: return -1 @@ -37,66 +38,63 @@ func compare(l, r interface{}) int { return 1 } }, - func(l, r []interface{}) interface{} { - for i := 0; ; i++ { - if i >= len(l) { - if i >= len(r) { - return 0 - } - return -1 - } - if i >= len(r) { - return 1 - } + func(l, r []any) any { + n := len(l) + if len(r) < n { + n = len(r) + } + for i := 0; i < n; i++ { if cmp := compare(l[i], r[i]); cmp != 0 { return cmp } } + return compareInt(len(l), len(r)) }, - func(l, r map[string]interface{}) interface{} { + func(l, r map[string]any) any { lk, rk := funcKeys(l), funcKeys(r) if cmp := compare(lk, rk); cmp != 0 { return cmp } - for _, k := range lk.([]interface{}) { + for _, k := range lk.([]any) { if cmp := compare(l[k.(string)], r[k.(string)]); cmp != 0 { return cmp } } return 0 }, - func(l, r interface{}) interface{} { - ln, rn := getTypeOrdNum(l), getTypeOrdNum(r) - switch { - case ln < rn: - return -1 - case ln == rn: - return 0 - default: - return 1 - } + func(l, r any) any { + return compareInt(typeIndex(l), typeIndex(r)) }, ).(int) } -func getTypeOrdNum(v interface{}) int { +func compareInt(l, r int) any { + switch { + case l < r: + return -1 + case l == r: + return 0 + default: + return 1 + } +} + +func typeIndex(v any) int { switch v := v.(type) { - case nil: + default: return 0 case bool: - if v { - return 2 + if !v { + return 1 } - return 1 + return 2 case int, float64, *big.Int: return 3 case string: return 4 - case []interface{}: + case []any: return 5 - case map[string]interface{}: + case map[string]any: return 6 - default: - return -1 } } diff --git a/vendor/github.com/itchyny/gojq/compiler.go b/vendor/github.com/itchyny/gojq/compiler.go index a653750537..d114f27baa 100644 --- a/vendor/github.com/itchyny/gojq/compiler.go +++ b/vendor/github.com/itchyny/gojq/compiler.go @@ -2,11 +2,10 @@ package gojq import ( "context" - "encoding/json" "errors" "fmt" - "regexp" "sort" + "strconv" "strings" ) @@ -14,13 +13,13 @@ type compiler struct { moduleLoader ModuleLoader environLoader func() []string variables []string + customFuncs map[string]function inputIter Iter codes []*code codeinfos []codeinfo - codeoffset int + builtinScope *scopeinfo scopes []*scopeinfo scopecnt int - funcs []*funcinfo } // Code is a compiled jq query. @@ -31,18 +30,21 @@ type Code struct { } // Run runs the code with the variable values (which should be in the -// same order as the given variables using WithVariables) and returns +// same order as the given variables using [WithVariables]) and returns // a result iterator. -func (c *Code) Run(v interface{}, values ...interface{}) Iter { - return c.RunWithContext(nil, v, values...) +// +// It is safe to call this method in goroutines, to reuse a compiled [*Code]. +// But for arguments, do not give values sharing same data between goroutines. +func (c *Code) Run(v any, values ...any) Iter { + return c.RunWithContext(context.Background(), v, values...) } // RunWithContext runs the code with context. -func (c *Code) RunWithContext(ctx context.Context, v interface{}, values ...interface{}) Iter { +func (c *Code) RunWithContext(ctx context.Context, v any, values ...any) Iter { if len(values) > len(c.variables) { - return unitIterator(errTooManyVariableValues) + return NewIter(&tooManyVariableValuesError{}) } else if len(values) < len(c.variables) { - return unitIterator(&expectedVariableError{c.variables[len(values)]}) + return NewIter(&expectedVariableError{c.variables[len(values)]}) } for i, v := range values { values[i] = normalizeNumbers(v) @@ -50,24 +52,11 @@ func (c *Code) RunWithContext(ctx context.Context, v interface{}, values ...inte return newEnv(ctx).execute(c, normalizeNumbers(v), values...) } -// ModuleLoader is an interface for loading modules. -type ModuleLoader interface { - LoadModule(string) (*Query, error) - // (optional) LoadModuleWithMeta(string, map[string]interface{}) (*Query, error) - // (optional) LoadInitModules() ([]*Query, error) - // (optional) LoadJSON(string) (interface{}, error) - // (optional) LoadJSONWithMeta(string, map[string]interface{}) (interface{}, error) -} - -type codeinfo struct { - name string - pc int -} - type scopeinfo struct { + variables []*varinfo + funcs []*funcinfo id int depth int - variables []varinfo variablecnt int } @@ -78,10 +67,9 @@ type varinfo struct { } type funcinfo struct { - name string - pc int - args []string - argsorder []int + name string + pc int + argcnt int } // Compile compiles a query. @@ -90,11 +78,19 @@ func Compile(q *Query, options ...CompilerOption) (*Code, error) { for _, opt := range options { opt(c) } + c.builtinScope = c.newScope() scope := c.newScope() c.scopes = []*scopeinfo{scope} - defer c.lazy(func() *code { - return &code{op: opscope, v: [2]int{scope.id, scope.variablecnt}} - })() + setscope := c.lazy(func() *code { + return &code{op: opscope, v: [3]int{scope.id, scope.variablecnt, 0}} + }) + for _, name := range c.variables { + if !newLexer(name).validVarName() { + return nil, &variableNameError{name} + } + c.appendCodeInfo(name) + c.append(&code{op: opstore, v: c.pushVariable(name)}) + } if c.moduleLoader != nil { if moduleLoader, ok := c.moduleLoader.(interface { LoadInitModules() ([]*Query, error) @@ -110,38 +106,30 @@ func Compile(q *Query, options ...CompilerOption) (*Code, error) { } } } - code, err := c.compile(q) - if err != nil { + if err := c.compile(q); err != nil { return nil, err } - c.optimizeJumps() - return code, nil + setscope() + c.optimizeTailRec() + c.optimizeCodeOps() + return &Code{ + variables: c.variables, + codes: c.codes, + codeinfos: c.codeinfos, + }, nil } -var varNameRe = regexp.MustCompile(`^\$[a-zA-Z_][a-zA-Z0-9_]*$`) - -func (c *compiler) compile(q *Query) (*Code, error) { - for _, name := range c.variables { - if !varNameRe.MatchString(name) { - return nil, &variableNameError{name} - } - v := c.pushVariable(name) - c.append(&code{op: opstore, v: v}) - } +func (c *compiler) compile(q *Query) error { for _, i := range q.Imports { if err := c.compileImport(i); err != nil { - return nil, err + return err } } if err := c.compileQuery(q); err != nil { - return nil, err + return err } c.append(&code{op: opret}) - return &Code{ - variables: c.variables, - codes: c.codes, - codeinfos: c.codeinfos, - }, nil + return nil } func (c *compiler) compileImport(i *Import) error { @@ -156,15 +144,15 @@ func (c *compiler) compileImport(i *Import) error { return fmt.Errorf("cannot load module: %q", path) } if strings.HasPrefix(alias, "$") { - var vals interface{} + var vals any if moduleLoader, ok := c.moduleLoader.(interface { - LoadJSONWithMeta(string, map[string]interface{}) (interface{}, error) + LoadJSONWithMeta(string, map[string]any) (any, error) }); ok { if vals, err = moduleLoader.LoadJSONWithMeta(path, i.Meta.ToValue()); err != nil { return err } } else if moduleLoader, ok := c.moduleLoader.(interface { - LoadJSON(string) (interface{}, error) + LoadJSON(string) (any, error) }); ok { if vals, err = moduleLoader.LoadJSON(path); err != nil { return err @@ -172,6 +160,7 @@ func (c *compiler) compileImport(i *Import) error { } else { return fmt.Errorf("module not found: %q", path) } + vals = normalizeNumbers(vals) c.append(&code{op: oppush, v: vals}) c.append(&code{op: opstore, v: c.pushVariable(alias)}) c.append(&code{op: oppush, v: vals}) @@ -180,164 +169,210 @@ func (c *compiler) compileImport(i *Import) error { } var q *Query if moduleLoader, ok := c.moduleLoader.(interface { - LoadModuleWithMeta(string, map[string]interface{}) (*Query, error) + LoadModuleWithMeta(string, map[string]any) (*Query, error) }); ok { if q, err = moduleLoader.LoadModuleWithMeta(path, i.Meta.ToValue()); err != nil { return err } - } else if q, err = c.moduleLoader.LoadModule(path); err != nil { - return err + } else if moduleLoader, ok := c.moduleLoader.(interface { + LoadModule(string) (*Query, error) + }); ok { + if q, err = moduleLoader.LoadModule(path); err != nil { + return err + } } c.appendCodeInfo("module " + path) - defer c.appendCodeInfo("end of module " + path) - return c.compileModule(q, alias) -} - -func (c *compiler) compileModule(q *Query, alias string) error { - cc := &compiler{ - moduleLoader: c.moduleLoader, environLoader: c.environLoader, variables: c.variables, inputIter: c.inputIter, - codeoffset: c.pc(), scopes: c.scopes, scopecnt: c.scopecnt} - defer cc.newScopeDepth()() - bs, err := cc.compileModuleInternal(q) - if err != nil { + if err = c.compileModule(q, alias); err != nil { return err } - c.codes = append(c.codes, bs.codes...) - if alias != "" { - for _, f := range cc.funcs { - f.name = alias + "::" + f.name - } - } - c.funcs = append(c.funcs, cc.funcs...) - c.codeinfos = append(c.codeinfos, bs.codeinfos...) - c.scopecnt = cc.scopecnt + c.appendCodeInfo("end of module " + path) return nil } -func (c *compiler) compileModuleInternal(q *Query) (*Code, error) { +func (c *compiler) compileModule(q *Query, alias string) error { + scope := c.scopes[len(c.scopes)-1] + scope.depth++ + defer func(l int) { + scope.depth-- + scope.variables = scope.variables[:l] + }(len(scope.variables)) + if alias != "" { + defer func(l int) { + for _, f := range scope.funcs[l:] { + f.name = alias + "::" + f.name + } + }(len(scope.funcs)) + } for _, i := range q.Imports { if err := c.compileImport(i); err != nil { - return nil, err + return err } } for _, fd := range q.FuncDefs { if err := c.compileFuncDef(fd, false); err != nil { - return nil, err + return err } } - return &Code{codes: c.codes, codeinfos: c.codeinfos}, nil + return nil } func (c *compiler) newVariable() [2]int { - return c.pushVariable("") + return c.createVariable("") } func (c *compiler) pushVariable(name string) [2]int { s := c.scopes[len(c.scopes)-1] - if name != "" { - for _, v := range s.variables { - if v.name == name && v.depth == s.depth { - return v.index - } + for _, v := range s.variables { + if v.name == name && v.depth == s.depth { + return v.index } } + return c.createVariable(name) +} + +func (c *compiler) createVariable(name string) [2]int { + s := c.scopes[len(c.scopes)-1] v := [2]int{s.id, s.variablecnt} s.variablecnt++ - s.variables = append(s.variables, varinfo{name, v, s.depth}) + s.variables = append(s.variables, &varinfo{name, v, s.depth}) return v } +func (c *compiler) lookupVariable(name string) ([2]int, error) { + for i := len(c.scopes) - 1; i >= 0; i-- { + s := c.scopes[i] + for j := len(s.variables) - 1; j >= 0; j-- { + if w := s.variables[j]; w.name == name { + return w.index, nil + } + } + } + return [2]int{}, &variableNotFoundError{name} +} + +func (c *compiler) lookupFuncOrVariable(name string) (*funcinfo, *varinfo) { + for i, isFunc := len(c.scopes)-1, name[0] != '$'; i >= 0; i-- { + s := c.scopes[i] + if isFunc { + for j := len(s.funcs) - 1; j >= 0; j-- { + if f := s.funcs[j]; f.name == name && f.argcnt == 0 { + return f, nil + } + } + } + for j := len(s.variables) - 1; j >= 0; j-- { + if v := s.variables[j]; v.name == name { + return nil, v + } + } + } + return nil, nil +} + +func (c *compiler) lookupBuiltin(name string, argcnt int) *funcinfo { + s := c.builtinScope + for i := len(s.funcs) - 1; i >= 0; i-- { + if f := s.funcs[i]; f.name == name && f.argcnt == argcnt { + return f + } + } + return nil +} + +func (c *compiler) appendBuiltin(name string, argcnt int) func() { + setjump := c.lazy(func() *code { + return &code{op: opjump, v: len(c.codes)} + }) + c.appendCodeInfo(name) + c.builtinScope.funcs = append( + c.builtinScope.funcs, + &funcinfo{name, len(c.codes), argcnt}, + ) + return func() { + setjump() + c.appendCodeInfo("end of " + name) + } +} + func (c *compiler) newScope() *scopeinfo { i := c.scopecnt // do not use len(c.scopes) because it pops c.scopecnt++ - return &scopeinfo{i, 0, nil, 0} + return &scopeinfo{id: i} } func (c *compiler) newScopeDepth() func() { scope := c.scopes[len(c.scopes)-1] - l, m := len(scope.variables), len(c.funcs) + l, m := len(scope.variables), len(scope.funcs) scope.depth++ return func() { scope.depth-- scope.variables = scope.variables[:l] - c.funcs = c.funcs[:m] + scope.funcs = scope.funcs[:m] } } func (c *compiler) compileFuncDef(e *FuncDef, builtin bool) error { + var scope *scopeinfo if builtin { - for i := len(c.funcs) - 1; i >= 0; i-- { - f := c.funcs[i] - if f.name == e.Name && len(f.args) == len(e.Args) { - return nil - } - } + scope = c.builtinScope + } else { + scope = c.scopes[len(c.scopes)-1] } defer c.lazy(func() *code { - return &code{op: opjump, v: c.pc()} + return &code{op: opjump, v: len(c.codes)} })() c.appendCodeInfo(e.Name) - defer c.appendCodeInfo("end of " + e.Name) - pc, argsorder := c.pc(), getArgsOrder(e.Args) - c.funcs = append(c.funcs, &funcinfo{e.Name, pc, e.Args, argsorder}) - cc := &compiler{ - moduleLoader: c.moduleLoader, environLoader: c.environLoader, inputIter: c.inputIter, - codeoffset: pc, scopecnt: c.scopecnt, funcs: c.funcs} - scope := cc.newScope() - cc.scopes = append(c.scopes, scope) - setscope := cc.lazy(func() *code { - return &code{op: opscope, v: [2]int{scope.id, scope.variablecnt}} - }) + scope.funcs = append(scope.funcs, &funcinfo{e.Name, len(c.codes), len(e.Args)}) + defer func(scopes []*scopeinfo, variables []string) { + c.scopes, c.variables = scopes, variables + }(c.scopes, c.variables) + c.variables = c.variables[len(c.variables):] + scope = c.newScope() + if builtin { + c.scopes = []*scopeinfo{c.builtinScope, scope} + } else { + c.scopes = append(c.scopes, scope) + } + defer c.lazy(func() *code { + return &code{op: opscope, v: [3]int{scope.id, scope.variablecnt, len(e.Args)}} + })() if len(e.Args) > 0 { - v := cc.newVariable() - cc.append(&code{op: opstore, v: v}) - skip := make([]bool, len(e.Args)) - for i, name := range e.Args { - for j := 0; j < i; j++ { - if name == e.Args[j] { - skip[j] = true - break - } - } + type varIndex struct { + name string + index [2]int } - for _, i := range argsorder { - if skip[i] { - cc.append(&code{op: oppop}) + vis := make([]varIndex, 0, len(e.Args)) + v := c.newVariable() + c.append(&code{op: opstore, v: v}) + for _, arg := range e.Args { + if arg[0] == '$' { + c.appendCodeInfo(arg[1:]) + w := c.createVariable(arg[1:]) + c.append(&code{op: opstore, v: w}) + vis = append(vis, varIndex{arg, w}) } else { - cc.append(&code{op: opstore, v: cc.pushVariable(e.Args[i])}) + c.appendCodeInfo(arg) + c.append(&code{op: opstore, v: c.createVariable(arg)}) } } - cc.append(&code{op: opload, v: v}) + for _, w := range vis { + c.append(&code{op: opload, v: v}) + c.append(&code{op: opexpbegin}) + c.append(&code{op: opload, v: w.index}) + c.append(&code{op: opcallpc}) + c.appendCodeInfo(w.name) + c.append(&code{op: opstore, v: c.pushVariable(w.name)}) + c.append(&code{op: opexpend}) + } + c.append(&code{op: opload, v: v}) } - bs, err := cc.compile(e.Body) - if err != nil { + if err := c.compile(e.Body); err != nil { return err } - setscope() - cc.optimizeTailRec() - c.codes = append(c.codes, bs.codes...) - c.codeinfos = append(c.codeinfos, bs.codeinfos...) - c.scopecnt = cc.scopecnt + c.appendCodeInfo("end of " + e.Name) return nil } -func getArgsOrder(args []string) []int { - xs := make([]int, len(args)) - if len(xs) > 0 { - for i := range xs { - xs[i] = i - } - sort.Slice(xs, func(i, j int) bool { - xi, xj := xs[i], xs[j] - if args[xi][0] == '$' { - return args[xj][0] == '$' && xi > xj // reverse the order of variables - } - return args[xj][0] == '$' || xi < xj - }) - } - return xs -} - func (c *compiler) compileQuery(e *Query) error { for _, fd := range e.FuncDefs { if err := c.compileFuncDef(fd, false); err != nil { @@ -409,15 +444,15 @@ func (c *compiler) compileQuery(e *Query) error { func (c *compiler) compileComma(l, r *Query) error { setfork := c.lazy(func() *code { - return &code{op: opfork, v: c.pc() + 1} + return &code{op: opfork, v: len(c.codes)} }) if err := c.compileQuery(l); err != nil { return err } - setfork() defer c.lazy(func() *code { - return &code{op: opjump, v: c.pc()} + return &code{op: opjump, v: len(c.codes)} })() + setfork() return c.compileQuery(r) } @@ -426,33 +461,34 @@ func (c *compiler) compileAlt(l, r *Query) error { found := c.newVariable() c.append(&code{op: opstore, v: found}) setfork := c.lazy(func() *code { - return &code{op: opfork, v: c.pc()} // opload found + return &code{op: opfork, v: len(c.codes)} // opload found }) if err := c.compileQuery(l); err != nil { return err } c.append(&code{op: opdup}) - c.append(&code{op: opjumpifnot, v: c.pc() + 4}) // oppop - c.append(&code{op: oppush, v: true}) // found some value + c.append(&code{op: opjumpifnot, v: len(c.codes) + 4}) // oppop + c.append(&code{op: oppush, v: true}) // found some value c.append(&code{op: opstore, v: found}) defer c.lazy(func() *code { - return &code{op: opjump, v: c.pc()} // ret + return &code{op: opjump, v: len(c.codes)} })() c.append(&code{op: oppop}) c.append(&code{op: opbacktrack}) setfork() c.append(&code{op: opload, v: found}) - c.append(&code{op: opjumpifnot, v: c.pc() + 3}) + c.append(&code{op: opjumpifnot, v: len(c.codes) + 3}) c.append(&code{op: opbacktrack}) // if found, backtrack c.append(&code{op: oppop}) return c.compileQuery(r) } -func (c *compiler) compileQueryUpdate(l, r *Query, op Operator) (err error) { +func (c *compiler) compileQueryUpdate(l, r *Query, op Operator) error { switch op { case OpAssign: - // .foo.bar = f => setpath(["foo", "bar"]; f) - if xs := l.toIndices(); xs != nil { + // optimize assignment operator with constant indexing and slicing + // .foo.[0].[1:2] = f => setpath(["foo",0,{"start":1,"end":2}]; f) + if xs := l.toIndices(nil); xs != nil { // ref: compileCall v := c.newVariable() c.append(&code{op: opstore, v: v}) @@ -462,7 +498,7 @@ func (c *compiler) compileQueryUpdate(l, r *Query, op Operator) (err error) { } c.append(&code{op: oppush, v: xs}) c.append(&code{op: opload, v: v}) - c.append(&code{op: opcall, v: [3]interface{}{internalFuncs["setpath"].callback, 2, "setpath"}}) + c.append(&code{op: opcall, v: [3]any{internalFuncs["setpath"].callback, 2, "setpath"}}) return nil } fallthrough @@ -485,12 +521,15 @@ func (c *compiler) compileQueryUpdate(l, r *Query, op Operator) (err error) { Name: "_modify", Args: []*Query{ l, - &Query{Term: &Term{Type: TermTypeFunc, Func: &Func{ - Name: op.getFunc(), - Args: []*Query{ - &Query{Term: &Term{Type: TermTypeIdentity}}, - &Query{Func: name}}, - }, + {Term: &Term{ + Type: TermTypeFunc, + Func: &Func{ + Name: op.getFunc(), + Args: []*Query{ + {Term: &Term{Type: TermTypeIdentity}}, + {Func: name}, + }, + }, }}, }, }, @@ -498,7 +537,13 @@ func (c *compiler) compileQueryUpdate(l, r *Query, op Operator) (err error) { } } -func (c *compiler) compileBind(b *Bind) error { +func (c *compiler) compileBind(e *Term, b *Bind) error { + defer c.newScopeDepth()() + c.append(&code{op: opdup}) + c.append(&code{op: opexpbegin}) + if err := c.compileTerm(e); err != nil { + return err + } var pc int var vs [][2]int for i, p := range b.Patterns { @@ -515,98 +560,86 @@ func (c *compiler) compileBind(b *Bind) error { c.append(&code{op: opstore, v: v}) } } - vs, err = c.compilePattern(p) - if err != nil { + if vs, err = c.compilePattern(vs[:0], p); err != nil { return err } if i < len(b.Patterns)-1 { defer c.lazy(func() *code { return &code{op: opjump, v: pc} })() - pcc = c.pc() + pcc = len(c.codes) } } if len(b.Patterns) > 1 { - pc = c.pc() + pc = len(c.codes) } - if c.codes[len(c.codes)-2].op == opexpbegin { - c.codes[len(c.codes)-2] = c.codes[len(c.codes)-1] - c.codes = c.codes[:len(c.codes)-1] + if len(b.Patterns) == 1 && c.codes[len(c.codes)-2].op == opexpbegin { + c.codes[len(c.codes)-2].op = opnop } else { - c.append(&code{op: opexpend}) // ref: compileQuery + c.append(&code{op: opexpend}) } return c.compileQuery(b.Body) } -func (c *compiler) compilePattern(p *Pattern) ([][2]int, error) { +func (c *compiler) compilePattern(vs [][2]int, p *Pattern) ([][2]int, error) { + var err error c.appendCodeInfo(p) if p.Name != "" { v := c.pushVariable(p.Name) c.append(&code{op: opstore, v: v}) - return [][2]int{v}, nil + return append(vs, v), nil } else if len(p.Array) > 0 { - var vs [][2]int v := c.newVariable() c.append(&code{op: opstore, v: v}) for i, p := range p.Array { - c.append(&code{op: oppush, v: i}) - c.append(&code{op: opload, v: v}) c.append(&code{op: opload, v: v}) - // ref: compileCall - c.append(&code{op: opcall, v: [3]interface{}{internalFuncs["_index"].callback, 2, "_index"}}) - ns, err := c.compilePattern(p) - if err != nil { + c.append(&code{op: opindexarray, v: i}) + if vs, err = c.compilePattern(vs, p); err != nil { return nil, err } - vs = append(vs, ns...) } return vs, nil } else if len(p.Object) > 0 { - var vs [][2]int v := c.newVariable() c.append(&code{op: opstore, v: v}) for _, kv := range p.Object { var key, name string - if kv.KeyOnly != "" { - key, name = kv.KeyOnly[1:], kv.KeyOnly - c.append(&code{op: oppush, v: key}) - } else if kv.Key != "" { - key = kv.Key - if key != "" && key[0] == '$' { + c.append(&code{op: opload, v: v}) + if key = kv.Key; key != "" { + if key[0] == '$' { key, name = key[1:], key } - c.append(&code{op: oppush, v: key}) } else if kv.KeyString != nil { - c.append(&code{op: opload, v: v}) - if err := c.compileString(kv.KeyString, nil); err != nil { - return nil, err + if key = kv.KeyString.Str; key == "" { + if err := c.compileString(kv.KeyString, nil); err != nil { + return nil, err + } } } else if kv.KeyQuery != nil { - c.append(&code{op: opload, v: v}) if err := c.compileQuery(kv.KeyQuery); err != nil { return nil, err } } - c.append(&code{op: opload, v: v}) - c.append(&code{op: opload, v: v}) - // ref: compileCall - c.append(&code{op: opcall, v: [3]interface{}{internalFuncs["_index"].callback, 2, "_index"}}) + if key != "" { + c.append(&code{op: opindex, v: key}) + } else { + c.append(&code{op: opload, v: v}) + c.append(&code{op: oppush, v: nil}) + // ref: compileCall + c.append(&code{op: opcall, v: [3]any{internalFuncs["_index"].callback, 2, "_index"}}) + } if name != "" { if kv.Val != nil { c.append(&code{op: opdup}) } - ns, err := c.compilePattern(&Pattern{Name: name}) - if err != nil { + if vs, err = c.compilePattern(vs, &Pattern{Name: name}); err != nil { return nil, err } - vs = append(vs, ns...) } if kv.Val != nil { - ns, err := c.compilePattern(kv.Val) - if err != nil { + if vs, err = c.compilePattern(vs, kv.Val); err != nil { return nil, err } - vs = append(vs, ns...) } } return vs, nil @@ -619,29 +652,47 @@ func (c *compiler) compileIf(e *If) error { c.appendCodeInfo(e) c.append(&code{op: opdup}) // duplicate the value for then or else clause c.append(&code{op: opexpbegin}) + pc := len(c.codes) f := c.newScopeDepth() if err := c.compileQuery(e.Cond); err != nil { return err } f() - c.append(&code{op: opexpend}) + if pc == len(c.codes) { + c.codes = c.codes[:pc-1] + } else { + c.append(&code{op: opexpend}) + } + pcc := len(c.codes) setjumpifnot := c.lazy(func() *code { - return &code{op: opjumpifnot, v: c.pc() + 1} // if falsy, skip then clause + return &code{op: opjumpifnot, v: len(c.codes)} // skip then clause }) f = c.newScopeDepth() if err := c.compileQuery(e.Then); err != nil { return err } f() - setjumpifnot() defer c.lazy(func() *code { - return &code{op: opjump, v: c.pc()} // jump to ret after else clause + return &code{op: opjump, v: len(c.codes)} })() + setjumpifnot() if len(e.Elif) > 0 { return c.compileIf(&If{e.Elif[0].Cond, e.Elif[0].Then, e.Elif[1:], e.Else}) } if e.Else != nil { defer c.newScopeDepth()() + defer func() { + // optimize constant results + // opdup, ..., opjumpifnot, opconst, opjump, opconst + // => opnop, ..., opjumpifnot, oppush, opjump, oppush + if pcc+4 == len(c.codes) && + c.codes[pcc+1] != nil && c.codes[pcc+1].op == opconst && + c.codes[pcc+3] != nil && c.codes[pcc+3].op == opconst { + c.codes[pc-2].op = opnop + c.codes[pcc+1].op = oppush + c.codes[pcc+3].op = oppush + } + }() return c.compileQuery(e.Else) } return nil @@ -650,7 +701,7 @@ func (c *compiler) compileIf(e *If) error { func (c *compiler) compileTry(e *Try) error { c.appendCodeInfo(e) setforktrybegin := c.lazy(func() *code { - return &code{op: opforktrybegin, v: c.pc()} + return &code{op: opforktrybegin, v: len(c.codes)} }) f := c.newScopeDepth() if err := c.compileQuery(e.Body); err != nil { @@ -659,7 +710,7 @@ func (c *compiler) compileTry(e *Try) error { f() c.append(&code{op: opforktryend}) defer c.lazy(func() *code { - return &code{op: opjump, v: c.pc()} + return &code{op: opjump, v: len(c.codes)} })() setforktrybegin() if e.Catch != nil { @@ -673,9 +724,9 @@ func (c *compiler) compileTry(e *Try) error { func (c *compiler) compileReduce(e *Reduce) error { c.appendCodeInfo(e) defer c.newScopeDepth()() - defer c.lazy(func() *code { - return &code{op: opfork, v: c.pc() - 2} - })() + setfork := c.lazy(func() *code { + return &code{op: opfork, v: len(c.codes)} + }) c.append(&code{op: opdup}) v := c.newVariable() f := c.newScopeDepth() @@ -687,7 +738,7 @@ func (c *compiler) compileReduce(e *Reduce) error { if err := c.compileTerm(e.Term); err != nil { return err } - if _, err := c.compilePattern(e.Pattern); err != nil { + if _, err := c.compilePattern(nil, e.Pattern); err != nil { return err } c.append(&code{op: opload, v: v}) @@ -698,6 +749,7 @@ func (c *compiler) compileReduce(e *Reduce) error { f() c.append(&code{op: opstore, v: v}) c.append(&code{op: opbacktrack}) + setfork() c.append(&code{op: oppop}) c.append(&code{op: opload, v: v}) return nil @@ -717,7 +769,7 @@ func (c *compiler) compileForeach(e *Foreach) error { if err := c.compileTerm(e.Term); err != nil { return err } - if _, err := c.compilePattern(e.Pattern); err != nil { + if _, err := c.compilePattern(nil, e.Pattern); err != nil { return err } c.append(&code{op: opload, v: v}) @@ -737,17 +789,33 @@ func (c *compiler) compileForeach(e *Foreach) error { func (c *compiler) compileLabel(e *Label) error { c.appendCodeInfo(e) - defer c.lazy(func() *code { - return &code{op: opforklabel, v: e.Ident} - })() + v := c.pushVariable("$%" + e.Ident[1:]) + c.append(&code{op: opforklabel, v: v}) return c.compileQuery(e.Body) } -func (c *compiler) compileTerm(e *Term) (err error) { +func (c *compiler) compileBreak(label string) error { + v, err := c.lookupVariable("$%" + label[1:]) + if err != nil { + return &breakError{label, nil} + } + c.append(&code{op: oppop}) + c.append(&code{op: opload, v: v}) + c.append(&code{op: opcall, v: [3]any{funcBreak(label), 0, "_break"}}) + return nil +} + +func funcBreak(label string) func(any, []any) any { + return func(v any, _ []any) any { + return &breakError{label, v} + } +} + +func (c *compiler) compileTerm(e *Term) error { if len(e.SuffixList) > 0 { s := e.SuffixList[len(e.SuffixList)-1] t := *e // clone without changing e - (&t).SuffixList = t.SuffixList[:len(e.SuffixList)-1] + t.SuffixList = t.SuffixList[:len(e.SuffixList)-1] return c.compileTermSuffix(&t, s) } switch e.Type { @@ -773,11 +841,7 @@ func (c *compiler) compileTerm(e *Term) (err error) { case TermTypeArray: return c.compileArray(e.Array) case TermTypeNumber: - v := normalizeNumbers(json.Number(e.Number)) - if err, ok := v.(error); ok { - return err - } - c.append(&code{op: opconst, v: v}) + c.append(&code{op: opconst, v: toNumber(e.Number)}) return nil case TermTypeUnary: return c.compileUnary(e.Unary) @@ -796,90 +860,100 @@ func (c *compiler) compileTerm(e *Term) (err error) { case TermTypeLabel: return c.compileLabel(e.Label) case TermTypeBreak: - c.append(&code{op: opconst, v: e.Break}) - return c.compileCall("_break", nil) + return c.compileBreak(e.Break) case TermTypeQuery: - e.Query.minify() defer c.newScopeDepth()() return c.compileQuery(e.Query) default: - return fmt.Errorf("invalid term: %s", e) + panic("invalid term: " + e.String()) } } func (c *compiler) compileIndex(e *Term, x *Index) error { - c.appendCodeInfo(x) - if x.Name != "" { - return c.compileCall("_index", []*Query{&Query{Term: e}, &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: x.Name}}}}) + if k := x.toIndexKey(); k != nil { + if err := c.compileTerm(e); err != nil { + return err + } + c.appendCodeInfo(x) + c.append(&code{op: opindex, v: k}) + return nil } + c.appendCodeInfo(x) if x.Str != nil { - return c.compileCall("_index", []*Query{&Query{Term: e}, &Query{Term: &Term{Type: TermTypeString, Str: x.Str}}}) + return c.compileCall("_index", []*Query{{Term: e}, {Term: &Term{Type: TermTypeString, Str: x.Str}}}) } - if x.Start != nil { - if x.IsSlice { - if x.End != nil { - return c.compileCall("_slice", []*Query{&Query{Term: e}, x.End, x.Start}) - } - return c.compileCall("_slice", []*Query{&Query{Term: e}, &Query{Term: &Term{Type: TermTypeNull}}, x.Start}) - } - return c.compileCall("_index", []*Query{&Query{Term: e}, x.Start}) + if !x.IsSlice { + return c.compileCall("_index", []*Query{{Term: e}, x.Start}) + } + if x.Start == nil { + return c.compileCall("_slice", []*Query{{Term: e}, x.End, {Term: &Term{Type: TermTypeNull}}}) } - return c.compileCall("_slice", []*Query{&Query{Term: e}, x.End, &Query{Term: &Term{Type: TermTypeNull}}}) + if x.End == nil { + return c.compileCall("_slice", []*Query{{Term: e}, {Term: &Term{Type: TermTypeNull}}, x.Start}) + } + return c.compileCall("_slice", []*Query{{Term: e}, x.End, x.Start}) } func (c *compiler) compileFunc(e *Func) error { - for i := len(c.funcs) - 1; i >= 0; i-- { - if f := c.funcs[i]; f.name == e.Name && len(f.args) == len(e.Args) { + if len(e.Args) == 0 { + if f, v := c.lookupFuncOrVariable(e.Name); f != nil { return c.compileCallPc(f, e.Args) - } - } - for i := len(c.scopes) - 1; i >= 0; i-- { - s := c.scopes[i] - for j := len(s.variables) - 1; j >= 0; j-- { - v := s.variables[j] - if v.name == e.Name && len(e.Args) == 0 { - if e.Name[0] == '$' { - c.append(&code{op: oppop}) - c.append(&code{op: opload, v: v.index}) - } else { - c.append(&code{op: opload, v: v.index}) - c.append(&code{op: opcallpc}) + } else if v != nil { + if e.Name[0] == '$' { + c.append(&code{op: oppop}) + c.append(&code{op: opload, v: v.index}) + } else { + c.append(&code{op: opload, v: v.index}) + c.append(&code{op: opcallpc}) + } + return nil + } else if e.Name == "$ENV" || e.Name == "env" { + env := make(map[string]any) + if c.environLoader != nil { + for _, kv := range c.environLoader() { + if i := strings.IndexByte(kv, '='); i > 0 { + env[kv[:i]] = kv[i+1:] + } } - return nil } + c.append(&code{op: opconst, v: env}) + return nil + } else if e.Name[0] == '$' { + return &variableNotFoundError{e.Name} } - } - if (e.Name == "$ENV" || e.Name == "env") && len(e.Args) == 0 { - env := make(map[string]interface{}) - if c.environLoader != nil { - for _, kv := range c.environLoader() { - xs := strings.SplitN(kv, "=", 2) - env[xs[0]] = xs[1] + } else { + for i := len(c.scopes) - 1; i >= 0; i-- { + s := c.scopes[i] + for j := len(s.funcs) - 1; j >= 0; j-- { + if f := s.funcs[j]; f.name == e.Name && f.argcnt == len(e.Args) { + return c.compileCallPc(f, e.Args) + } } } - c.append(&code{op: opconst, v: env}) - return nil - } - if e.Name[0] == '$' { - return &variableNotFoundError{e.Name} } - name := e.Name - if name[0] == '_' { - name = name[1:] + if f := c.lookupBuiltin(e.Name, len(e.Args)); f != nil { + return c.compileCallPc(f, e.Args) } - if fds, ok := builtinFuncDefs[name]; ok { + if fds, ok := builtinFuncDefs[e.Name]; ok { for _, fd := range fds { if len(fd.Args) == len(e.Args) { if err := c.compileFuncDef(fd, true); err != nil { return err } + break } } - for i := len(c.funcs) - 1; i >= 0; i-- { - if f := c.funcs[i]; f.name == e.Name && len(f.args) == len(e.Args) { - return c.compileCallPc(f, e.Args) + if len(fds) == 0 { + switch e.Name { + case "_assign": + c.compileAssign() + case "_modify": + c.compileModify() } } + if f := c.lookupBuiltin(e.Name, len(e.Args)); f != nil { + return c.compileCallPc(f, e.Args) + } } if fn, ok := internalFuncs[e.Name]; ok && fn.accept(len(e.Args)) { switch e.Name { @@ -893,37 +967,202 @@ func (c *compiler) compileFunc(e *Func) error { } c.codes[len(c.codes)-1] = &code{op: oppathend} return nil - case "debug": - c.append(&code{op: opdebug, v: "DEBUG:"}) - return nil - case "stderr": - c.append(&code{op: opdebug, v: "STDERR:"}) - return nil + case "builtins": + return c.compileCallInternal( + [3]any{c.funcBuiltins, 0, e.Name}, + e.Args, + true, + -1, + ) case "input": if c.inputIter == nil { return &inputNotAllowedError{} } return c.compileCallInternal( - [3]interface{}{c.funcInput, 0, e.Name}, + [3]any{c.funcInput, 0, e.Name}, e.Args, - nil, - false, + true, + -1, ) case "modulemeta": return c.compileCallInternal( - [3]interface{}{c.funcModulemeta, 0, e.Name}, + [3]any{c.funcModulemeta, 0, e.Name}, e.Args, - nil, - false, + true, + -1, ) default: return c.compileCall(e.Name, e.Args) } } + if fn, ok := c.customFuncs[e.Name]; ok && fn.accept(len(e.Args)) { + if err := c.compileCallInternal( + [3]any{fn.callback, len(e.Args), e.Name}, + e.Args, + true, + -1, + ); err != nil { + return err + } + if fn.iter { + c.append(&code{op: opiter}) + } + return nil + } return &funcNotFoundError{e} } -func (c *compiler) funcInput(interface{}, []interface{}) interface{} { +// Appends the compiled code for the assignment operator (`=`) to maximize +// performance. Originally the operator was implemented as follows. +// +// def _assign(p; $x): reduce path(p) as $q (.; setpath($q; $x)); +// +// To overcome the difficulty of reducing allocations on `setpath`, we use the +// `allocator` type and track the allocated addresses during the reduction. +func (c *compiler) compileAssign() { + defer c.appendBuiltin("_assign", 2)() + scope := c.newScope() + v, p := [2]int{scope.id, 0}, [2]int{scope.id, 1} + x, a := [2]int{scope.id, 2}, [2]int{scope.id, 3} + // Cannot reuse v, p due to backtracking in x. + w, q := [2]int{scope.id, 4}, [2]int{scope.id, 5} + c.appends( + &code{op: opscope, v: [3]int{scope.id, 6, 2}}, + &code{op: opstore, v: v}, // def _assign(p; $x): + &code{op: opstore, v: p}, + &code{op: opstore, v: x}, + &code{op: opload, v: v}, + &code{op: opexpbegin}, + &code{op: opload, v: x}, + &code{op: opcallpc}, + &code{op: opstore, v: x}, + &code{op: opexpend}, + &code{op: oppush, v: nil}, + &code{op: opcall, v: [3]any{funcAllocator, 0, "_allocator"}}, + &code{op: opstore, v: a}, + &code{op: opload, v: v}, + &code{op: opfork, v: len(c.codes) + 30}, // reduce [L1] + &code{op: opdup}, + &code{op: opstore, v: w}, + &code{op: oppathbegin}, // path(p) + &code{op: opload, v: p}, + &code{op: opcallpc}, + &code{op: opload, v: w}, + &code{op: oppathend}, + &code{op: opstore, v: q}, // as $q (.; + &code{op: opload, v: a}, // setpath($q; $x) + &code{op: opload, v: x}, + &code{op: opload, v: q}, + &code{op: opload, v: w}, + &code{op: opcall, v: [3]any{funcSetpathWithAllocator, 3, "_setpath"}}, + &code{op: opstore, v: w}, + &code{op: opbacktrack}, // ); + &code{op: oppop}, // [L1] + &code{op: opload, v: w}, + &code{op: opret}, + ) +} + +// Appends the compiled code for the update-assignment operator (`|=`) to +// maximize performance. We use the `allocator` type, just like `_assign/2`. +func (c *compiler) compileModify() { + defer c.appendBuiltin("_modify", 2)() + scope := c.newScope() + v, p := [2]int{scope.id, 0}, [2]int{scope.id, 1} + f, d := [2]int{scope.id, 2}, [2]int{scope.id, 3} + a, l := [2]int{scope.id, 4}, [2]int{scope.id, 5} + c.appends( + &code{op: opscope, v: [3]int{scope.id, 6, 2}}, + &code{op: opstore, v: v}, // def _modify(p; f): + &code{op: opstore, v: p}, + &code{op: opstore, v: f}, + &code{op: oppush, v: []any{}}, + &code{op: opstore, v: d}, + &code{op: oppush, v: nil}, + &code{op: opcall, v: [3]any{funcAllocator, 0, "_allocator"}}, + &code{op: opstore, v: a}, + &code{op: opload, v: v}, + &code{op: opfork, v: len(c.codes) + 39}, // reduce [L1] + &code{op: oppathbegin}, // path(p) + &code{op: opload, v: p}, + &code{op: opcallpc}, + &code{op: opload, v: v}, + &code{op: oppathend}, + &code{op: opstore, v: p}, // as $p (.; + &code{op: opforklabel, v: l}, // label $l | + &code{op: opload, v: v}, // + &code{op: opfork, v: len(c.codes) + 36}, // [L2] + &code{op: oppop}, // (getpath($p) | + &code{op: opload, v: a}, + &code{op: opload, v: p}, + &code{op: opload, v: v}, + &code{op: opcall, v: [3]any{internalFuncs["getpath"].callback, 1, "getpath"}}, + &code{op: opload, v: f}, // f) + &code{op: opcallpc}, + &code{op: opload, v: p}, // setpath($p; ...) + &code{op: opload, v: v}, + &code{op: opcall, v: [3]any{funcSetpathWithAllocator, 3, "_setpath"}}, + &code{op: opstore, v: v}, + &code{op: opload, v: v}, // ., break $l + &code{op: opfork, v: len(c.codes) + 34}, // [L4] + &code{op: opjump, v: len(c.codes) + 38}, // [L3] + &code{op: opload, v: l}, // [L4] + &code{op: opcall, v: [3]any{funcBreak(""), 0, "_break"}}, + &code{op: opload, v: p}, // append $p to $d [L2] + &code{op: opappend, v: d}, // + &code{op: opbacktrack}, // ) | [L3] + &code{op: oppop}, // delpaths($d); [L1] + &code{op: opload, v: a}, + &code{op: opload, v: d}, + &code{op: opload, v: v}, + &code{op: opcall, v: [3]any{funcDelpathsWithAllocator, 2, "_delpaths"}}, + &code{op: opret}, + ) +} + +func (c *compiler) funcBuiltins(any, []any) any { + type funcNameArity struct { + name string + arity int + } + var xs []*funcNameArity + for _, fds := range builtinFuncDefs { + for _, fd := range fds { + if fd.Name[0] != '_' { + xs = append(xs, &funcNameArity{fd.Name, len(fd.Args)}) + } + } + } + for name, fn := range internalFuncs { + if name[0] != '_' { + for i, cnt := 0, fn.argcount; cnt > 0; i, cnt = i+1, cnt>>1 { + if cnt&1 > 0 { + xs = append(xs, &funcNameArity{name, i}) + } + } + } + } + for name, fn := range c.customFuncs { + if name[0] != '_' { + for i, cnt := 0, fn.argcount; cnt > 0; i, cnt = i+1, cnt>>1 { + if cnt&1 > 0 { + xs = append(xs, &funcNameArity{name, i}) + } + } + } + } + sort.Slice(xs, func(i, j int) bool { + return xs[i].name < xs[j].name || + xs[i].name == xs[j].name && xs[i].arity < xs[j].arity + }) + ys := make([]any, len(xs)) + for i, x := range xs { + ys[i] = x.name + "/" + strconv.Itoa(x.arity) + } + return ys +} + +func (c *compiler) funcInput(any, []any) any { v, ok := c.inputIter.Next() if !ok { return errors.New("break") @@ -931,10 +1170,10 @@ func (c *compiler) funcInput(interface{}, []interface{}) interface{} { return normalizeNumbers(v) } -func (c *compiler) funcModulemeta(v interface{}, _ []interface{}) interface{} { +func (c *compiler) funcModulemeta(v any, _ []any) any { s, ok := v.(string) if !ok { - return &funcTypeError{"modulemeta", v} + return &func0TypeError{"modulemeta", v} } if c.moduleLoader == nil { return fmt.Errorf("cannot load module: %q", s) @@ -942,53 +1181,74 @@ func (c *compiler) funcModulemeta(v interface{}, _ []interface{}) interface{} { var q *Query var err error if moduleLoader, ok := c.moduleLoader.(interface { - LoadModuleWithMeta(string, map[string]interface{}) (*Query, error) + LoadModuleWithMeta(string, map[string]any) (*Query, error) }); ok { if q, err = moduleLoader.LoadModuleWithMeta(s, nil); err != nil { return err } - } else if q, err = c.moduleLoader.LoadModule(s); err != nil { - return err + } else if moduleLoader, ok := c.moduleLoader.(interface { + LoadModule(string) (*Query, error) + }); ok { + if q, err = moduleLoader.LoadModule(s); err != nil { + return err + } } meta := q.Meta.ToValue() if meta == nil { - meta = make(map[string]interface{}) + meta = make(map[string]any) } - var deps []interface{} - for _, i := range q.Imports { + meta["defs"] = listModuleDefs(q) + meta["deps"] = listModuleDeps(q) + return meta +} + +func listModuleDefs(q *Query) []any { + type funcNameArity struct { + name string + arity int + } + var xs []*funcNameArity + for _, fd := range q.FuncDefs { + if fd.Name[0] != '_' { + xs = append(xs, &funcNameArity{fd.Name, len(fd.Args)}) + } + } + sort.Slice(xs, func(i, j int) bool { + return xs[i].name < xs[j].name || + xs[i].name == xs[j].name && xs[i].arity < xs[j].arity + }) + defs := make([]any, len(xs)) + for i, x := range xs { + defs[i] = x.name + "/" + strconv.Itoa(x.arity) + } + return defs +} + +func listModuleDeps(q *Query) []any { + deps := make([]any, len(q.Imports)) + for j, i := range q.Imports { v := i.Meta.ToValue() if v == nil { - v = make(map[string]interface{}) - } else { - for k := range v { - // dirty hack to remove the extra fields added in the cli package - if strings.HasPrefix(k, "$$") { - delete(v, k) - } - } + v = make(map[string]any) } - if i.ImportPath == "" { - v["relpath"] = i.IncludePath - } else { - v["relpath"] = i.ImportPath - } - if err != nil { - return err + relpath := i.ImportPath + if relpath == "" { + relpath = i.IncludePath } + v["relpath"] = relpath if i.ImportAlias != "" { v["as"] = strings.TrimPrefix(i.ImportAlias, "$") } v["is_data"] = strings.HasPrefix(i.ImportAlias, "$") - deps = append(deps, v) + deps[j] = v } - meta["deps"] = deps - return meta + return deps } func (c *compiler) compileObject(e *Object) error { c.appendCodeInfo(e) if len(e.KeyVals) == 0 { - c.append(&code{op: opconst, v: map[string]interface{}{}}) + c.append(&code{op: opconst, v: map[string]any{}}) return nil } defer c.newScopeDepth()() @@ -1013,7 +1273,7 @@ func (c *compiler) compileObject(e *Object) error { return nil } } - w := make(map[string]interface{}, l) + w := make(map[string]any, l) for i := 0; i < l; i++ { w[c.codes[pc+i*3].v.(string)] = c.codes[pc+i*3+2].v } @@ -1023,57 +1283,57 @@ func (c *compiler) compileObject(e *Object) error { } func (c *compiler) compileObjectKeyVal(v [2]int, kv *ObjectKeyVal) error { - if kv.KeyOnly != "" { - if kv.KeyOnly[0] == '$' { - c.append(&code{op: oppush, v: kv.KeyOnly[1:]}) - c.append(&code{op: opload, v: v}) - return c.compileFunc(&Func{Name: kv.KeyOnly}) - } - c.append(&code{op: oppush, v: kv.KeyOnly}) - c.append(&code{op: opload, v: v}) - return c.compileIndex(&Term{Type: TermTypeIdentity}, &Index{Name: kv.KeyOnly}) - } else if kv.KeyOnlyString != nil { - c.append(&code{op: opload, v: v}) - if err := c.compileString(kv.KeyOnlyString, nil); err != nil { - return err - } - c.append(&code{op: opdup}) - c.append(&code{op: opload, v: v}) - c.append(&code{op: opload, v: v}) - // ref: compileCall - c.append(&code{op: opcall, v: [3]interface{}{internalFuncs["_index"].callback, 2, "_index"}}) - return nil - } else { - if kv.KeyQuery != nil { - c.append(&code{op: opload, v: v}) - f := c.newScopeDepth() - if err := c.compileQuery(kv.KeyQuery); err != nil { - return err + if key := kv.Key; key != "" { + if key[0] == '$' { + if kv.Val == nil { // {$foo} == {foo:$foo} + c.append(&code{op: oppush, v: key[1:]}) } - f() - } else if kv.KeyString != nil { c.append(&code{op: opload, v: v}) - if err := c.compileString(kv.KeyString, nil); err != nil { + if err := c.compileFunc(&Func{Name: key}); err != nil { return err } - } else if kv.Key[0] == '$' { + } else { + c.append(&code{op: oppush, v: key}) + if kv.Val == nil { // {foo} == {foo:.foo} + c.append(&code{op: opload, v: v}) + c.append(&code{op: opindex, v: key}) + } + } + } else if key := kv.KeyString; key != nil { + if key.Queries == nil { + c.append(&code{op: oppush, v: key.Str}) + if kv.Val == nil { // {"foo"} == {"foo":.["foo"]} + c.append(&code{op: opload, v: v}) + c.append(&code{op: opindex, v: key.Str}) + } + } else { c.append(&code{op: opload, v: v}) - if err := c.compileFunc(&Func{Name: kv.Key}); err != nil { + if err := c.compileString(key, nil); err != nil { return err } - } else { - c.append(&code{op: oppush, v: kv.Key}) + if kv.Val == nil { + c.append(&code{op: opdup}) + c.append(&code{op: opload, v: v}) + c.append(&code{op: oppush, v: nil}) + // ref: compileCall + c.append(&code{op: opcall, v: [3]any{internalFuncs["_index"].callback, 2, "_index"}}) + } } + } else if kv.KeyQuery != nil { c.append(&code{op: opload, v: v}) - return c.compileObjectVal(kv.Val) - } -} - -func (c *compiler) compileObjectVal(e *ObjectVal) error { - for _, e := range e.Queries { - if err := c.compileQuery(e); err != nil { + f := c.newScopeDepth() + if err := c.compileQuery(kv.KeyQuery); err != nil { return err } + f() + } + if kv.Val != nil { + c.append(&code{op: opload, v: v}) + for _, e := range kv.Val.Queries { + if err := c.compileQuery(e); err != nil { + return err + } + } } return nil } @@ -1081,43 +1341,41 @@ func (c *compiler) compileObjectVal(e *ObjectVal) error { func (c *compiler) compileArray(e *Array) error { c.appendCodeInfo(e) if e.Query == nil { - c.append(&code{op: opconst, v: []interface{}{}}) + c.append(&code{op: opconst, v: []any{}}) return nil } - c.append(&code{op: oppush, v: []interface{}{}}) + c.append(&code{op: oppush, v: []any{}}) arr := c.newVariable() c.append(&code{op: opstore, v: arr}) pc := len(c.codes) - c.append(&code{op: opnop}) - defer func() { - if pc < len(c.codes) { - c.codes[pc] = &code{op: opfork, v: c.pc() - 2} - } - }() + setfork := c.lazy(func() *code { + return &code{op: opfork, v: len(c.codes)} + }) defer c.newScopeDepth()() if err := c.compileQuery(e.Query); err != nil { return err } c.append(&code{op: opappend, v: arr}) c.append(&code{op: opbacktrack}) + setfork() c.append(&code{op: oppop}) c.append(&code{op: opload, v: arr}) if e.Query.Op == OpPipe { return nil } // optimize constant arrays - l := e.Query.countCommaQueries() - if 3*l != len(c.codes)-pc-3 { + if (len(c.codes)-pc)%3 != 0 { return nil } + l := (len(c.codes) - pc - 3) / 3 for i := 0; i < l; i++ { - if (i > 0 && c.codes[pc+i].op != opfork) || + if c.codes[pc+i].op != opfork || c.codes[pc+i*2+l].op != opconst || (i < l-1 && c.codes[pc+i*2+l+1].op != opjump) { return nil } } - v := make([]interface{}, l) + v := make([]any, l) for i := 0; i < l; i++ { v[i] = c.codes[pc+i*2+l].v } @@ -1128,6 +1386,10 @@ func (c *compiler) compileArray(e *Array) error { func (c *compiler) compileUnary(e *Unary) error { c.appendCodeInfo(e) + if v := e.toNumber(); v != nil { + c.append(&code{op: opconst, v: v}) + return nil + } if err := c.compileTerm(e.Term); err != nil { return err } @@ -1141,18 +1403,22 @@ func (c *compiler) compileUnary(e *Unary) error { } } -func (c *compiler) compileFormat(fmt string, str *String) error { - if f := formatToFunc(fmt); f != nil { - if str == nil { - return c.compileFunc(f) +func (c *compiler) compileFormat(format string, str *String) error { + f := formatToFunc(format) + if f == nil { + f = &Func{ + Name: "format", + Args: []*Query{{Term: &Term{Type: TermTypeString, Str: &String{Str: format[1:]}}}}, } - return c.compileString(str, f) } - return &formatNotFoundError{fmt} + if str == nil { + return c.compileFunc(f) + } + return c.compileString(str, f) } -func formatToFunc(fmt string) *Func { - switch fmt { +func formatToFunc(format string) *Func { + switch format { case "@text": return &Func{Name: "tostring"} case "@json": @@ -1161,6 +1427,8 @@ func formatToFunc(fmt string) *Func { return &Func{Name: "_tohtml"} case "@uri": return &Func{Name: "_touri"} + case "@urid": + return &Func{Name: "_tourid"} case "@csv": return &Func{Name: "_tocsv"} case "@tsv": @@ -1184,18 +1452,18 @@ func (c *compiler) compileString(s *String, f *Func) error { if f == nil { f = &Func{Name: "tostring"} } - e := s.Queries[0] - if e.Term.Str == nil { - e = &Query{Left: e, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: f}}} - } - for i := 1; i < len(s.Queries); i++ { - x := s.Queries[i] - if x.Term.Str == nil { - x = &Query{Left: x, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: f}}} + var q *Query + for _, e := range s.Queries { + if e.Term.Str == nil { + e = &Query{Left: e, Op: OpPipe, Right: &Query{Term: &Term{Type: TermTypeFunc, Func: f}}} + } + if q == nil { + q = e + } else { + q = &Query{Left: q, Op: OpAdd, Right: e} } - e = &Query{Left: e, Op: OpAdd, Right: x} } - return c.compileQuery(e) + return c.compileQuery(q) } func (c *compiler) compileTermSuffix(e *Term, s *Suffix) error { @@ -1205,101 +1473,105 @@ func (c *compiler) compileTermSuffix(e *Term, s *Suffix) error { if err := c.compileTerm(e); err != nil { return err } - c.append(&code{op: opeach}) + c.append(&code{op: opiter}) return nil } else if s.Optional { - if len(e.SuffixList) > 1 || len(e.SuffixList) == 1 && !e.SuffixList[0].Iter { - if u, ok := e.SuffixList[len(e.SuffixList)-1].toTerm(); ok { - t := *e // clone without changing e - (&t).SuffixList = t.SuffixList[:len(e.SuffixList)-1] - if err := c.compileTerm(&t); err != nil { + if len(e.SuffixList) > 0 { + if u := e.SuffixList[len(e.SuffixList)-1].toTerm(); u != nil { + // no need to clone (ref: compileTerm) + e.SuffixList = e.SuffixList[:len(e.SuffixList)-1] + if err := c.compileTerm(e); err != nil { return err } - return c.compileTermSuffix(u, s) + e = u } } return c.compileTry(&Try{Body: &Query{Term: e}}) } else if s.Bind != nil { - c.append(&code{op: opdup}) - c.append(&code{op: opexpbegin}) - if err := c.compileTerm(e); err != nil { - return err - } - return c.compileBind(s.Bind) + return c.compileBind(e, s.Bind) } else { return fmt.Errorf("invalid suffix: %s", s) } } func (c *compiler) compileCall(name string, args []*Query) error { - return c.compileCallInternal( - [3]interface{}{internalFuncs[name].callback, len(args), name}, + fn := internalFuncs[name] + var indexing int + switch name { + case "_index", "_slice": + indexing = 1 + case "getpath": + indexing = 0 + default: + indexing = -1 + } + if err := c.compileCallInternal( + [3]any{fn.callback, len(args), name}, args, - nil, - name == "_index" || name == "_slice", - ) + true, + indexing, + ); err != nil { + return err + } + if fn.iter { + c.append(&code{op: opiter}) + } + return nil } func (c *compiler) compileCallPc(fn *funcinfo, args []*Query) error { - if len(args) == 0 { - return c.compileCallInternal(fn.pc, args, nil, false) - } - xs, vars := make([]*Query, len(args)), make(map[int]bool, len(fn.args)) - for i, j := range fn.argsorder { - xs[i] = args[j] - if fn.args[j][0] == '$' { - vars[i] = true - } - } - return c.compileCallInternal(fn.pc, xs, vars, false) + return c.compileCallInternal(fn.pc, args, false, -1) } -func (c *compiler) compileCallInternal(fn interface{}, args []*Query, vars map[int]bool, indexing bool) error { +func (c *compiler) compileCallInternal( + fn any, args []*Query, internal bool, indexing int, +) error { if len(args) == 0 { c.append(&code{op: opcall, v: fn}) return nil } - idx := c.newVariable() - c.append(&code{op: opstore, v: idx}) - if indexing && len(args) > 1 { + v := c.newVariable() + c.append(&code{op: opstore, v: v}) + if indexing >= 0 { c.append(&code{op: opexpbegin}) } for i := len(args) - 1; i >= 0; i-- { - pc := c.pc() + 1 // ref: compileFuncDef - name := fmt.Sprintf("lambda:%d", pc) + pc := len(c.codes) + 1 // skip opjump (ref: compileFuncDef) + name := "lambda:" + strconv.Itoa(pc) if err := c.compileFuncDef(&FuncDef{Name: name, Body: args[i]}, false); err != nil { return err } - if vars == nil || vars[i] { - if pc == c.pc()-2 { - // optimize identity argument + if internal { + switch len(c.codes) - pc { + case 2: // optimize identity argument (opscope, opret) j := len(c.codes) - 3 - c.codes[j] = &code{op: opload, v: idx} + c.codes[j] = &code{op: opload, v: v} c.codes = c.codes[:j+1] - c.funcs = c.funcs[:len(c.funcs)-1] + s := c.scopes[len(c.scopes)-1] + s.funcs = s.funcs[:len(s.funcs)-1] c.deleteCodeInfo(name) - } else if pc == c.pc()-3 { - // optimize one instruction argument + case 3: // optimize one instruction argument (opscope, opX, opret) j := len(c.codes) - 4 if c.codes[j+2].op == opconst { c.codes[j] = &code{op: oppush, v: c.codes[j+2].v} c.codes = c.codes[:j+1] } else { - c.codes[j] = &code{op: opload, v: idx} + c.codes[j] = &code{op: opload, v: v} c.codes[j+1] = c.codes[j+2] c.codes = c.codes[:j+2] } - c.funcs = c.funcs[:len(c.funcs)-1] + s := c.scopes[len(c.scopes)-1] + s.funcs = s.funcs[:len(s.funcs)-1] c.deleteCodeInfo(name) - } else { - c.append(&code{op: opload, v: idx}) + default: + c.append(&code{op: opload, v: v}) c.append(&code{op: oppushpc, v: pc}) c.append(&code{op: opcallpc}) } } else { c.append(&code{op: oppushpc, v: pc}) } - if indexing && i == 1 { + if i == indexing { if c.codes[len(c.codes)-2].op == opexpbegin { c.codes[len(c.codes)-2] = c.codes[len(c.codes)-1] c.codes = c.codes[:len(c.codes)-1] @@ -1308,7 +1580,11 @@ func (c *compiler) compileCallInternal(fn interface{}, args []*Query, vars map[i } } } - c.append(&code{op: opload, v: idx}) + if indexing > 0 { + c.append(&code{op: oppush, v: nil}) + } else { + c.append(&code{op: opload, v: v}) + } c.append(&code{op: opcall, v: fn}) return nil } @@ -1317,66 +1593,80 @@ func (c *compiler) append(code *code) { c.codes = append(c.codes, code) } -func (c *compiler) pc() int { - return c.codeoffset + len(c.codes) +func (c *compiler) appends(codes ...*code) { + c.codes = append(c.codes, codes...) } func (c *compiler) lazy(f func() *code) func() { i := len(c.codes) - c.codes = append(c.codes, &code{op: opnop}) + c.codes = append(c.codes, nil) return func() { c.codes[i] = f() } } func (c *compiler) optimizeTailRec() { var pcs []int - targets := map[int]bool{} - for i := 0; i < len(c.codes); i++ { + scopes := map[int]bool{} +L: + for i, l := 0, len(c.codes); i < l; i++ { switch c.codes[i].op { case opscope: - pc := i + c.codeoffset - pcs = append(pcs, pc) - xs := c.codes[i].v.([2]int) - if xs[1] == 0 { - targets[pc] = true + pcs = append(pcs, i) + if v := c.codes[i].v.([3]int); v[2] == 0 { + scopes[i] = v[1] == 0 } case opcall: - if j, ok := c.codes[i].v.(int); !ok || pcs[len(pcs)-1] != j || !targets[j] { + var canjump bool + if j, ok := c.codes[i].v.(int); !ok || + len(pcs) == 0 || pcs[len(pcs)-1] != j { + break + } else if canjump, ok = scopes[j]; !ok { break } - loop: - for j := i + 1; j < len(c.codes); { + for j := i + 1; j < l; { switch c.codes[j].op { case opjump: - j = c.codes[j].v.(int) - c.codeoffset + j = c.codes[j].v.(int) case opret: - c.codes[i] = &code{op: opjump, v: pcs[len(pcs)-1] + 1} - break loop + if canjump { + c.codes[i].op = opjump + c.codes[i].v = pcs[len(pcs)-1] + 1 + } else { + c.codes[i].op = opcallrec + } + continue L default: - break loop + continue L } } case opret: + if len(pcs) == 0 { + break L + } pcs = pcs[:len(pcs)-1] } } } -func (c *compiler) optimizeJumps() { - for i := len(c.codes) - 1; i >= 0; i-- { +func (c *compiler) optimizeCodeOps() { + for i, next := len(c.codes)-1, (*code)(nil); i >= 0; i-- { code := c.codes[i] - if code.op != opjump { - continue - } - if code.v.(int)-1 == i+c.codeoffset { - c.codes[i].op = opnop - continue - } - for { - d := c.codes[code.v.(int)-c.codeoffset] - if d.op != opjump || code.v.(int) == d.v.(int) { - break + switch code.op { + case oppush, opdup, opload: + switch next.op { + case oppop: + code.op = opnop + next.op = opnop + case opconst: + code.op = opnop + next.op = oppush + } + case opjump, opjumpifnot: + if j := code.v.(int); j-1 == i { + code.op = opnop + } else if next = c.codes[j]; next.op == opjump { + code.v = next.v } - code.v = d.v } + next = code } } diff --git a/vendor/github.com/itchyny/gojq/debug.go b/vendor/github.com/itchyny/gojq/debug.go index eea1d1ccbd..236982809f 100644 --- a/vendor/github.com/itchyny/gojq/debug.go +++ b/vendor/github.com/itchyny/gojq/debug.go @@ -1,13 +1,13 @@ -// +build debug +//go:build gojq_debug +// +build gojq_debug package gojq import ( - "bytes" - "encoding/json" "fmt" "io" "os" + "strconv" "strings" ) @@ -27,7 +27,12 @@ func init() { } } -func (c *compiler) appendCodeInfo(x interface{}) { +type codeinfo struct { + name string + pc int +} + +func (c *compiler) appendCodeInfo(x any) { if !debug { return } @@ -39,10 +44,10 @@ func (c *compiler) appendCodeInfo(x interface{}) { name = fmt.Sprint(x) } var diff int - if len(c.codes) > 0 && c.codes[len(c.codes)-1].op == opret && strings.HasPrefix(name, "end of ") { + if c.codes[len(c.codes)-1] != nil && c.codes[len(c.codes)-1].op == opret && strings.HasPrefix(name, "end of ") { diff = -1 } - c.codeinfos = append(c.codeinfos, codeinfo{name, c.pc() + diff}) + c.codeinfos = append(c.codeinfos, codeinfo{name, len(c.codes) + diff}) } func (c *compiler) deleteCodeInfo(name string) { @@ -75,7 +80,7 @@ func (env *env) debugCodes() { for i, c := range env.codes { pc := i switch c.op { - case opcall: + case opcall, opcallrec: if x, ok := c.v.(int); ok { pc = x } @@ -87,13 +92,18 @@ func (env *env) debugCodes() { } var s string if name := env.lookupInfoName(pc); name != "" { - if (c.op == opcall || c.op == opjump) && !strings.HasPrefix(name, "module ") { - s = "\t## call " + name - } else { + switch c.op { + case opcall, opcallrec, opjump: + if !strings.HasPrefix(name, "module ") { + s = "\t## call " + name + break + } + fallthrough + default: s = "\t## " + name } } - fmt.Fprintf(debugOut, "\t%d\t%s%s%s\n", i, formatOp(c.op, false), debugOperand(c), s) + fmt.Fprintf(debugOut, "\t%d\t%-*s%s%s\n", i, 25, c.op, debugOperand(c), s) } fmt.Fprintln(debugOut, "\t"+strings.Repeat("-", 40)+"+") } @@ -102,19 +112,23 @@ func (env *env) debugState(pc int, backtrack bool) { if !debug { return } - buf := new(bytes.Buffer) + var sb strings.Builder c := env.codes[pc] - fmt.Fprintf(buf, "\t%d\t%s%s\t|", pc, formatOp(c.op, backtrack), debugOperand(c)) + op := c.op.String() + if backtrack { + op += " " + } + fmt.Fprintf(&sb, "\t%d\t%-*s%s\t|", pc, 25, op, debugOperand(c)) var xs []int for i := env.stack.index; i >= 0; i = env.stack.data[i].next { xs = append(xs, i) } for i := len(xs) - 1; i >= 0; i-- { - buf.WriteString("\t") - buf.WriteString(debugJSON(env.stack.data[xs[i]].value)) + sb.WriteString("\t") + sb.WriteString(debugValue(env.stack.data[xs[i]].value)) } switch c.op { - case opcall: + case opcall, opcallrec: if x, ok := c.v.(int); ok { pc = x } @@ -125,59 +139,71 @@ func (env *env) debugState(pc int, backtrack bool) { } } if name := env.lookupInfoName(pc); name != "" { - if (c.op == opcall || c.op == opjump) && !strings.HasPrefix(name, "module ") { - buf.WriteString("\t\t\t## call " + name) - } else { - buf.WriteString("\t\t\t## " + name) + switch c.op { + case opcall, opcallrec, opjump: + if !strings.HasPrefix(name, "module ") { + sb.WriteString("\t\t\t## call " + name) + break + } + fallthrough + default: + sb.WriteString("\t\t\t## " + name) } } - fmt.Fprintln(debugOut, buf.String()) -} - -func formatOp(c opcode, backtrack bool) string { - if backtrack { - return c.String() + " " + strings.Repeat(" ", 13-len(c.String())) - } - return c.String() + strings.Repeat(" ", 25-len(c.String())) + fmt.Fprintln(debugOut, sb.String()) } func (env *env) debugForks(pc int, op string) { if !debug { return } - buf := new(bytes.Buffer) + var sb strings.Builder for i, v := range env.forks { if i > 0 { - buf.WriteByte('\t') + sb.WriteByte('\t') } if i == len(env.forks)-1 { - buf.WriteByte('<') + sb.WriteByte('<') } - fmt.Fprintf(buf, "%d, %s", v.pc, debugJSON(env.stack.data[v.stackindex].value)) + fmt.Fprintf(&sb, "%d, %s", v.pc, debugValue(env.stack.data[v.stackindex].value)) if i == len(env.forks)-1 { - buf.WriteByte('>') + sb.WriteByte('>') } } - fmt.Fprintf(debugOut, "\t-\t%s%s%d\t|\t%s\n", op, strings.Repeat(" ", 22), pc, buf.String()) + fmt.Fprintf(debugOut, "\t-\t%-*s%d\t|\t%s\n", 25, op, pc, sb.String()) } func debugOperand(c *code) string { - if c.op == opcall { + switch c.op { + case opcall, opcallrec: switch v := c.v.(type) { case int: - return debugJSON(v) - case [3]interface{}: + return strconv.Itoa(v) + case [3]any: return fmt.Sprintf("%s/%d", v[2], v[1]) default: panic(c) } - } else { - return debugJSON(c.v) + default: + return debugValue(c.v) } } -func debugJSON(v interface{}) string { - b := new(bytes.Buffer) - json.NewEncoder(b).Encode(v) - return strings.TrimSpace(b.String()) +func debugValue(v any) string { + switch v := v.(type) { + case Iter: + return fmt.Sprintf("gojq.Iter(%#v)", v) + case []pathValue: + return fmt.Sprintf("[]gojq.pathValue(%v)", v) + case [2]int: + return fmt.Sprintf("[%d,%d]", v[0], v[1]) + case [3]int: + return fmt.Sprintf("[%d,%d,%d]", v[0], v[1], v[2]) + case [3]any: + return fmt.Sprintf("[%v,%v,%v]", v[0], v[1], v[2]) + case allocator: + return fmt.Sprintf("%v", v) + default: + return Preview(v) + } } diff --git a/vendor/github.com/itchyny/gojq/encoder.go b/vendor/github.com/itchyny/gojq/encoder.go new file mode 100644 index 0000000000..3233e8a955 --- /dev/null +++ b/vendor/github.com/itchyny/gojq/encoder.go @@ -0,0 +1,193 @@ +package gojq + +import ( + "bytes" + "fmt" + "io" + "math" + "math/big" + "sort" + "strconv" + "strings" + "unicode/utf8" +) + +// Marshal returns the jq-flavored JSON encoding of v. +// +// This method accepts only limited types (nil, bool, int, float64, *big.Int, +// string, []any, and map[string]any) because these are the possible types a +// gojq iterator can emit. This method marshals NaN to null, truncates +// infinities to (+|-) math.MaxFloat64, uses \b and \f in strings, and does not +// escape '<', '>', '&', '\u2028', and '\u2029'. These behaviors are based on +// the marshaler of jq command, and different from json.Marshal in the Go +// standard library. Note that the result is not safe to embed in HTML. +func Marshal(v any) ([]byte, error) { + var b bytes.Buffer + (&encoder{w: &b}).encode(v) + return b.Bytes(), nil +} + +func jsonMarshal(v any) string { + var sb strings.Builder + (&encoder{w: &sb}).encode(v) + return sb.String() +} + +func jsonEncodeString(sb *strings.Builder, v string) { + (&encoder{w: sb}).encodeString(v) +} + +type encoder struct { + w interface { + io.Writer + io.ByteWriter + io.StringWriter + } + buf [64]byte +} + +func (e *encoder) encode(v any) { + switch v := v.(type) { + case nil: + e.w.WriteString("null") + case bool: + if v { + e.w.WriteString("true") + } else { + e.w.WriteString("false") + } + case int: + e.w.Write(strconv.AppendInt(e.buf[:0], int64(v), 10)) + case float64: + e.encodeFloat64(v) + case *big.Int: + e.w.Write(v.Append(e.buf[:0], 10)) + case string: + e.encodeString(v) + case []any: + e.encodeArray(v) + case map[string]any: + e.encodeObject(v) + default: + panic(fmt.Sprintf("invalid type: %[1]T (%[1]v)", v)) + } +} + +// ref: floatEncoder in encoding/json +func (e *encoder) encodeFloat64(f float64) { + if math.IsNaN(f) { + e.w.WriteString("null") + return + } + if f >= math.MaxFloat64 { + f = math.MaxFloat64 + } else if f <= -math.MaxFloat64 { + f = -math.MaxFloat64 + } + format := byte('f') + if x := math.Abs(f); x != 0 && x < 1e-6 || x >= 1e21 { + format = 'e' + } + buf := strconv.AppendFloat(e.buf[:0], f, format, -1, 64) + if format == 'e' { + // clean up e-09 to e-9 + if n := len(buf); n >= 4 && buf[n-4] == 'e' && buf[n-3] == '-' && buf[n-2] == '0' { + buf[n-2] = buf[n-1] + buf = buf[:n-1] + } + } + e.w.Write(buf) +} + +// ref: encodeState#string in encoding/json +func (e *encoder) encodeString(s string) { + e.w.WriteByte('"') + start := 0 + for i := 0; i < len(s); { + if b := s[i]; b < utf8.RuneSelf { + if ' ' <= b && b <= '~' && b != '"' && b != '\\' { + i++ + continue + } + if start < i { + e.w.WriteString(s[start:i]) + } + switch b { + case '"': + e.w.WriteString(`\"`) + case '\\': + e.w.WriteString(`\\`) + case '\b': + e.w.WriteString(`\b`) + case '\f': + e.w.WriteString(`\f`) + case '\n': + e.w.WriteString(`\n`) + case '\r': + e.w.WriteString(`\r`) + case '\t': + e.w.WriteString(`\t`) + default: + const hex = "0123456789abcdef" + e.w.WriteString(`\u00`) + e.w.WriteByte(hex[b>>4]) + e.w.WriteByte(hex[b&0xF]) + } + i++ + start = i + continue + } + c, size := utf8.DecodeRuneInString(s[i:]) + if c == utf8.RuneError && size == 1 { + if start < i { + e.w.WriteString(s[start:i]) + } + e.w.WriteString(`\ufffd`) + i += size + start = i + continue + } + i += size + } + if start < len(s) { + e.w.WriteString(s[start:]) + } + e.w.WriteByte('"') +} + +func (e *encoder) encodeArray(vs []any) { + e.w.WriteByte('[') + for i, v := range vs { + if i > 0 { + e.w.WriteByte(',') + } + e.encode(v) + } + e.w.WriteByte(']') +} + +func (e *encoder) encodeObject(vs map[string]any) { + e.w.WriteByte('{') + type keyVal struct { + key string + val any + } + kvs := make([]keyVal, len(vs)) + var i int + for k, v := range vs { + kvs[i] = keyVal{k, v} + i++ + } + sort.Slice(kvs, func(i, j int) bool { + return kvs[i].key < kvs[j].key + }) + for i, kv := range kvs { + if i > 0 { + e.w.WriteByte(',') + } + e.encodeString(kv.key) + e.w.WriteByte(':') + e.encode(kv.val) + } + e.w.WriteByte('}') +} diff --git a/vendor/github.com/itchyny/gojq/env.go b/vendor/github.com/itchyny/gojq/env.go index 4850b08423..bf058eda83 100644 --- a/vendor/github.com/itchyny/gojq/env.go +++ b/vendor/github.com/itchyny/gojq/env.go @@ -5,36 +5,38 @@ import "context" type env struct { pc int stack *stack - scopes *stack paths *stack - values []interface{} + scopes *scopeStack + values []any codes []*code codeinfos []codeinfo - forks []*fork + forks []fork backtrack bool offset int expdepth int + label int + args [32]any // len(env.args) > maxarity ctx context.Context } func newEnv(ctx context.Context) *env { return &env{ stack: newStack(), - scopes: newStack(), paths: newStack(), + scopes: newScopeStack(), ctx: ctx, } } type scope struct { - id int - offset int - pc int - saveindex int + id int + offset int + pc int + saveindex int + outerindex int } type fork struct { - op opcode pc int stackindex int stacklimit int diff --git a/vendor/github.com/itchyny/gojq/error.go b/vendor/github.com/itchyny/gojq/error.go index 2258fafa1d..09a70d3928 100644 --- a/vendor/github.com/itchyny/gojq/error.go +++ b/vendor/github.com/itchyny/gojq/error.go @@ -1,72 +1,96 @@ package gojq -import ( - "encoding/json" - "errors" - "fmt" - "math/big" - "reflect" -) +import "strconv" + +// ValueError is an interface for errors with a value for internal function. +// Return an error implementing this interface when you want to catch error +// values (not error messages) by try-catch, just like built-in error function. +// Refer to [WithFunction] to add a custom internal function. +type ValueError interface { + error + Value() any +} type expectedObjectError struct { - v interface{} + v any } func (err *expectedObjectError) Error() string { - return fmt.Sprintf("expected an object but got: %s", typeErrorPreview(err.v)) + return "expected an object but got: " + typeErrorPreview(err.v) } type expectedArrayError struct { - v interface{} + v any } func (err *expectedArrayError) Error() string { - return fmt.Sprintf("expected an array but got: %s", typeErrorPreview(err.v)) + return "expected an array but got: " + typeErrorPreview(err.v) } type iteratorError struct { - v interface{} + v any } func (err *iteratorError) Error() string { - return fmt.Sprintf("cannot iterate over: %s", typeErrorPreview(err.v)) + return "cannot iterate over: " + typeErrorPreview(err.v) +} + +type arrayIndexNegativeError struct { + v int +} + +func (err *arrayIndexNegativeError) Error() string { + return "array index should not be negative: " + Preview(err.v) } type arrayIndexTooLargeError struct { - v interface{} + v any } func (err *arrayIndexTooLargeError) Error() string { - return fmt.Sprintf("array index too large: %s", previewValue(err.v)) + return "array index too large: " + Preview(err.v) } type objectKeyNotStringError struct { - v interface{} + v any } func (err *objectKeyNotStringError) Error() string { - return fmt.Sprintf("expected a string for object key but got: %s", typeErrorPreview(err.v)) + return "expected a string for object key but got: " + typeErrorPreview(err.v) } type arrayIndexNotNumberError struct { - v interface{} + v any } func (err *arrayIndexNotNumberError) Error() string { - return fmt.Sprintf("expected a number for indexing an array but got: %s", typeErrorPreview(err.v)) + return "expected a number for indexing an array but got: " + typeErrorPreview(err.v) +} + +type stringIndexNotNumberError struct { + v any +} + +func (err *stringIndexNotNumberError) Error() string { + return "expected a number for indexing a string but got: " + typeErrorPreview(err.v) } type expectedStartEndError struct { - v interface{} + v any } func (err *expectedStartEndError) Error() string { - return fmt.Sprintf(`expected "start" and "end" for slicing but got: %s`, typeErrorPreview(err.v)) + return `expected "start" and "end" for slicing but got: ` + typeErrorPreview(err.v) } -type inputNotAllowedError struct { +type lengthMismatchError struct{} + +func (err *lengthMismatchError) Error() string { + return "length mismatch" } +type inputNotAllowedError struct{} + func (*inputNotAllowedError) Error() string { return "input(s)/0 is not allowed" } @@ -76,88 +100,164 @@ type funcNotFoundError struct { } func (err *funcNotFoundError) Error() string { - return fmt.Sprintf("function not defined: %s/%d", err.f.Name, len(err.f.Args)) + return "function not defined: " + err.f.Name + "/" + strconv.Itoa(len(err.f.Args)) } -type funcTypeError struct { +type func0TypeError struct { name string - v interface{} + v any +} + +func (err *func0TypeError) Error() string { + return err.name + " cannot be applied to: " + typeErrorPreview(err.v) +} + +type func1TypeError struct { + name string + v, w any +} + +func (err *func1TypeError) Error() string { + return err.name + "(" + Preview(err.w) + ") cannot be applied to: " + typeErrorPreview(err.v) +} + +type func2TypeError struct { + name string + v, w, x any +} + +func (err *func2TypeError) Error() string { + return err.name + "(" + Preview(err.w) + "; " + Preview(err.x) + ") cannot be applied to: " + typeErrorPreview(err.v) +} + +type func0WrapError struct { + name string + v any + err error +} + +func (err *func0WrapError) Error() string { + return err.name + " cannot be applied to " + Preview(err.v) + ": " + err.err.Error() +} + +type func1WrapError struct { + name string + v, w any + err error +} + +func (err *func1WrapError) Error() string { + return err.name + "(" + Preview(err.w) + ") cannot be applied to " + Preview(err.v) + ": " + err.err.Error() +} + +type func2WrapError struct { + name string + v, w, x any + err error } -func (err *funcTypeError) Error() string { - return fmt.Sprintf("%s cannot be applied to: %s", err.name, typeErrorPreview(err.v)) +func (err *func2WrapError) Error() string { + return err.name + "(" + Preview(err.w) + "; " + Preview(err.x) + ") cannot be applied to " + Preview(err.v) + ": " + err.err.Error() } type exitCodeError struct { - value interface{} + value any code int - halt bool } func (err *exitCodeError) Error() string { if s, ok := err.value.(string); ok { - return fmt.Sprintf("error: %s", s) + return "error: " + s } - bs, _ := json.Marshal(normalizeValues(err.value)) - return fmt.Sprintf("error: %s", string(bs)) + return "error: " + jsonMarshal(err.value) } -func (err *exitCodeError) IsEmptyError() bool { - return err.value == nil +func (err *exitCodeError) Value() any { + return err.value } func (err *exitCodeError) ExitCode() int { return err.code } -type funcContainsError struct { - l, r interface{} +// HaltError is an error emitted by halt and halt_error functions. +// It implements [ValueError], and if the value is nil, discard the error +// and stop the iteration. Consider a query like "1, halt, 2"; +// the first value is 1, and the second value is a HaltError with nil value. +// You might think the iterator should not emit an error this case, but it +// should so that we can recognize the halt error to stop the outer loop +// of iterating input values; echo 1 2 3 | gojq "., halt". +type HaltError exitCodeError + +func (err *HaltError) Error() string { + return "halt " + (*exitCodeError)(err).Error() +} + +// Value returns the value of the error. This implements [ValueError], +// but halt error is not catchable by try-catch. +func (err *HaltError) Value() any { + return (*exitCodeError)(err).Value() +} + +// ExitCode returns the exit code of the error. +func (err *HaltError) ExitCode() int { + return (*exitCodeError)(err).ExitCode() } -func (err *funcContainsError) Error() string { - return fmt.Sprintf("cannot check contains(%s): %s", previewValue(err.r), typeErrorPreview(err.l)) +type flattenDepthError struct { + v float64 } -type hasKeyTypeError struct { - l, r interface{} +func (err *flattenDepthError) Error() string { + return "flatten depth should not be negative: " + Preview(err.v) } -func (err *hasKeyTypeError) Error() string { - return fmt.Sprintf("cannot check wether %s has a key: %s", typeErrorPreview(err.l), typeErrorPreview(err.r)) +type joinTypeError struct { + v any +} + +func (err *joinTypeError) Error() string { + return "join cannot be applied to an array including: " + typeErrorPreview(err.v) +} + +type timeArrayError struct{} + +func (err *timeArrayError) Error() string { + return "expected an array of 8 numbers" } type unaryTypeError struct { name string - v interface{} + v any } func (err *unaryTypeError) Error() string { - return fmt.Sprintf("cannot %s: %s", err.name, typeErrorPreview(err.v)) + return "cannot " + err.name + ": " + typeErrorPreview(err.v) } type binopTypeError struct { name string - l, r interface{} + l, r any } func (err *binopTypeError) Error() string { - return fmt.Sprintf("cannot %s: %s and %s", err.name, typeErrorPreview(err.l), typeErrorPreview(err.r)) + return "cannot " + err.name + ": " + typeErrorPreview(err.l) + " and " + typeErrorPreview(err.r) } type zeroDivisionError struct { - l, r interface{} + l, r any } func (err *zeroDivisionError) Error() string { - return fmt.Sprintf("cannot divide %s by: %s", typeErrorPreview(err.l), typeErrorPreview(err.r)) + return "cannot divide " + typeErrorPreview(err.l) + " by: " + typeErrorPreview(err.r) } type zeroModuloError struct { - l, r interface{} + l, r any } func (err *zeroModuloError) Error() string { - return fmt.Sprintf("cannot modulo %s by: %s", typeErrorPreview(err.l), typeErrorPreview(err.r)) + return "cannot modulo " + typeErrorPreview(err.l) + " by: " + typeErrorPreview(err.r) } type formatNotFoundError struct { @@ -165,34 +265,30 @@ type formatNotFoundError struct { } func (err *formatNotFoundError) Error() string { - return fmt.Sprintf("format not defined: %s", err.n) + return "format not defined: " + err.n } -type formatCsvTsvRowError struct { +type formatRowError struct { typ string - v interface{} + v any } -func (err *formatCsvTsvRowError) Error() string { - return fmt.Sprintf("invalid %s row: %s", err.typ, typeErrorPreview(err.v)) +func (err *formatRowError) Error() string { + return "@" + err.typ + " cannot format an array including: " + typeErrorPreview(err.v) } -type formatShError struct { - v interface{} -} +type tooManyVariableValuesError struct{} -func (err *formatShError) Error() string { - return fmt.Sprintf("cannot escape for shell: %s", typeErrorPreview(err.v)) +func (err *tooManyVariableValuesError) Error() string { + return "too many variable values provided" } -var errTooManyVariableValues = errors.New("too many variable values provided") - type expectedVariableError struct { n string } func (err *expectedVariableError) Error() string { - return fmt.Sprintf("variable defined but not bound: %s", err.n) + return "variable defined but not bound: " + err.n } type variableNotFoundError struct { @@ -200,7 +296,7 @@ type variableNotFoundError struct { } func (err *variableNotFoundError) Error() string { - return fmt.Sprintf("variable not defined: %s", err.n) + return "variable not defined: " + err.n } type variableNameError struct { @@ -213,18 +309,15 @@ func (err *variableNameError) Error() string { type breakError struct { n string + v any } func (err *breakError) Error() string { - return fmt.Sprintf(`label not defined: %q`, err.n) -} - -type stringLiteralError struct { - s string + return "label not defined: " + err.n } -func (err *stringLiteralError) Error() string { - return fmt.Sprintf("expected a string but got: %s", err.s) +func (err *breakError) ExitCode() int { + return 3 } type tryEndError struct { @@ -236,40 +329,32 @@ func (err *tryEndError) Error() string { } type invalidPathError struct { - v interface{} + v any } func (err *invalidPathError) Error() string { - return fmt.Sprintf("invalid path against: %s", typeErrorPreview(err.v)) + return "invalid path against: " + typeErrorPreview(err.v) } type invalidPathIterError struct { - v interface{} + v any } func (err *invalidPathIterError) Error() string { - return fmt.Sprintf("invalid path on iterating against: %s", typeErrorPreview(err.v)) -} - -type getpathError struct { - v, path interface{} -} - -func (err *getpathError) Error() string { - return fmt.Sprintf("cannot getpath with %s against: %s", previewValue(err.path), typeErrorPreview(err.v)) + return "invalid path on iterating against: " + typeErrorPreview(err.v) } type queryParseError struct { - typ, fname, contents string - err error + fname, contents string + err error } -func (err *queryParseError) QueryParseError() (string, string, string, error) { - return err.typ, err.fname, err.contents, err.err +func (err *queryParseError) QueryParseError() (string, string, error) { + return err.fname, err.contents, err.err } func (err *queryParseError) Error() string { - return fmt.Sprintf("invalid %s: %s: %s", err.typ, err.fname, err.err) + return "invalid query: " + err.fname + ": " + err.err.Error() } type jsonParseError struct { @@ -282,60 +367,16 @@ func (err *jsonParseError) JSONParseError() (string, string, error) { } func (err *jsonParseError) Error() string { - return fmt.Sprintf("invalid json: %s: %s", err.fname, err.err) + return "invalid json: " + err.fname + ": " + err.err.Error() } -func typeErrorPreview(v interface{}) string { - p := preview(v) - if p != "" { - p = " (" + p + ")" - } - return typeof(v) + p -} - -func typeof(v interface{}) (s string) { - if v == nil { +func typeErrorPreview(v any) string { + switch v.(type) { + case nil: return "null" - } - k := reflect.TypeOf(v).Kind() - switch k { - case reflect.Array, reflect.Slice: - return "array" - case reflect.Map: - return "object" - case reflect.Bool: - return "boolean" - case reflect.Int, reflect.Uint, reflect.Float64: - return "number" - case reflect.String: - return "string" - case reflect.Ptr: - if _, ok := v.(*big.Int); ok { - return "number" - } - return "ptr" + case Iter: + return "gojq.Iter" default: - return k.String() - } -} - -func preview(v interface{}) string { - if v == nil { - return "" - } - s, err := encodeJSON(v) - if err != nil { - return "" - } - if l := 25; len(s) > l { - s = s[:l-3] + " ..." - } - return s -} - -func previewValue(v interface{}) string { - if v == nil { - return "null" + return TypeOf(v) + " (" + Preview(v) + ")" } - return preview(v) } diff --git a/vendor/github.com/itchyny/gojq/execute.go b/vendor/github.com/itchyny/gojq/execute.go index 9401b258a2..344d8a3c57 100644 --- a/vendor/github.com/itchyny/gojq/execute.go +++ b/vendor/github.com/itchyny/gojq/execute.go @@ -1,12 +1,13 @@ package gojq import ( - "fmt" + "context" + "math" "reflect" "sort" ) -func (env *env) execute(bc *Code, v interface{}, vars ...interface{}) Iter { +func (env *env) execute(bc *Code, v any, vars ...any) Iter { env.codes = bc.codes env.codeinfos = bc.codeinfos env.push(v) @@ -17,10 +18,10 @@ func (env *env) execute(bc *Code, v interface{}, vars ...interface{}) Iter { return env } -func (env *env) Next() (interface{}, bool) { +func (env *env) Next() (any, bool) { var err error pc, callpc, index := env.pc, len(env.codes)-1, -1 - backtrack, hasCtx := env.backtrack, env.ctx != nil + backtrack, hasCtx := env.backtrack, env.ctx != context.Background() defer func() { env.pc, env.backtrack = pc, true }() loop: for ; pc < len(env.codes); pc++ { @@ -29,6 +30,7 @@ loop: if hasCtx { select { case <-env.ctx.Done(): + pc, env.forks = len(env.codes), nil return env.ctx.Err(), true default: } @@ -41,9 +43,9 @@ loop: case oppop: env.pop() case opdup: - x := env.pop() - env.push(x) - env.push(x) + v := env.pop() + env.push(v) + env.push(v) case opconst: env.pop() env.push(code.v) @@ -52,8 +54,11 @@ loop: case opstore: env.values[env.index(code.v.([2]int))] = env.pop() case opobject: + if backtrack { + break loop + } n := code.v.(int) - m := make(map[string]interface{}, n) + m := make(map[string]any, n) for i := 0; i < n; i++ { v, k := env.pop(), env.pop() s, ok := k.(string) @@ -61,12 +66,14 @@ loop: err = &objectKeyNotStringError{k} break loop } - m[s] = v + if _, ok := m[s]; !ok { + m[s] = v + } } env.push(m) case opappend: i := env.index(code.v.([2]int)) - env.values[i] = append(env.values[i].([]interface{}), env.pop()) + env.values[i] = append(env.values[i].([]any), env.pop()) case opfork: if backtrack { if err != nil { @@ -74,46 +81,38 @@ loop: } pc, backtrack = code.v.(int), false goto loop - } else { - env.pushfork(code.op, pc) } + env.pushfork(pc) case opforktrybegin: if backtrack { if err == nil { break loop } - switch er := err.(type) { + switch e := err.(type) { case *tryEndError: - err = er.err + err = e.err + break loop + case *breakError, *HaltError: break loop - case *exitCodeError: + case ValueError: env.pop() - env.push(er.value) - if er.halt { - break loop - } - if er.value == nil { - backtrack, err = true, nil - break loop - } + env.push(e.Value()) default: env.pop() env.push(err.Error()) } pc, backtrack, err = code.v.(int), false, nil goto loop - } else { - env.pushfork(code.op, pc) } + env.pushfork(pc) case opforktryend: if backtrack { if err != nil { err = &tryEndError{err} } break loop - } else { - env.pushfork(code.op, pc) } + env.pushfork(pc) case opforkalt: if backtrack { if err == nil { @@ -121,18 +120,21 @@ loop: } pc, backtrack, err = code.v.(int), false, nil goto loop - } else { - env.pushfork(code.op, pc) } + env.pushfork(pc) case opforklabel: if backtrack { - if e, ok := err.(*breakError); ok && code.v.(string) == e.n { + label := env.pop() + if e, ok := err.(*breakError); ok && e.v == label { err = nil } break loop - } else { - env.pushfork(code.op, pc) } + env.push(env.label) + env.pushfork(pc) + env.pop() + env.values[env.index(code.v.([2]int))] = env.label + env.label++ case opbacktrack: break loop case opjump: @@ -143,36 +145,83 @@ loop: pc = code.v.(int) goto loop } + case opindex, opindexarray: + if backtrack { + break loop + } + p, v := code.v, env.pop() + if code.op == opindexarray && v != nil { + if _, ok := v.([]any); !ok { + err = &expectedArrayError{v} + break loop + } + } + w := funcIndex2(nil, v, p) + if e, ok := w.(error); ok { + err = e + break loop + } + env.push(w) + if !env.paths.empty() && env.expdepth == 0 { + if !env.pathIntact(v) { + err = &invalidPathError{v} + break loop + } + env.paths.push(pathValue{path: p, value: w}) + } case opcall: + if backtrack { + break loop + } switch v := code.v.(type) { case int: pc, callpc, index = v, pc, env.scopes.index goto loop - case [3]interface{}: + case [3]any: argcnt := v[1].(int) - x, args := env.pop(), make([]interface{}, argcnt) + x, args := env.pop(), env.args[:argcnt] for i := 0; i < argcnt; i++ { args[i] = env.pop() } - w := v[0].(func(interface{}, []interface{}) interface{})(x, args) + w := v[0].(func(any, []any) any)(x, args) if e, ok := w.(error); ok { err = e break loop } env.push(w) - if !env.paths.empty() { - var ps []interface{} - ps, err = env.pathEntries(v[2].(string), x, args) - if err != nil { - break loop - } - for _, p := range ps { - env.paths.push([2]interface{}{p, w}) + if !env.paths.empty() && env.expdepth == 0 { + switch v[2].(string) { + case "_index": + if x = args[0]; !env.pathIntact(x) { + err = &invalidPathError{x} + break loop + } + env.paths.push(pathValue{path: args[1], value: w}) + case "_slice": + if x = args[0]; !env.pathIntact(x) { + err = &invalidPathError{x} + break loop + } + env.paths.push(pathValue{ + path: map[string]any{"start": args[2], "end": args[1]}, + value: w, + }) + case "getpath": + if !env.pathIntact(x) { + err = &invalidPathError{x} + break loop + } + for _, p := range args[0].([]any) { + env.paths.push(pathValue{path: p, value: w}) + } } } default: panic(v) } + case opcallrec: + pc, callpc, index = code.v.(int), -1, env.scopes.index + goto loop case oppushpc: env.push([2]int{code.v.(int), env.scopes.index}) case opcallpc: @@ -180,82 +229,102 @@ loop: pc, callpc, index = xs[0], pc, xs[1] goto loop case opscope: - xs := code.v.([2]int) - var i, l int + xs := code.v.([3]int) + var saveindex, outerindex int if index == env.scopes.index { - i = index + if callpc >= 0 { + saveindex = index + } else { + callpc, saveindex = env.popscope() + } } else { - env.scopes.save(&i, &l) + saveindex, _ = env.scopes.save() env.scopes.index = index } - env.scopes.push(scope{xs[0], env.offset, callpc, i}) + if outerindex = index; outerindex >= 0 { + if s := env.scopes.data[outerindex].value; s.id == xs[0] { + outerindex = s.outerindex + } + } + env.scopes.push(scope{xs[0], env.offset, callpc, saveindex, outerindex}) env.offset += xs[1] if env.offset > len(env.values) { - vs := make([]interface{}, env.offset*2) + vs := make([]any, env.offset*2) copy(vs, env.values) env.values = vs } case opret: - if backtrack || err != nil { + if backtrack { break loop } - s := env.scopes.pop().(scope) - pc, env.scopes.index = s.pc, s.saveindex + pc, env.scopes.index = env.popscope() if env.scopes.empty() { - return normalizeValues(env.pop()), true + return env.pop(), true } - case opeach: + case opiter: if err != nil { break loop } backtrack = false - var xs [][2]interface{} + var xs []pathValue switch v := env.pop().(type) { - case [][2]interface{}: + case []pathValue: xs = v - case []interface{}: - if !env.paths.empty() && (env.expdepth == 0 && !reflect.DeepEqual(v, env.paths.top().([2]interface{})[1])) { + case []any: + if !env.paths.empty() && env.expdepth == 0 && !env.pathIntact(v) { err = &invalidPathIterError{v} break loop } if len(v) == 0 { break loop } - xs = make([][2]interface{}, len(v)) + xs = make([]pathValue, len(v)) for i, v := range v { - xs[i] = [2]interface{}{i, v} + xs[i] = pathValue{path: i, value: v} } - case map[string]interface{}: - if !env.paths.empty() && (env.expdepth == 0 && !reflect.DeepEqual(v, env.paths.top().([2]interface{})[1])) { + case map[string]any: + if !env.paths.empty() && env.expdepth == 0 && !env.pathIntact(v) { err = &invalidPathIterError{v} break loop } if len(v) == 0 { break loop } - xs = make([][2]interface{}, len(v)) + xs = make([]pathValue, len(v)) var i int for k, v := range v { - xs[i] = [2]interface{}{k, v} + xs[i] = pathValue{path: k, value: v} i++ } sort.Slice(xs, func(i, j int) bool { - return xs[i][0].(string) < xs[j][0].(string) + return xs[i].path.(string) < xs[j].path.(string) }) + case Iter: + if w, ok := v.Next(); ok { + env.push(v) + env.pushfork(pc) + env.pop() + if e, ok := w.(error); ok { + err = e + break loop + } + env.push(w) + continue + } + break loop default: err = &iteratorError{v} + env.push(emptyIter{}) break loop } if len(xs) > 1 { env.push(xs[1:]) - env.pushfork(code.op, pc) + env.pushfork(pc) env.pop() } - env.push(xs[0][1]) - if !env.paths.empty() { - if env.expdepth == 0 { - env.paths.push(xs[0]) - } + env.push(xs[0].value) + if !env.paths.empty() && env.expdepth == 0 { + env.paths.push(xs[0]) } case opexpbegin: env.expdepth++ @@ -263,32 +332,25 @@ loop: env.expdepth-- case oppathbegin: env.paths.push(env.expdepth) - env.paths.push([2]interface{}{nil, env.stack.top()}) + env.paths.push(pathValue{value: env.stack.top()}) env.expdepth = 0 case oppathend: - if env.expdepth > 0 { - panic(fmt.Sprintf("unexpected expdepth: %d", env.expdepth)) + if backtrack { + break loop } env.pop() - x := env.pop() - if reflect.DeepEqual(x, env.paths.top().([2]interface{})[1]) { - env.push(env.poppaths()) - env.expdepth = env.paths.pop().(int) - } else { - err = &invalidPathError{x} + if v := env.pop(); !env.pathIntact(v) { + err = &invalidPathError{v} break loop } - case opdebug: - if !backtrack { - return [2]interface{}{code.v, normalizeValues(env.stack.top())}, true - } - backtrack = false + env.push(env.poppaths()) + env.expdepth = env.paths.pop().(int) default: panic(code.op) } } if len(env.forks) > 0 { - pc, backtrack = env.popfork().pc, true + pc, backtrack = env.popfork(), true goto loop } if err != nil { @@ -297,82 +359,84 @@ loop: return nil, false } -func (env *env) push(v interface{}) { +func (env *env) push(v any) { env.stack.push(v) } -func (env *env) pop() interface{} { +func (env *env) pop() any { return env.stack.pop() } -func (env *env) pushfork(op opcode, pc int) { - f := &fork{op: op, pc: pc, expdepth: env.expdepth} - env.stack.save(&f.stackindex, &f.stacklimit) - env.scopes.save(&f.scopeindex, &f.scopelimit) - env.paths.save(&f.pathindex, &f.pathlimit) +func (env *env) popscope() (int, int) { + free := env.scopes.index > env.scopes.limit + s := env.scopes.pop() + if free { + env.offset = s.offset + } + return s.pc, s.saveindex +} + +func (env *env) pushfork(pc int) { + f := fork{pc: pc, expdepth: env.expdepth} + f.stackindex, f.stacklimit = env.stack.save() + f.scopeindex, f.scopelimit = env.scopes.save() + f.pathindex, f.pathlimit = env.paths.save() env.forks = append(env.forks, f) env.debugForks(pc, ">>>") } -func (env *env) popfork() *fork { +func (env *env) popfork() int { f := env.forks[len(env.forks)-1] env.debugForks(f.pc, "<<<") env.forks, env.expdepth = env.forks[:len(env.forks)-1], f.expdepth env.stack.restore(f.stackindex, f.stacklimit) env.scopes.restore(f.scopeindex, f.scopelimit) env.paths.restore(f.pathindex, f.pathlimit) - return f + return f.pc } -func (env *env) scopeOffset(id int) int { - return env.scopes.lookup(func(v interface{}) bool { - return v.(scope).id == id - }).(scope).offset +func (env *env) index(v [2]int) int { + for id, i := v[0], env.scopes.index; i >= 0; { + s := env.scopes.data[i].value + if s.id == id { + return s.offset + v[1] + } + i = s.outerindex + } + panic("env.index") } -func (env *env) index(v [2]int) int { - return env.scopeOffset(v[0]) + v[1] +type pathValue struct { + path, value any } -func (env *env) pathEntries(name string, x interface{}, args []interface{}) ([]interface{}, error) { - switch name { - case "_index": - if env.expdepth > 0 { - return nil, nil - } else if !reflect.DeepEqual(args[0], env.paths.top().([2]interface{})[1]) { - return nil, &invalidPathError{x} - } - return []interface{}{args[1]}, nil - case "_slice": - if env.expdepth > 0 { - return nil, nil - } else if !reflect.DeepEqual(args[0], env.paths.top().([2]interface{})[1]) { - return nil, &invalidPathError{x} +func (env *env) pathIntact(v any) bool { + w := env.paths.top().(pathValue).value + switch v := v.(type) { + case []any, map[string]any: + switch w.(type) { + case []any, map[string]any: + v, w := reflect.ValueOf(v), reflect.ValueOf(w) + return v.Pointer() == w.Pointer() && v.Len() == w.Len() } - return []interface{}{map[string]interface{}{"start": args[2], "end": args[1]}}, nil - case "getpath": - if env.expdepth > 0 { - return nil, nil - } else if !reflect.DeepEqual(x, env.paths.top().([2]interface{})[1]) { - return nil, &invalidPathError{x} + case float64: + if w, ok := w.(float64); ok { + return v == w || math.IsNaN(v) && math.IsNaN(w) } - return args[0].([]interface{}), nil - default: - return nil, nil } + return v == w } -func (env *env) poppaths() []interface{} { - var xs []interface{} +func (env *env) poppaths() []any { + xs := []any{} for { - p := env.paths.pop().([2]interface{}) - if p[0] == nil { + p := env.paths.pop().(pathValue) + if p.path == nil { break } - xs = append(xs, p[0]) + xs = append(xs, p.path) } - for i := 0; i < len(xs)/2; i++ { // reverse - j := len(xs) - 1 - i + for i, j := 0, len(xs)-1; i < j; i, j = i+1, j-1 { xs[i], xs[j] = xs[j], xs[i] } return xs diff --git a/vendor/github.com/itchyny/gojq/func.go b/vendor/github.com/itchyny/gojq/func.go index 8206101b5a..165690a4fb 100644 --- a/vendor/github.com/itchyny/gojq/func.go +++ b/vendor/github.com/itchyny/gojq/func.go @@ -1,23 +1,27 @@ package gojq import ( - "bytes" "encoding/base64" "encoding/json" + "errors" "fmt" + "io" "math" "math/big" "net/url" + "reflect" "regexp" "sort" + "strconv" "strings" "time" + "unicode" + "unicode/utf8" - "github.com/lestrrat-go/strftime" - "github.com/pbnjay/strptime" + "github.com/itchyny/timefmt-go" ) -//go:generate go run _tools/gen_builtin.go -i builtin.jq -o builtin.go +//go:generate go run -modfile=go.dev.mod _tools/gen_builtin.go -i builtin.jq -o builtin.go var builtinFuncDefs map[string][]*FuncDef const ( @@ -29,11 +33,12 @@ const ( type function struct { argcount int - callback func(interface{}, []interface{}) interface{} + iter bool + callback func(any, []any) any } func (fn function) accept(cnt int) bool { - return fn.argcount&(1< 0 + return fn.argcount&(1<= 0 { return v @@ -265,254 +288,495 @@ func funcLength(v interface{}) interface{} { case float64: return math.Abs(v) case *big.Int: + if v.Sign() >= 0 { + return v + } return new(big.Int).Abs(v) - case nil: - return 0 default: - return &funcTypeError{"length", v} + return &func0TypeError{"abs", v} } } -func funcUtf8ByteLength(v interface{}) interface{} { +func funcLength(v any) any { switch v := v.(type) { + case nil: + return 0 + case int: + if v >= 0 { + return v + } + return -v + case float64: + return math.Abs(v) + case *big.Int: + if v.Sign() >= 0 { + return v + } + return new(big.Int).Abs(v) case string: - return len([]byte(v)) + return len([]rune(v)) + case []any: + return len(v) + case map[string]any: + return len(v) default: - return &funcTypeError{"utf8bytelength", v} + return &func0TypeError{"length", v} } } -func funcKeys(v interface{}) interface{} { +func funcUtf8ByteLength(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"utf8bytelength", v} + } + return len(s) +} + +func funcKeys(v any) any { switch v := v.(type) { - case []interface{}: - w := make([]interface{}, len(v)) + case []any: + w := make([]any, len(v)) for i := range v { w[i] = i } return w - case map[string]interface{}: - w := make([]string, len(v)) - var i int - for k := range v { + case map[string]any: + w := make([]any, len(v)) + for i, k := range keys(v) { w[i] = k - i++ - } - sort.Strings(w) - u := make([]interface{}, len(v)) - for i, x := range w { - u[i] = x } - return u + return w + default: + return &func0TypeError{"keys", v} + } +} + +func keys(v map[string]any) []string { + w := make([]string, len(v)) + var i int + for k := range v { + w[i] = k + i++ + } + sort.Strings(w) + return w +} + +func values(v any) ([]any, bool) { + switch v := v.(type) { + case []any: + return v, true + case map[string]any: + vs := make([]any, len(v)) + for i, k := range keys(v) { + vs[i] = v[k] + } + return vs, true default: - return &funcTypeError{"keys", v} + return nil, false } } -func funcHas(v, x interface{}) interface{} { +func funcHas(v, x any) any { switch v := v.(type) { - case []interface{}: + case []any: if x, ok := toInt(x); ok { return 0 <= x && x < len(v) } - return &hasKeyTypeError{v, x} - case map[string]interface{}: - switch x := x.(type) { - case string: + case map[string]any: + if x, ok := x.(string); ok { _, ok := v[x] return ok - default: - return &hasKeyTypeError{v, x} } - default: - return &hasKeyTypeError{v, x} + case nil: + return false } + return &func1TypeError{"has", v, x} } -func funcAdd(v interface{}) interface{} { - if vs, ok := v.(map[string]interface{}); ok { - xs := make([]string, len(vs)) - var i int - for k := range vs { - xs[i] = k - i++ +func funcToEntries(v any) any { + switch v := v.(type) { + case []any: + w := make([]any, len(v)) + for i, x := range v { + w[i] = map[string]any{"key": i, "value": x} + } + return w + case map[string]any: + w := make([]any, len(v)) + for i, k := range keys(v) { + w[i] = map[string]any{"key": k, "value": v[k]} } - sort.Strings(xs) - us := make([]interface{}, len(vs)) - for i, x := range xs { - us[i] = vs[x] + return w + default: + return &func0TypeError{"to_entries", v} + } +} + +func funcFromEntries(v any) any { + vs, ok := v.([]any) + if !ok { + return &func0TypeError{"from_entries", v} + } + w := make(map[string]any, len(vs)) + for _, v := range vs { + switch v := v.(type) { + case map[string]any: + var ( + key string + value any + ok bool + ) + for _, k := range [4]string{"key", "Key", "name", "Name"} { + if k := v[k]; k != nil && k != false { + if key, ok = k.(string); !ok { + return &func0WrapError{"from_entries", vs, &objectKeyNotStringError{k}} + } + break + } + } + if !ok { + return &func0WrapError{"from_entries", vs, &objectKeyNotStringError{nil}} + } + for _, k := range [2]string{"value", "Value"} { + if value, ok = v[k]; ok { + break + } + } + w[key] = value + default: + return &func0TypeError{"from_entries", v} } - v = us } - vs, ok := v.([]interface{}) + return w +} + +func funcAdd(v any) any { + vs, ok := values(v) if !ok { - return &funcTypeError{"add", v} + return &func0TypeError{"add", v} } v = nil for _, x := range vs { - switch y := x.(type) { - case map[string]interface{}: + switch x := x.(type) { + case nil: + continue + case string: switch w := v.(type) { case nil: - m := make(map[string]interface{}) - for k, e := range y { - m[k] = e - } - v = m + var sb strings.Builder + sb.WriteString(x) + v = &sb continue - case map[string]interface{}: - for k, e := range y { - w[k] = e - } + case *strings.Builder: + w.WriteString(x) continue } - case []interface{}: + case []any: switch w := v.(type) { case nil: - s := make([]interface{}, len(y)) - copy(s, y) + s := make([]any, len(x)) + copy(s, x) v = s continue - case []interface{}: - v = append(w, y...) + case []any: + v = append(w, x...) continue } + case map[string]any: + switch w := v.(type) { + case nil: + m := make(map[string]any, len(x)) + for k, e := range x { + m[k] = e + } + v = m + continue + case map[string]any: + for k, e := range x { + w[k] = e + } + continue + } + } + if sb, ok := v.(*strings.Builder); ok { + v = sb.String() } v = funcOpAdd(nil, v, x) if err, ok := v.(error); ok { return err } } + if sb, ok := v.(*strings.Builder); ok { + v = sb.String() + } return v } -var numberPattern = regexp.MustCompile(`^[-+]?(?:(?:\d*\.)?\d+|\d+\.)(?:[eE][-+]?\d+)?$`) - -func funcToNumber(v interface{}) interface{} { +func funcToNumber(v any) any { switch v := v.(type) { case int, float64, *big.Int: return v case string: - if !numberPattern.MatchString(v) { - return fmt.Errorf("invalid number: %q", v) + if !newLexer(v).validNumber() { + return &func0WrapError{"tonumber", v, errors.New("invalid number")} } - return normalizeNumbers(json.Number(v)) + return toNumber(v) default: - return &funcTypeError{"tonumber", v} + return &func0TypeError{"tonumber", v} } } -func funcToString(v interface{}) interface{} { +func toNumber(v string) any { + return normalizeNumber(json.Number(v)) +} + +func funcToString(v any) any { if s, ok := v.(string); ok { return s } return funcToJSON(v) } -func funcType(v interface{}) interface{} { - return typeof(v) +func funcType(v any) any { + return TypeOf(v) } -func funcReverse(v interface{}) interface{} { - vs, ok := v.([]interface{}) +func funcReverse(v any) any { + vs, ok := v.([]any) if !ok { - return &expectedArrayError{v} + return &func0TypeError{"reverse", v} } - ws := make([]interface{}, len(vs)) + ws := make([]any, len(vs)) for i, v := range vs { ws[len(ws)-i-1] = v } return ws } -func funcContains(v, x interface{}) interface{} { - switch v := v.(type) { - case nil: - if x == nil { - return true - } - case bool: - switch x := x.(type) { - case bool: - if v == x { - return true - } - } - } +func funcContains(v, x any) any { return binopTypeSwitch(v, x, - func(l, r int) interface{} { return l == r }, - func(l, r float64) interface{} { return l == r }, - func(l, r *big.Int) interface{} { return l.Cmp(r) == 0 }, - func(l, r string) interface{} { return strings.Contains(l, r) }, - func(l, r []interface{}) interface{} { - for _, x := range r { - var found bool - for _, y := range l { - if funcContains(y, x) == true { - found = true - break + func(l, r int) any { return l == r }, + func(l, r float64) any { return l == r }, + func(l, r *big.Int) any { return l.Cmp(r) == 0 }, + func(l, r string) any { return strings.Contains(l, r) }, + func(l, r []any) any { + R: + for _, r := range r { + for _, l := range l { + if funcContains(l, r) == true { + continue R } } - if !found { - return false - } + return false } return true }, - func(l, r map[string]interface{}) interface{} { - for k, rk := range r { - lk, ok := l[k] - if !ok { - return false - } - c := funcContains(lk, rk) - if _, ok := c.(error); ok { - return false - } - if c == false { + func(l, r map[string]any) any { + if len(l) < len(r) { + return false + } + for k, r := range r { + if l, ok := l[k]; !ok || funcContains(l, r) != true { return false } } return true }, - func(l, r interface{}) interface{} { return &funcContainsError{l, r} }, + func(l, r any) any { + if l == r { + return true + } + return &func1TypeError{"contains", l, r} + }, ) } -func funcExplode(v interface{}) interface{} { +func funcIndices(v, x any) any { + return indexFunc("indices", v, x, indices) +} + +func indices(vs, xs []any) any { + rs := []any{} + if len(xs) == 0 { + return rs + } + for i := 0; i <= len(vs)-len(xs); i++ { + if compare(vs[i:i+len(xs)], xs) == 0 { + rs = append(rs, i) + } + } + return rs +} + +func funcIndex(v, x any) any { + return indexFunc("index", v, x, func(vs, xs []any) any { + if len(xs) == 0 { + return nil + } + for i := 0; i <= len(vs)-len(xs); i++ { + if compare(vs[i:i+len(xs)], xs) == 0 { + return i + } + } + return nil + }) +} + +func funcRindex(v, x any) any { + return indexFunc("rindex", v, x, func(vs, xs []any) any { + if len(xs) == 0 { + return nil + } + for i := len(vs) - len(xs); i >= 0; i-- { + if compare(vs[i:i+len(xs)], xs) == 0 { + return i + } + } + return nil + }) +} + +func indexFunc(name string, v, x any, f func(_, _ []any) any) any { switch v := v.(type) { + case nil: + return nil + case []any: + switch x := x.(type) { + case []any: + return f(v, x) + default: + return f(v, []any{x}) + } case string: - return explode(v) + if x, ok := x.(string); ok { + return f(explode(v), explode(x)) + } + return &func1TypeError{name, v, x} default: - return &funcTypeError{"explode", v} + return &func1TypeError{name, v, x} } } -func explode(s string) []interface{} { - rs := []int32(s) - xs := make([]interface{}, len(rs)) - for i, r := range rs { +func funcStartsWith(v, x any) any { + s, ok := v.(string) + if !ok { + return &func1TypeError{"startswith", v, x} + } + t, ok := x.(string) + if !ok { + return &func1TypeError{"startswith", v, x} + } + return strings.HasPrefix(s, t) +} + +func funcEndsWith(v, x any) any { + s, ok := v.(string) + if !ok { + return &func1TypeError{"endswith", v, x} + } + t, ok := x.(string) + if !ok { + return &func1TypeError{"endswith", v, x} + } + return strings.HasSuffix(s, t) +} + +func funcLtrimstr(v, x any) any { + s, ok := v.(string) + if !ok { + return &func1TypeError{"ltrimstr", v, x} + } + t, ok := x.(string) + if !ok { + return &func1TypeError{"ltrimstr", v, x} + } + return strings.TrimPrefix(s, t) +} + +func funcRtrimstr(v, x any) any { + s, ok := v.(string) + if !ok { + return &func1TypeError{"rtrimstr", v, x} + } + t, ok := x.(string) + if !ok { + return &func1TypeError{"rtrimstr", v, x} + } + return strings.TrimSuffix(s, t) +} + +func funcLtrim(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"ltrim", v} + } + return strings.TrimLeftFunc(s, unicode.IsSpace) +} + +func funcRtrim(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"rtrim", v} + } + return strings.TrimRightFunc(s, unicode.IsSpace) +} + +func funcTrim(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"trim", v} + } + return strings.TrimSpace(s) +} + +func funcExplode(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"explode", v} + } + return explode(s) +} + +func explode(s string) []any { + xs := make([]any, len([]rune(s))) + var i int + for _, r := range s { xs[i] = int(r) + i++ } return xs } -func funcImplode(v interface{}) interface{} { - switch v := v.(type) { - case []interface{}: - return implode(v) - default: - return &funcTypeError{"implode", v} +func funcImplode(v any) any { + vs, ok := v.([]any) + if !ok { + return &func0TypeError{"implode", v} + } + var sb strings.Builder + sb.Grow(len(vs)) + for _, v := range vs { + if r, ok := toInt(v); ok { + if 0 <= r && r <= utf8.MaxRune { + sb.WriteRune(rune(r)) + } else { + sb.WriteRune(utf8.RuneError) + } + } else { + return &func0TypeError{"implode", vs} + } } + return sb.String() } -func funcSplit(v interface{}, args []interface{}) interface{} { +func funcSplit(v any, args []any) any { s, ok := v.(string) if !ok { - return &funcTypeError{"split", v} + return &func0TypeError{"split", v} } x, ok := args[0].(string) if !ok { - return &funcTypeError{"split", x} + return &func0TypeError{"split", x} } var ss []string if len(args) == 1 { @@ -522,7 +786,7 @@ func funcSplit(v interface{}, args []interface{}) interface{} { if args[1] != nil { v, ok := args[1].(string) if !ok { - return &funcTypeError{"split", args[1]} + return &func0TypeError{"split", args[1]} } flags = v } @@ -532,78 +796,120 @@ func funcSplit(v interface{}, args []interface{}) interface{} { } ss = r.Split(s, -1) } - xs := make([]interface{}, len(ss)) + xs := make([]any, len(ss)) for i, s := range ss { xs[i] = s } return xs } -func implode(v []interface{}) interface{} { - var rs []rune - for _, r := range v { - if r, ok := toInt(r); ok { - rs = append(rs, rune(r)) - continue +func funcASCIIDowncase(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"ascii_downcase", v} + } + return strings.Map(func(r rune) rune { + if 'A' <= r && r <= 'Z' { + return r + ('a' - 'A') + } + return r + }, s) +} + +func funcASCIIUpcase(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"ascii_upcase", v} + } + return strings.Map(func(r rune) rune { + if 'a' <= r && r <= 'z' { + return r - ('a' - 'A') } - return &funcTypeError{"implode", v} + return r + }, s) +} + +func funcToJSON(v any) any { + return jsonMarshal(v) +} + +func funcFromJSON(v any) any { + s, ok := v.(string) + if !ok { + return &func0TypeError{"fromjson", v} } - return string(rs) + var w any + dec := json.NewDecoder(strings.NewReader(s)) + dec.UseNumber() + if err := dec.Decode(&w); err != nil { + return &func0WrapError{"fromjson", v, err} + } + if _, err := dec.Token(); err != io.EOF { + return &func0TypeError{"fromjson", v} + } + return normalizeNumbers(w) } -func funcToJSON(v interface{}) interface{} { - s, err := encodeJSON(v) - if err != nil { - return err +func funcFormat(v, x any) any { + s, ok := x.(string) + if !ok { + return &func0TypeError{"format", x} } - return s + format := "@" + s + f := formatToFunc(format) + if f == nil { + return &formatNotFoundError{format} + } + return internalFuncs[f.Name].callback(v, nil) } -func encodeJSON(v interface{}) (string, error) { - buf := new(bytes.Buffer) - enc := json.NewEncoder(buf) - enc.SetEscapeHTML(false) - if err := enc.Encode(v); err != nil { - buf.Reset() - if err = enc.Encode(normalizeValues(v)); err != nil { - return "", err - } +var htmlEscaper = strings.NewReplacer( + `<`, "<", + `>`, ">", + `&`, "&", + `'`, "'", + `"`, """, +) + +func funcToHTML(v any) any { + switch x := funcToString(v).(type) { + case string: + return htmlEscaper.Replace(x) + default: + return x } - s := buf.String() - return s[:len(s)-1], nil // trim last newline character } -func funcFromJSON(v interface{}) interface{} { - switch v := v.(type) { +func funcToURI(v any) any { + switch x := funcToString(v).(type) { case string: - var w interface{} - err := json.Unmarshal([]byte(v), &w) - if err != nil { - return err - } - return w + return url.QueryEscape(x) default: - return &funcTypeError{"fromjson", v} + return x } } -func funcFormat(v, x interface{}) interface{} { - switch x := x.(type) { +func funcToURId(v any) any { + switch x := funcToString(v).(type) { case string: - fmt := "@" + x - f := formatToFunc(fmt) - if f == nil { - return &formatNotFoundError{fmt} + x, err := url.QueryUnescape(x) + if err != nil { + return &func0WrapError{"@urid", v, err} } - return internalFuncs[f.Name].callback(v, nil) + return x default: - return &funcTypeError{"format", x} + return x } } -func funcToCSV(v interface{}) interface{} { - return funcToCSVTSV("csv", v, ",", func(s string) string { - return `"` + strings.ReplaceAll(s, `"`, `""`) + `"` +var csvEscaper = strings.NewReplacer( + `"`, `""`, + "\x00", `\0`, +) + +func funcToCSV(v any) any { + return formatJoin("csv", v, ",", func(s string) string { + return `"` + csvEscaper.Replace(s) + `"` }) } @@ -612,108 +918,49 @@ var tsvEscaper = strings.NewReplacer( "\r", `\r`, "\n", `\n`, "\\", `\\`, + "\x00", `\0`, ) -func funcToTSV(v interface{}) interface{} { - return funcToCSVTSV("tsv", v, "\t", func(s string) string { - return tsvEscaper.Replace(s) - }) +func funcToTSV(v any) any { + return formatJoin("tsv", v, "\t", tsvEscaper.Replace) } -func funcToSh(v interface{}) interface{} { - var xs []interface{} - if w, ok := v.([]interface{}); ok { - xs = w - } else { - xs = []interface{}{v} - } - var s strings.Builder - for i, x := range xs { - if i > 0 { - s.WriteByte(' ') - } - switch x := x.(type) { - case map[string]interface{}, []interface{}: - return &formatShError{x} - case string: - s.WriteString("'" + strings.ReplaceAll(x, "'", `'\''`) + "'") - default: - switch v := funcToJSON(x).(type) { - case error: - return v - case string: - s.WriteString(v) - } - } - } - return s.String() -} +var shEscaper = strings.NewReplacer( + "'", `'\''`, + "\x00", `\0`, +) -func funcToCSVTSV(typ string, v interface{}, sep string, escape func(string) string) interface{} { - switch xs := v.(type) { - case []interface{}: - ys := make([]string, len(xs)) - for i, x := range xs { - y, err := toCSVTSV(typ, x, escape) - if err != nil { - return err - } - ys[i] = y - } - return strings.Join(ys, sep) - default: - return &expectedArrayError{v} +func funcToSh(v any) any { + if _, ok := v.([]any); !ok { + v = []any{v} } + return formatJoin("sh", v, " ", func(s string) string { + return "'" + shEscaper.Replace(s) + "'" + }) } -func toCSVTSV(typ string, v interface{}, escape func(string) string) (string, error) { - switch v := v.(type) { - case map[string]interface{}, []interface{}: - return "", &formatCsvTsvRowError{typ, v} - case string: - return escape(v), nil - default: - switch v := funcToJSON(v).(type) { - case error: - return "", v +func formatJoin(typ string, v any, sep string, escape func(string) string) any { + vs, ok := v.([]any) + if !ok { + return &func0TypeError{"@" + typ, v} + } + ss := make([]string, len(vs)) + for i, v := range vs { + switch v := v.(type) { + case []any, map[string]any: + return &formatRowError{typ, v} case string: - if v != "null" { - return v, nil - } - return "", nil + ss[i] = escape(v) default: - panic("unreachable") + if s := jsonMarshal(v); s != "null" || typ == "sh" { + ss[i] = s + } } } + return strings.Join(ss, sep) } -var htmlEscaper = strings.NewReplacer( - `<`, "<", - `>`, ">", - `&`, "&", - `'`, "'", - `"`, """, -) - -func funcToHTML(v interface{}) interface{} { - switch x := funcToString(v).(type) { - case string: - return htmlEscaper.Replace(x) - default: - return x - } -} - -func funcToURI(v interface{}) interface{} { - switch x := funcToString(v).(type) { - case string: - return url.QueryEscape(x) - default: - return x - } -} - -func funcToBase64(v interface{}) interface{} { +func funcToBase64(v any) any { switch x := funcToString(v).(type) { case string: return base64.StdEncoding.EncodeToString([]byte(x)) @@ -722,12 +969,15 @@ func funcToBase64(v interface{}) interface{} { } } -func funcToBase64d(v interface{}) interface{} { +func funcToBase64d(v any) any { switch x := funcToString(v).(type) { case string: - y, err := base64.StdEncoding.DecodeString(x) + if i := strings.IndexRune(x, base64.StdPadding); i >= 0 { + x = x[:i] + } + y, err := base64.RawStdEncoding.DecodeString(x) if err != nil { - return err + return &func0WrapError{"@base64d", v, err} } return string(y) default: @@ -735,65 +985,41 @@ func funcToBase64d(v interface{}) interface{} { } } -func funcIndex(_, v, x interface{}) interface{} { +func funcIndex2(_, v, x any) any { switch x := x.(type) { case string: switch v := v.(type) { case nil: return nil - case map[string]interface{}: + case map[string]any: return v[x] default: return &expectedObjectError{v} } case int, float64, *big.Int: - idx, _ := toInt(x) + i, _ := toInt(x) switch v := v.(type) { case nil: return nil - case []interface{}: - return funcIndexSlice(nil, nil, &idx, v) + case []any: + return index(v, i) case string: - switch v := funcIndexSlice(nil, nil, &idx, explode(v)).(type) { - case []interface{}: - return implode(v) - case int: - return implode([]interface{}{v}) - case nil: - return "" - default: - panic(v) - } + return indexString(v, i) default: return &expectedArrayError{v} } - case []interface{}: + case []any: switch v := v.(type) { case nil: return nil - case []interface{}: - var xs []interface{} - if len(x) == 0 { - return xs - } - for i := 0; i < len(v) && i < len(v)-len(x)+1; i++ { - var neq bool - for j, y := range x { - if neq = compare(v[i+j], y) != 0; neq { - break - } - } - if !neq { - xs = append(xs, i) - } - } - return xs + case []any: + return indices(v, x) default: return &expectedArrayError{v} } - case map[string]interface{}: + case map[string]any: if v == nil { - return v + return nil } start, ok := x["start"] if !ok { @@ -805,139 +1031,235 @@ func funcIndex(_, v, x interface{}) interface{} { } return funcSlice(nil, v, end, start) default: - return &objectKeyNotStringError{x} + switch v.(type) { + case []any: + return &arrayIndexNotNumberError{x} + case string: + return &stringIndexNotNumberError{x} + default: + return &objectKeyNotStringError{x} + } } } -func funcSlice(_, v, end, start interface{}) (r interface{}) { - if w, ok := v.(string); ok { - v = explode(w) - defer func() { - switch s := r.(type) { - case []interface{}: - r = implode(s) - case int: - r = implode([]interface{}{s}) - case nil: - r = "" - default: - panic(r) +func index(vs []any, i int) any { + i = clampIndex(i, -1, len(vs)) + if 0 <= i && i < len(vs) { + return vs[i] + } + return nil +} + +func indexString(s string, i int) any { + l := len([]rune(s)) + i = clampIndex(i, -1, l) + if 0 <= i && i < l { + for _, r := range s { + if i--; i < 0 { + return string(r) } - }() + } } + return nil +} + +func funcSlice(_, v, e, s any) (r any) { switch v := v.(type) { case nil: return nil - case []interface{}: - if start != nil { - if start, ok := toInt(start); ok { - if end != nil { - if end, ok := toInt(end); ok { - return funcIndexSlice(&start, &end, nil, v) - } - return &arrayIndexNotNumberError{end} - } - return funcIndexSlice(&start, nil, nil, v) - } - return &arrayIndexNotNumberError{start} - } - if end != nil { - if end, ok := toInt(end); ok { - return funcIndexSlice(nil, &end, nil, v) - } - return &arrayIndexNotNumberError{end} - } - return v + case []any: + return slice(v, e, s) + case string: + return sliceString(v, e, s) default: return &expectedArrayError{v} } } -func funcIndexSlice(start, end, index *int, a []interface{}) interface{} { - aa := a - if index != nil { - i := toIndex(aa, *index) - if i < 0 { - return nil +func slice(vs []any, e, s any) any { + var start, end int + if s != nil { + if i, ok := toInt(s); ok { + start = clampIndex(i, 0, len(vs)) + } else { + return &arrayIndexNotNumberError{s} + } + } + if e != nil { + if i, ok := toInt(e); ok { + end = clampIndex(i, start, len(vs)) + } else { + return &arrayIndexNotNumberError{e} + } + } else { + end = len(vs) + } + return vs[start:end] +} + +func sliceString(v string, e, s any) any { + var start, end int + l := len([]rune(v)) + if s != nil { + if i, ok := toInt(s); ok { + start = clampIndex(i, 0, l) + } else { + return &stringIndexNotNumberError{s} } - return a[i] } - if end != nil { - i := toIndex(aa, *end) - if i == -1 { - i = len(a) - } else if i == -2 { - i = 0 + if e != nil { + if i, ok := toInt(e); ok { + end = clampIndex(i, start, l) + } else { + return &stringIndexNotNumberError{e} + } + } else { + end = l + } + if start < l { + for i := range v { + if start--; start < 0 { + start = i + break + } } - a = a[:i] + } else { + start = len(v) } - if start != nil { - i := toIndex(aa, *start) - if i == -1 || len(a) < i { - i = len(a) - } else if i == -2 { - i = 0 + if end < l { + for i := range v { + if end--; end < 0 { + end = i + break + } } - a = a[i:] + } else { + end = len(v) } - return a + return v[start:end] } -func toIndex(a []interface{}, i int) int { - l := len(a) - switch { - case i < -l: - return -2 - case i < 0: - return l + i - case i < l: +func clampIndex(i, min, max int) int { + if i < 0 { + i += max + } + if i < min { + return min + } else if i < max { return i - default: - return -1 + } else { + return max } } -func funcBreak(x interface{}) interface{} { - return &breakError{x.(string)} +func funcFlatten(v any, args []any) any { + vs, ok := values(v) + if !ok { + return &func0TypeError{"flatten", v} + } + var depth float64 + if len(args) == 0 { + depth = -1 + } else { + depth, ok = toFloat(args[0]) + if !ok { + return &func0TypeError{"flatten", args[0]} + } + if depth < 0 { + return &flattenDepthError{depth} + } + } + return flatten([]any{}, vs, depth) +} + +func flatten(xs, vs []any, depth float64) []any { + for _, v := range vs { + if vs, ok := v.([]any); ok && depth != 0 { + xs = flatten(xs, vs, depth-1) + } else { + xs = append(xs, v) + } + } + return xs +} + +type rangeIter struct { + value, end, step any +} + +func (iter *rangeIter) Next() (any, bool) { + if compare(iter.step, 0)*compare(iter.value, iter.end) >= 0 { + return nil, false + } + v := iter.value + iter.value = funcOpAdd(nil, v, iter.step) + return v, true +} + +func funcRange(_ any, xs []any) any { + for _, x := range xs { + switch x.(type) { + case int, float64, *big.Int: + default: + return &func0TypeError{"range", x} + } + } + return &rangeIter{xs[0], xs[1], xs[2]} } -func funcMinBy(v, x interface{}) interface{} { - vs, ok := v.([]interface{}) +func funcMin(v any) any { + vs, ok := v.([]any) if !ok { - return &expectedArrayError{v} + return &func0TypeError{"min", v} } - xs, ok := x.([]interface{}) + return minMaxBy(vs, vs, true) +} + +func funcMinBy(v, x any) any { + vs, ok := v.([]any) if !ok { - return &expectedArrayError{x} + return &func1TypeError{"min_by", v, x} + } + xs, ok := x.([]any) + if !ok { + return &func1TypeError{"min_by", v, x} } if len(vs) != len(xs) { - panic("length mismatch in min_by") + return &func1WrapError{"min_by", v, x, &lengthMismatchError{}} } - return funcMinMaxBy(vs, xs, true) + return minMaxBy(vs, xs, true) } -func funcMaxBy(v, x interface{}) interface{} { - vs, ok := v.([]interface{}) +func funcMax(v any) any { + vs, ok := v.([]any) if !ok { - return &expectedArrayError{v} + return &func0TypeError{"max", v} } - xs, ok := x.([]interface{}) + return minMaxBy(vs, vs, false) +} + +func funcMaxBy(v, x any) any { + vs, ok := v.([]any) if !ok { - return &expectedArrayError{x} + return &func1TypeError{"max_by", v, x} + } + xs, ok := x.([]any) + if !ok { + return &func1TypeError{"max_by", v, x} } if len(vs) != len(xs) { - panic("length mismatch in max_by") + return &func1WrapError{"max_by", v, x, &lengthMismatchError{}} } - return funcMinMaxBy(vs, xs, false) + return minMaxBy(vs, xs, false) } -func funcMinMaxBy(vs, xs []interface{}, isMin bool) interface{} { +func minMaxBy(vs, xs []any, isMin bool) any { if len(vs) == 0 { return nil } i, j, x := 0, 0, xs[0] for i++; i < len(xs); i++ { - if (compare(x, xs[i]) > 0) == isMin { + if compare(x, xs[i]) > 0 == isMin { j, x = i, xs[i] } } @@ -945,45 +1267,86 @@ func funcMinMaxBy(vs, xs []interface{}, isMin bool) interface{} { } type sortItem struct { - value, key interface{} + value, key any } -func funcSortBy(v, x interface{}) interface{} { - items, err := sortItems(v, x) +func sortItems(name string, v, x any) ([]*sortItem, error) { + vs, ok := v.([]any) + if !ok { + if strings.HasSuffix(name, "_by") { + return nil, &func1TypeError{name, v, x} + } + return nil, &func0TypeError{name, v} + } + xs, ok := x.([]any) + if !ok { + return nil, &func1TypeError{name, v, x} + } + if len(vs) != len(xs) { + return nil, &func1WrapError{name, v, x, &lengthMismatchError{}} + } + items := make([]*sortItem, len(vs)) + for i, v := range vs { + items[i] = &sortItem{v, xs[i]} + } + sort.SliceStable(items, func(i, j int) bool { + return compare(items[i].key, items[j].key) < 0 + }) + return items, nil +} + +func funcSort(v any) any { + return sortBy("sort", v, v) +} + +func funcSortBy(v, x any) any { + return sortBy("sort_by", v, x) +} + +func sortBy(name string, v, x any) any { + items, err := sortItems(name, v, x) if err != nil { return err } - rs := make([]interface{}, len(items)) + rs := make([]any, len(items)) for i, x := range items { rs[i] = x.value } return rs } -func funcGroupBy(v, x interface{}) interface{} { - items, err := sortItems(v, x) +func funcGroupBy(v, x any) any { + items, err := sortItems("group_by", v, x) if err != nil { return err } - var rs []interface{} - var last interface{} + rs := []any{} + var last any for i, r := range items { if i == 0 || compare(last, r.key) != 0 { - rs, last = append(rs, []interface{}{r.value}), r.key + rs, last = append(rs, []any{r.value}), r.key } else { - rs[len(rs)-1] = append(rs[len(rs)-1].([]interface{}), r.value) + rs[len(rs)-1] = append(rs[len(rs)-1].([]any), r.value) } } return rs } -func funcUniqueBy(v, x interface{}) interface{} { - items, err := sortItems(v, x) +func funcUnique(v any) any { + return uniqueBy("unique", v, v) +} + +func funcUniqueBy(v, x any) any { + return uniqueBy("unique_by", v, x) +} + +func uniqueBy(name string, v, x any) any { + items, err := sortItems(name, v, x) if err != nil { return err } - var rs []interface{} - var last interface{} + rs := []any{} + var last any for i, r := range items { if i == 0 || compare(last, r.key) != 0 { rs, last = append(rs, r.value), r.key @@ -992,30 +1355,41 @@ func funcUniqueBy(v, x interface{}) interface{} { return rs } -func sortItems(v, x interface{}) ([]*sortItem, error) { - vs, ok := v.([]interface{}) +func funcJoin(v, x any) any { + vs, ok := values(v) if !ok { - return nil, &expectedArrayError{v} + return &func1TypeError{"join", v, x} } - xs, ok := x.([]interface{}) - if !ok { - return nil, &expectedArrayError{x} + if len(vs) == 0 { + return "" } - if len(vs) != len(xs) { - panic("length mismatch") + sep, ok := x.(string) + if len(vs) > 1 && !ok { + return &func1TypeError{"join", v, x} } - items := make([]*sortItem, len(vs)) + ss := make([]string, len(vs)) for i, v := range vs { - items[i] = &sortItem{v, xs[i]} + switch v := v.(type) { + case nil: + case string: + ss[i] = v + case bool: + if v { + ss[i] = "true" + } else { + ss[i] = "false" + } + case int, float64, *big.Int: + ss[i] = jsonMarshal(v) + default: + return &joinTypeError{v} + } } - sort.SliceStable(items, func(i, j int) bool { - return compare(items[i].key, items[j].key) < 0 - }) - return items, nil + return strings.Join(ss, sep) } func funcSignificand(v float64) float64 { - if math.IsNaN(v) || isinf(v) || v == 0.0 { + if math.IsNaN(v) || math.IsInf(v, 0) || v == 0.0 { return v } return math.Float64frombits((math.Float64bits(v) & 0x800fffffffffffff) | 0x3ff0000000000000) @@ -1025,27 +1399,27 @@ func funcExp10(v float64) float64 { return math.Pow(10, v) } -func funcLgamma(v float64) float64 { - v, _ = math.Lgamma(v) - return v -} - -func funcFrexp(v interface{}) interface{} { +func funcFrexp(v any) any { x, ok := toFloat(v) if !ok { - return &funcTypeError{"frexp", v} + return &func0TypeError{"frexp", v} } f, e := math.Frexp(x) - return []interface{}{f, e} + return []any{f, e} } -func funcModf(v interface{}) interface{} { +func funcModf(v any) any { x, ok := toFloat(v) if !ok { - return &funcTypeError{"modf", v} + return &func0TypeError{"modf", v} } i, f := math.Modf(x) - return []interface{}{f, i} + return []any{f, i} +} + +func funcLgamma(v float64) float64 { + v, _ = math.Lgamma(v) + return v } func funcDrem(l, r float64) float64 { @@ -1064,291 +1438,392 @@ func funcLdexp(l, r float64) float64 { return math.Ldexp(l, int(r)) } -func funcScalb(l, r float64) float64 { - return l * math.Pow(2, r) -} - -func funcScalbln(l, r float64) float64 { - return l * math.Pow(2, r) -} - func funcYn(l, r float64) float64 { return math.Yn(int(l), r) } -func funcFma(x, y, z float64) float64 { - return x*y + z +func funcInfinite(any) any { + return math.Inf(1) } -func funcInfinite(interface{}) interface{} { - return math.MaxFloat64 -} - -func funcIsfinite(v interface{}) interface{} { - return typeof(v) == "number" && !funcIsinfinite(v).(bool) -} - -func funcIsinfinite(v interface{}) interface{} { +func funcIsfinite(v any) any { x, ok := toFloat(v) - return ok && isinf(x) + return ok && !math.IsInf(x, 0) } -func isinf(f float64) bool { - return f >= math.MaxFloat64 || f <= -math.MaxFloat64 +func funcIsinfinite(v any) any { + x, ok := toFloat(v) + return ok && math.IsInf(x, 0) } -func funcNan(interface{}) interface{} { +func funcNan(any) any { return math.NaN() } -func funcIsnan(v interface{}) interface{} { +func funcIsnan(v any) any { x, ok := toFloat(v) if !ok { if v == nil { return false } - return &funcTypeError{"isnan", v} + return &func0TypeError{"isnan", v} } return math.IsNaN(x) } -func funcIsnormal(v interface{}) interface{} { - x, ok := toFloat(v) - return ok && !math.IsNaN(x) && !isinf(x) && x != 0.0 +func funcIsnormal(v any) any { + if v, ok := toFloat(v); ok { + e := math.Float64bits(v) & 0x7ff0000000000000 >> 52 + return 0 < e && e < 0x7ff + } + return false } -func funcSetpath(v, p, w interface{}) interface{} { - path, ok := p.([]interface{}) - if !ok { - return &funcTypeError{"setpath", p} +// An `allocator` creates new maps and slices, stores the allocated addresses. +// This allocator is used to reduce allocations on assignment operator (`=`), +// update-assignment operator (`|=`), and the `map_values`, `del`, `delpaths` +// functions. +type allocator map[uintptr]struct{} + +func funcAllocator(any, []any) any { + return allocator{} +} + +func (a allocator) allocated(v any) bool { + _, ok := a[reflect.ValueOf(v).Pointer()] + return ok +} + +func (a allocator) makeObject(l int) map[string]any { + v := make(map[string]any, l) + if a != nil { + a[reflect.ValueOf(v).Pointer()] = struct{}{} } - var err error - if v, err = updatePaths(v, path, w, false); err != nil { - if err, ok := err.(*funcTypeError); ok { - err.name = "setpath" - } - return err + return v +} + +func (a allocator) makeArray(l, c int) []any { + if c < l { + c = l + } + v := make([]any, l, c) + if a != nil { + a[reflect.ValueOf(v).Pointer()] = struct{}{} } return v } -func funcDelpaths(v, p interface{}) interface{} { - paths, ok := p.([]interface{}) +func funcSetpath(v, p, n any) any { + // There is no need to use an allocator on a single update. + return setpath(v, p, n, nil) +} + +// Used in compiler#compileAssign and compiler#compileModify. +func funcSetpathWithAllocator(v any, args []any) any { + return setpath(v, args[0], args[1], args[2].(allocator)) +} + +func setpath(v, p, n any, a allocator) any { + path, ok := p.([]any) + if !ok { + return &func1TypeError{"setpath", v, p} + } + u, err := update(v, path, n, a) + if err != nil { + return &func2WrapError{"setpath", v, p, n, err} + } + return u +} + +func funcDelpaths(v, p any) any { + return delpaths(v, p, allocator{}) +} + +// Used in compiler#compileAssign and compiler#compileModify. +func funcDelpathsWithAllocator(v any, args []any) any { + return delpaths(v, args[0], args[1].(allocator)) +} + +func delpaths(v, p any, a allocator) any { + paths, ok := p.([]any) if !ok { - return &funcTypeError{"delpaths", p} + return &func1TypeError{"delpaths", v, p} + } + if len(paths) == 0 { + return v } // Fills the paths with an empty value and then delete them. We cannot delete // in each loop because array indices should not change. For example, // jq -n "[0, 1, 2, 3] | delpaths([[1], [2]])" #=> [0, 3]. var empty struct{} var err error - for _, p := range paths { - path, ok := p.([]interface{}) + u := v + for _, q := range paths { + path, ok := q.([]any) if !ok { - return &funcTypeError{"delpaths", p} + return &func1WrapError{"delpaths", v, p, &expectedArrayError{q}} } - if v, err = updatePaths(v, path, empty, true); err != nil { - return err + u, err = update(u, path, empty, a) + if err != nil { + return &func1WrapError{"delpaths", v, p, err} } } - return deleteEmpty(v) + return deleteEmpty(u) } -func updatePaths(v interface{}, path []interface{}, w interface{}, delpaths bool) (interface{}, error) { +func update(v any, path []any, n any, a allocator) (any, error) { if len(path) == 0 { - return w, nil + return n, nil } - switch x := path[0].(type) { + switch p := path[0].(type) { case string: - if v == nil { - if delpaths { - return v, nil - } - v = make(map[string]interface{}) - } - switch uu := v.(type) { - case map[string]interface{}: - if _, ok := uu[x]; !ok && delpaths { - return v, nil - } - u, err := updatePaths(uu[x], path[1:], w, delpaths) - if err != nil { - return nil, err - } - vs := make(map[string]interface{}, len(uu)) - for k, v := range uu { - vs[k] = v - } - vs[x] = u - return vs, nil + switch v := v.(type) { + case nil: + return updateObject(nil, p, path[1:], n, a) + case map[string]any: + return updateObject(v, p, path[1:], n, a) + case struct{}: + return v, nil default: return nil, &expectedObjectError{v} } case int, float64, *big.Int: - if v == nil { - if delpaths { - return v, nil - } - v = []interface{}{} - } - switch uu := v.(type) { - case []interface{}: - y, _ := toInt(x) - l := len(uu) - var copied bool - if copied = y >= l; copied { - if delpaths { - return v, nil - } - if y > 0x3ffffff { - return nil, &arrayIndexTooLargeError{y} - } - l = y + 1 - ys := make([]interface{}, l) - copy(ys, uu) - uu = ys - } else if y < -l { - if delpaths { - return v, nil - } - return nil, &funcTypeError{v: y} - } else if y < 0 { - y += l - } - u, err := updatePaths(uu[y], path[1:], w, delpaths) - if err != nil { - return nil, err - } - if copied { - uu[y] = u - return uu, nil - } - vs := make([]interface{}, l) - copy(vs, uu) - vs[y] = u - return vs, nil + i, _ := toInt(p) + switch v := v.(type) { + case nil: + return updateArrayIndex(nil, i, path[1:], n, a) + case []any: + return updateArrayIndex(v, i, path[1:], n, a) + case struct{}: + return v, nil default: return nil, &expectedArrayError{v} } - case map[string]interface{}: - if len(x) == 0 { - switch v.(type) { - case []interface{}: - return nil, &arrayIndexNotNumberError{x} - default: - return nil, &objectKeyNotStringError{x} - } - } - if v == nil { - v = []interface{}{} - } - switch uu := v.(type) { - case []interface{}: - var start, end int - if x, ok := toInt(x["start"]); ok { - x := toIndex(uu, x) - if x > len(uu) || x == -1 { - start = len(uu) - } else if x == -2 { - start = 0 - } else { - start = x - } - } - if x, ok := toInt(x["end"]); ok { - x := toIndex(uu, x) - if x == -1 { - end = len(uu) - } else if x < start { - end = start - } else { - end = x - } - } else { - end = len(uu) - } - if delpaths { - if start >= end { - return uu, nil - } - if len(path) > 1 { - u, err := updatePaths(uu[start:end], path[1:], w, delpaths) - if err != nil { - return nil, err - } - switch us := u.(type) { - case []interface{}: - vs := make([]interface{}, len(uu)) - copy(vs, uu) - copy(vs[start:end], us) - return vs, nil - default: - return nil, &expectedArrayError{u} - } - } - vs := make([]interface{}, len(uu)) - copy(vs, uu) - for y := start; y < end; y++ { - vs[y] = w - } - return vs, nil - } - if len(path) > 1 { - u, err := updatePaths(uu[start:end], path[1:], w, delpaths) - if err != nil { - return nil, err - } - w = u - } - switch v := w.(type) { - case []interface{}: - vs := make([]interface{}, start+len(v)+len(uu)-end) - copy(vs, uu[:start]) - copy(vs[start:], v) - copy(vs[start+len(v):], uu[end:]) - return vs, nil - default: - return nil, &expectedArrayError{v} - } + case map[string]any: + switch v := v.(type) { + case nil: + return updateArraySlice(nil, p, path[1:], n, a) + case []any: + return updateArraySlice(v, p, path[1:], n, a) + case struct{}: + return v, nil default: return nil, &expectedArrayError{v} } default: switch v.(type) { - case []interface{}: - return nil, &arrayIndexNotNumberError{x} + case []any: + return nil, &arrayIndexNotNumberError{p} default: - return nil, &objectKeyNotStringError{x} + return nil, &objectKeyNotStringError{p} + } + } +} + +func updateObject(v map[string]any, k string, path []any, n any, a allocator) (any, error) { + x, ok := v[k] + if !ok && n == struct{}{} { + return v, nil + } + u, err := update(x, path, n, a) + if err != nil { + return nil, err + } + if a.allocated(v) { + v[k] = u + return v, nil + } + w := a.makeObject(len(v) + 1) + for k, v := range v { + w[k] = v + } + w[k] = u + return w, nil +} + +func updateArrayIndex(v []any, i int, path []any, n any, a allocator) (any, error) { + var x any + if j := clampIndex(i, -1, len(v)); j < 0 { + if n == struct{}{} { + return v, nil + } + return nil, &arrayIndexNegativeError{i} + } else if j < len(v) { + i = j + x = v[i] + } else { + if n == struct{}{} { + return v, nil + } + if i >= 0x8000000 { + return nil, &arrayIndexTooLargeError{i} + } + } + u, err := update(x, path, n, a) + if err != nil { + return nil, err + } + l, c := len(v), cap(v) + if a.allocated(v) { + if i < c { + if i >= l { + v = v[:i+1] + } + v[i] = u + return v, nil + } + c *= 2 + } + if i >= l { + l = i + 1 + } + w := a.makeArray(l, c) + copy(w, v) + w[i] = u + return w, nil +} + +func updateArraySlice(v []any, m map[string]any, path []any, n any, a allocator) (any, error) { + s, ok := m["start"] + if !ok { + return nil, &expectedStartEndError{m} + } + e, ok := m["end"] + if !ok { + return nil, &expectedStartEndError{m} + } + var start, end int + if i, ok := toInt(s); ok { + start = clampIndex(i, 0, len(v)) + } + if i, ok := toInt(e); ok { + end = clampIndex(i, start, len(v)) + } else { + end = len(v) + } + if start == end && n == struct{}{} { + return v, nil + } + u, err := update(v[start:end], path, n, a) + if err != nil { + return nil, err + } + switch u := u.(type) { + case []any: + var w []any + if len(u) == end-start && a.allocated(v) { + w = v + } else { + w = a.makeArray(len(v)-(end-start)+len(u), 0) + copy(w, v[:start]) + copy(w[start+len(u):], v[end:]) + } + copy(w[start:], u) + return w, nil + case struct{}: + var w []any + if a.allocated(v) { + w = v + } else { + w = a.makeArray(len(v), 0) + copy(w, v) + } + for i := start; i < end; i++ { + w[i] = u + } + return w, nil + default: + return nil, &expectedArrayError{u} + } +} + +func deleteEmpty(v any) any { + switch v := v.(type) { + case struct{}: + return nil + case map[string]any: + for k, w := range v { + if w == struct{}{} { + delete(v, k) + } else { + v[k] = deleteEmpty(w) + } + } + return v + case []any: + var j int + for _, w := range v { + if w != struct{}{} { + v[j] = deleteEmpty(w) + j++ + } } + for i := j; i < len(v); i++ { + v[i] = nil + } + return v[:j] + default: + return v } } -func funcGetpath(v, p interface{}) interface{} { - keys, ok := p.([]interface{}) +func funcGetpath(v, p any) any { + path, ok := p.([]any) if !ok { - return &funcTypeError{"getpath", p} + return &func1TypeError{"getpath", v, p} } u := v - for _, x := range keys { + for _, x := range path { switch v.(type) { - case map[string]interface{}: - case []interface{}: - case nil: + case nil, []any, map[string]any: + v = funcIndex2(nil, v, x) + if err, ok := v.(error); ok { + return &func1WrapError{"getpath", u, p, err} + } default: - return &getpathError{u, p} - } - v = funcIndex(nil, v, x) - if _, ok := v.(error); ok { - return &getpathError{u, p} + return &func1TypeError{"getpath", u, p} } } return v } -func funcBsearch(v, t interface{}) interface{} { - vs, ok := v.([]interface{}) +func funcTranspose(v any) any { + vss, ok := v.([]any) + if !ok { + return &func0TypeError{"transpose", v} + } + if len(vss) == 0 { + return []any{} + } + var l int + for _, vs := range vss { + vs, ok := vs.([]any) + if !ok { + return &func0TypeError{"transpose", v} + } + if k := len(vs); l < k { + l = k + } + } + wss := make([][]any, l) + xs := make([]any, l) + for i, k := 0, len(vss); i < l; i++ { + s := make([]any, k) + wss[i] = s + xs[i] = s + } + for i, vs := range vss { + for j, v := range vs.([]any) { + wss[j][i] = v + } + } + return xs +} + +func funcBsearch(v, t any) any { + vs, ok := v.([]any) if !ok { - return &funcTypeError{"bsearch", v} + return &func1TypeError{"bsearch", v, t} } i := sort.Search(len(vs), func(i int) bool { return compare(vs[i], t) >= 0 @@ -1359,23 +1834,23 @@ func funcBsearch(v, t interface{}) interface{} { return -i - 1 } -func funcGmtime(v interface{}) interface{} { +func funcGmtime(v any) any { if v, ok := toFloat(v); ok { return epochToArray(v, time.UTC) } - return &funcTypeError{"gmtime", v} + return &func0TypeError{"gmtime", v} } -func funcLocaltime(v interface{}) interface{} { +func funcLocaltime(v any) any { if v, ok := toFloat(v); ok { return epochToArray(v, time.Local) } - return &funcTypeError{"localtime", v} + return &func0TypeError{"localtime", v} } -func epochToArray(v float64, loc *time.Location) []interface{} { +func epochToArray(v float64, loc *time.Location) []any { t := time.Unix(int64(v), int64((v-math.Floor(v))*1e9)).In(loc) - return []interface{}{ + return []any{ t.Year(), int(t.Month()) - 1, t.Day(), @@ -1387,138 +1862,143 @@ func epochToArray(v float64, loc *time.Location) []interface{} { } } -func funcMktime(v interface{}) interface{} { - if a, ok := v.([]interface{}); ok { - t, err := arrayToTime("mktime", a, time.UTC) - if err != nil { - return err - } - return float64(t.Unix()) +func funcMktime(v any) any { + a, ok := v.([]any) + if !ok { + return &func0TypeError{"mktime", v} + } + t, err := arrayToTime(a, time.UTC) + if err != nil { + return &func0WrapError{"mktime", v, err} } - return &funcTypeError{"mktime", v} + return timeToEpoch(t) } -func funcStrftime(v, x interface{}) interface{} { +func timeToEpoch(t time.Time) float64 { + return float64(t.Unix()) + float64(t.Nanosecond())/1e9 +} + +func funcStrftime(v, x any) any { if w, ok := toFloat(v); ok { v = epochToArray(w, time.UTC) } - if a, ok := v.([]interface{}); ok { - if format, ok := x.(string); ok { - t, err := arrayToTime("strftime", a, time.UTC) - if err != nil { - return err - } - got, err := strftime.Format(format, t) - if err != nil { - return err - } - return got - } - return &funcTypeError{"strftime", x} + a, ok := v.([]any) + if !ok { + return &func1TypeError{"strftime", v, x} + } + format, ok := x.(string) + if !ok { + return &func1TypeError{"strftime", v, x} + } + t, err := arrayToTime(a, time.UTC) + if err != nil { + return &func1WrapError{"strftime", v, x, err} } - return &funcTypeError{"strftime", v} + return timefmt.Format(t, format) } -func funcStrflocaltime(v, x interface{}) interface{} { +func funcStrflocaltime(v, x any) any { if w, ok := toFloat(v); ok { v = epochToArray(w, time.Local) } - if a, ok := v.([]interface{}); ok { - if format, ok := x.(string); ok { - t, err := arrayToTime("strflocaltime", a, time.Local) - if err != nil { - return err - } - got, err := strftime.Format(format, t) - if err != nil { - return err - } - return got - } - return &funcTypeError{"strflocaltime", x} + a, ok := v.([]any) + if !ok { + return &func1TypeError{"strflocaltime", v, x} + } + format, ok := x.(string) + if !ok { + return &func1TypeError{"strflocaltime", v, x} + } + t, err := arrayToTime(a, time.Local) + if err != nil { + return &func1WrapError{"strflocaltime", v, x, err} } - return &funcTypeError{"strflocaltime", v} + return timefmt.Format(t, format) } -func funcStrptime(v, x interface{}) interface{} { - if v, ok := v.(string); ok { - if format, ok := x.(string); ok { - t, err := strptime.Parse(v, format) - if err != nil { - return err - } - var s time.Time - if t == s { - return &funcTypeError{"strptime", v} - } - return epochToArray(float64(t.Unix())+float64(t.Nanosecond())/1e9, time.UTC) - } - return &funcTypeError{"strptime", x} +func funcStrptime(v, x any) any { + s, ok := v.(string) + if !ok { + return &func1TypeError{"strptime", v, x} + } + format, ok := x.(string) + if !ok { + return &func1TypeError{"strptime", v, x} + } + t, err := timefmt.Parse(s, format) + if err != nil { + return &func1WrapError{"strptime", v, x, err} } - return &funcTypeError{"strptime", v} + var u time.Time + if t == u { + return &func1TypeError{"strptime", v, x} + } + return epochToArray(timeToEpoch(t), time.UTC) } -func arrayToTime(name string, a []interface{}, loc *time.Location) (time.Time, error) { +func arrayToTime(a []any, loc *time.Location) (time.Time, error) { var t time.Time if len(a) != 8 { - return t, &funcTypeError{name, a} + return t, &timeArrayError{} } var y, m, d, h, min, sec, nsec int - if x, ok := toInt(a[0]); ok { - y = x - } else { - return t, &funcTypeError{name, a} + var ok bool + if y, ok = toInt(a[0]); !ok { + return t, &timeArrayError{} } - if x, ok := toInt(a[1]); ok { - m = x + 1 + if m, ok = toInt(a[1]); ok { + m++ } else { - return t, &funcTypeError{name, a} + return t, &timeArrayError{} } - if x, ok := toInt(a[2]); ok { - d = x - } else { - return t, &funcTypeError{name, a} + if d, ok = toInt(a[2]); !ok { + return t, &timeArrayError{} } - if x, ok := toInt(a[3]); ok { - h = x - } else { - return t, &funcTypeError{name, a} + if h, ok = toInt(a[3]); !ok { + return t, &timeArrayError{} } - if x, ok := toInt(a[4]); ok { - min = x - } else { - return t, &funcTypeError{name, a} + if min, ok = toInt(a[4]); !ok { + return t, &timeArrayError{} } if x, ok := toFloat(a[5]); ok { sec = int(x) nsec = int((x - math.Floor(x)) * 1e9) } else { - return t, &funcTypeError{name, a} + return t, &timeArrayError{} + } + if _, ok = toFloat(a[6]); !ok { + return t, &timeArrayError{} + } + if _, ok = toFloat(a[7]); !ok { + return t, &timeArrayError{} } return time.Date(y, time.Month(m), d, h, min, sec, nsec, loc), nil } -func funcNow(interface{}) interface{} { - t := time.Now() - return float64(t.Unix()) + float64(t.Nanosecond())/1e9 +func funcNow(any) any { + return timeToEpoch(time.Now()) } -func funcMatch(v, re, fs, testing interface{}) interface{} { +func funcMatch(v, re, fs, testing any) any { + name := "match" + if testing == true { + name = "test" + } var flags string if fs != nil { v, ok := fs.(string) if !ok { - return &funcTypeError{"match", fs} + return &func2TypeError{name, v, re, fs} } flags = v } s, ok := v.(string) if !ok { - return &funcTypeError{"match", v} + return &func2TypeError{name, v, re, fs} } restr, ok := re.(string) if !ok { - return &funcTypeError{"match", v} + return &func2TypeError{name, v, re, fs} } r, err := compileRegexp(restr, flags) if err != nil { @@ -1536,16 +2016,16 @@ func funcMatch(v, re, fs, testing interface{}) interface{} { xs = [][]int{got} } } - res, names := make([]interface{}, len(xs)), r.SubexpNames() + res, names := make([]any, len(xs)), r.SubexpNames() for i, x := range xs { - captures := make([]interface{}, (len(x)-2)/2) + captures := make([]any, (len(x)-2)/2) for j := 1; j < len(x)/2; j++ { - var name interface{} + var name any if n := names[j]; n != "" { name = n } if x[j*2] < 0 { - captures[j-1] = map[string]interface{}{ + captures[j-1] = map[string]any{ "name": name, "offset": -1, "length": 0, @@ -1553,14 +2033,14 @@ func funcMatch(v, re, fs, testing interface{}) interface{} { } continue } - captures[j-1] = map[string]interface{}{ + captures[j-1] = map[string]any{ "name": name, "offset": len([]rune(s[:x[j*2]])), "length": len([]rune(s[:x[j*2+1]])) - len([]rune(s[:x[j*2]])), "string": s[x[j*2]:x[j*2+1]], } } - res[i] = map[string]interface{}{ + res[i] = map[string]any{ "offset": len([]rune(s[:x[0]])), "length": len([]rune(s[:x[1]])) - len([]rune(s[:x[0]])), "string": s[x[0]:x[1]], @@ -1571,6 +2051,11 @@ func funcMatch(v, re, fs, testing interface{}) interface{} { } func compileRegexp(re, flags string) (*regexp.Regexp, error) { + if strings.IndexFunc(flags, func(r rune) bool { + return r != 'g' && r != 'i' && r != 'm' + }) >= 0 { + return nil, fmt.Errorf("unsupported regular expression flag: %q", flags) + } re = strings.ReplaceAll(re, "(?<", "(?P<") if strings.ContainsRune(flags, 'i') { re = "(?i)" + re @@ -1580,88 +2065,86 @@ func compileRegexp(re, flags string) (*regexp.Regexp, error) { } r, err := regexp.Compile(re) if err != nil { - return nil, fmt.Errorf("invalid regular expression %q: %v", re, err) + return nil, fmt.Errorf("invalid regular expression %q: %s", re, err) } return r, nil } -func funcError(v interface{}, args []interface{}) interface{} { +func funcCapture(v any) any { + vs, ok := v.(map[string]any) + if !ok { + return &expectedObjectError{v} + } + v = vs["captures"] + captures, ok := v.([]any) + if !ok { + return &expectedArrayError{v} + } + w := make(map[string]any, len(captures)) + for _, capture := range captures { + if capture, ok := capture.(map[string]any); ok { + if name, ok := capture["name"].(string); ok { + w[name] = capture["string"] + } + } + } + return w +} + +func funcError(v any, args []any) any { if len(args) > 0 { v = args[0] } - code := 5 - if v == nil { - code = 0 - } - return &exitCodeError{v, code, false} + return &exitCodeError{v, 5} } -func funcHalt(interface{}) interface{} { - return &exitCodeError{nil, 0, true} +func funcHalt(any) any { + return &HaltError{nil, 0} } -func funcHaltError(v interface{}, args []interface{}) interface{} { - code, ok := 5, false +func funcHaltError(v any, args []any) any { + code := 5 if len(args) > 0 { + var ok bool if code, ok = toInt(args[0]); !ok { - return &funcTypeError{"halt_error", args[0]} - } - } - return &exitCodeError{v, code, true} -} - -func funcBuiltins(interface{}) interface{} { - var xs []string - for name, fn := range internalFuncs { - if name[0] != '_' { - for i, cnt := 0, fn.argcount; cnt > 0; i, cnt = i+1, cnt>>1 { - if cnt&1 > 0 { - xs = append(xs, name+"/"+fmt.Sprint(i)) - } - } - } - } - for _, fds := range builtinFuncDefs { - for _, fd := range fds { - if fd.Name[0] != '_' { - xs = append(xs, fd.Name+"/"+fmt.Sprint(len(fd.Args))) - } + return &func0TypeError{"halt_error", args[0]} } } - sort.Strings(xs) - ys := make([]interface{}, len(xs)) - for i, x := range xs { - ys[i] = x - } - return ys -} - -func internalfuncTypeError(v, x interface{}) interface{} { - return &funcTypeError{x.(string), v} + return &HaltError{v, code} } -func toInt(x interface{}) (int, bool) { +func toInt(x any) (int, bool) { switch x := x.(type) { case int: return x, true case float64: - return int(x), true + return floatToInt(x), true case *big.Int: if x.IsInt64() { - if i := x.Int64(); minInt <= i && i <= maxInt { + if i := x.Int64(); math.MinInt <= i && i <= math.MaxInt { return int(i), true } } if x.Sign() > 0 { - return maxInt, true + return math.MaxInt, true } - return minInt, true + return math.MinInt, true default: return 0, false } } -func toFloat(x interface{}) (float64, bool) { +func floatToInt(x float64) int { + if math.MinInt <= x && x <= math.MaxInt { + return int(x) + } + if x > 0 { + return math.MaxInt + } + return math.MinInt +} + +func toFloat(x any) (float64, bool) { switch x := x.(type) { case int: return float64(x), true @@ -1678,9 +2161,8 @@ func bigToFloat(x *big.Int) float64 { if x.IsInt64() { return float64(x.Int64()) } - bs, _ := json.Marshal(x) - if f, err := json.Number(string(bs)).Float64(); err == nil { + if f, err := strconv.ParseFloat(x.String(), 64); err == nil { return f } - return math.Copysign(math.MaxFloat64, float64(x.Sign())) + return math.Inf(x.Sign()) } diff --git a/vendor/github.com/itchyny/gojq/go.dev.mod b/vendor/github.com/itchyny/gojq/go.dev.mod new file mode 100644 index 0000000000..2c1e43401e --- /dev/null +++ b/vendor/github.com/itchyny/gojq/go.dev.mod @@ -0,0 +1,8 @@ +module github.com/itchyny/gojq + +go 1.20 + +require ( + github.com/itchyny/astgen-go v0.0.0-20231113225122-e1c22b9aaf7b // indirect + github.com/itchyny/timefmt-go v0.1.5 // indirect +) diff --git a/vendor/github.com/itchyny/gojq/go.dev.sum b/vendor/github.com/itchyny/gojq/go.dev.sum new file mode 100644 index 0000000000..5c52eab2ed --- /dev/null +++ b/vendor/github.com/itchyny/gojq/go.dev.sum @@ -0,0 +1,4 @@ +github.com/itchyny/astgen-go v0.0.0-20231113225122-e1c22b9aaf7b h1:72fDU7wad+r3iQObaxhlXVIpAIMRUIUMrNa3go1vb8s= +github.com/itchyny/astgen-go v0.0.0-20231113225122-e1c22b9aaf7b/go.mod h1:Zp6xzEWVc2pQ/ObfLD6t/M6gDegsJWKdGKJSiT7qlu0= +github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE= +github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8= diff --git a/vendor/github.com/itchyny/gojq/gojq.go b/vendor/github.com/itchyny/gojq/gojq.go index 8f53b35687..e078c80908 100644 --- a/vendor/github.com/itchyny/gojq/gojq.go +++ b/vendor/github.com/itchyny/gojq/gojq.go @@ -1,5 +1,5 @@ -// Package gojq provides the parser and interpreter of gojq. +// Package gojq provides the parser and the interpreter of gojq. +// Please refer to [Usage as a library] for introduction. // -// Please refer to https://github.com/itchyny/gojq#usage-as-a-library for -// introduction of the usage as a library. +// [Usage as a library]: https://github.com/itchyny/gojq#usage-as-a-library package gojq diff --git a/vendor/github.com/itchyny/gojq/iter.go b/vendor/github.com/itchyny/gojq/iter.go index 4f724417b9..d0bed96063 100644 --- a/vendor/github.com/itchyny/gojq/iter.go +++ b/vendor/github.com/itchyny/gojq/iter.go @@ -2,22 +2,48 @@ package gojq // Iter is an interface for an iterator. type Iter interface { - Next() (interface{}, bool) + Next() (any, bool) } -func unitIterator(v interface{}) Iter { - return &unitIter{v: v} +// NewIter creates a new [Iter] from values. +func NewIter(values ...any) Iter { + switch len(values) { + case 0: + return emptyIter{} + case 1: + return &unitIter{value: values[0]} + default: + iter := sliceIter(values) + return &iter + } +} + +type emptyIter struct{} + +func (emptyIter) Next() (any, bool) { + return nil, false } type unitIter struct { - v interface{} - done bool + value any + done bool } -func (c *unitIter) Next() (interface{}, bool) { - if !c.done { - c.done = true - return c.v, true +func (iter *unitIter) Next() (any, bool) { + if iter.done { + return nil, false } - return nil, false + iter.done = true + return iter.value, true +} + +type sliceIter []any + +func (iter *sliceIter) Next() (any, bool) { + if len(*iter) == 0 { + return nil, false + } + value := (*iter)[0] + *iter = (*iter)[1:] + return value, true } diff --git a/vendor/github.com/itchyny/gojq/lexer.go b/vendor/github.com/itchyny/gojq/lexer.go index 716af9a7b7..509d60c65a 100644 --- a/vendor/github.com/itchyny/gojq/lexer.go +++ b/vendor/github.com/itchyny/gojq/lexer.go @@ -1,14 +1,12 @@ package gojq import ( - "fmt" - "strconv" - "strings" + "encoding/json" "unicode/utf8" ) type lexer struct { - source []byte + source string offset int result *Query token string @@ -18,7 +16,7 @@ type lexer struct { } func newLexer(src string) *lexer { - return &lexer{source: []byte(src)} + return &lexer{source: src} } const eof = -1 @@ -67,7 +65,7 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { case isIdent(ch, false): i := l.offset - 1 j, isModule := l.scanIdentOrModule() - l.token = string(l.source[i:j]) + l.token = l.source[i:j] lval.token = l.token if isModule { return tokModuleIdent @@ -80,10 +78,10 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { i := l.offset - 1 j := l.scanNumber(numberStateLead) if j < 0 { - l.token = string(l.source[i:-j]) + l.token = l.source[i:-j] return tokInvalid } - l.token = string(l.source[i:j]) + l.token = l.source[i:j] lval.token = l.token return tokNumber } @@ -96,17 +94,17 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { l.token = ".." return tokRecurse case isIdent(ch, false): - l.token = string(l.source[l.offset-1 : l.scanIdent()]) + l.token = l.source[l.offset-1 : l.scanIdent()] lval.token = l.token[1:] return tokIndex case isNumber(ch): i := l.offset - 1 j := l.scanNumber(numberStateFloat) if j < 0 { - l.token = string(l.source[i:-j]) + l.token = l.source[i:-j] return tokInvalid } - l.token = string(l.source[i:j]) + l.token = l.source[i:j] lval.token = l.token return tokNumber default: @@ -116,7 +114,7 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { if isIdent(l.peek(), false) { i := l.offset - 1 j, isModule := l.scanIdentOrModule() - l.token = string(l.source[i:j]) + l.token = l.source[i:j] lval.token = l.token if isModule { return tokModuleVariable @@ -138,6 +136,7 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { l.token = "?//" return tokDestAltOp } + l.offset-- } case '+': if l.peek() == '=' { @@ -224,8 +223,8 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { lval.operator = OpLt return tokCompareOp case '@': - if isIdent(l.peek(), false) { - l.token = string(l.source[l.offset-1 : l.scanIdent()]) + if isIdent(l.peek(), true) { + l.token = l.source[l.offset-1 : l.scanIdent()] lval.token = l.token return tokFormat } @@ -235,9 +234,9 @@ func (l *lexer) Lex(lval *yySymType) (tokenType int) { return tok default: if ch >= utf8.RuneSelf { - r, _ := utf8.DecodeRune(l.source[l.offset-1:]) + r, size := utf8.DecodeRuneInString(l.source[l.offset-1:]) + l.offset += size l.token = string(r) - l.offset += len(l.token) } } return int(ch) @@ -248,15 +247,9 @@ func (l *lexer) next() (byte, bool) { ch := l.source[l.offset] l.offset++ if ch == '#' { - if len(l.source) == l.offset { + if l.skipComment() { return 0, true } - for !isNewLine(l.source[l.offset]) { - l.offset++ - if len(l.source) == l.offset { - return 0, true - } - } } else if !isWhite(ch) { return ch, false } else if len(l.source) == l.offset { @@ -265,6 +258,28 @@ func (l *lexer) next() (byte, bool) { } } +func (l *lexer) skipComment() bool { + for { + switch l.peek() { + case 0: + return true + case '\\': + switch l.offset++; l.peek() { + case '\\', '\n': + l.offset++ + case '\r': + if l.offset++; l.peek() == '\n' { + l.offset++ + } + } + case '\n', '\r': + return false + default: + l.offset++ + } + } +} + func (l *lexer) peek() byte { if len(l.source) == l.offset { return 0 @@ -300,6 +315,14 @@ func (l *lexer) scanIdentOrModule() (int, bool) { return index, isModule } +func (l *lexer) validVarName() bool { + if l.peek() != '$' { + return false + } + l.offset++ + return isIdent(l.peek(), false) && l.scanIdent() == len(l.source) +} + const ( numberStateLead = iota numberStateFloat @@ -317,7 +340,8 @@ func (l *lexer) scanNumber(state int) int { switch ch { case '.': if state != numberStateLead { - return l.offset + l.offset++ + return -l.offset } l.offset++ state = numberStateFloat @@ -342,7 +366,7 @@ func (l *lexer) scanNumber(state int) int { l.offset++ return -l.offset } - if state == numberStateExpLead && len(l.source) == l.offset { + if state == numberStateExpLead { return -l.offset } return l.offset @@ -355,116 +379,176 @@ func (l *lexer) scanNumber(state int) int { } } +func (l *lexer) validNumber() bool { + ch := l.peek() + switch ch { + case '+', '-': + l.offset++ + ch = l.peek() + } + state := numberStateLead + if ch == '.' { + l.offset++ + ch = l.peek() + state = numberStateFloat + } + return isNumber(ch) && l.scanNumber(state) == len(l.source) +} + func (l *lexer) scanString(start int) (int, string) { - var quote bool - for i, m := l.offset, len(l.source); i < m; i++ { + var decode bool + var controls int + unquote := func(src string, quote bool) (string, error) { + if !decode { + if quote { + return src, nil + } + return src[1 : len(src)-1], nil + } + var buf []byte + if !quote && controls == 0 { + buf = []byte(src) + } else { + buf = quoteAndEscape(src, quote, controls) + } + if err := json.Unmarshal(buf, &src); err != nil { + return "", err + } + return src, nil + } + for i := l.offset; i < len(l.source); i++ { ch := l.source[i] switch ch { case '\\': - quote = !quote - case '"': - if !quote { - if !l.inString { - l.offset = i + 1 - l.token = string(l.source[start:l.offset]) - str, err := strconv.Unquote(l.token) - if err != nil { - return tokInvalid, "" + if i++; i >= len(l.source) { + break + } + switch l.source[i] { + case 'u': + for j := 1; j <= 4; j++ { + if i+j >= len(l.source) || !isHex(l.source[i+j]) { + l.offset = i + j + l.token = l.source[i-1 : l.offset] + return tokInvalidEscapeSequence, "" } - return tokString, str } - if i > l.offset { - l.offset = i - l.token = string(l.source[start:l.offset]) - str, err := strconv.Unquote("\"" + l.token + "\"") - if err != nil { - return tokInvalid, "" - } - return tokString, str + i += 4 + fallthrough + case '"', '/', '\\', 'b', 'f', 'n', 'r', 't': + decode = true + case '(': + if !l.inString { + l.inString = true + return tokStringStart, "" } - l.inString = false - l.offset = i + 1 - return tokStringEnd, "" - } - quote = false - case '(': - if quote { - if l.inString { - if i > l.offset+1 { - l.offset = i - 1 - l.token = string(l.source[start:l.offset]) - str, err := strconv.Unquote("\"" + l.token + "\"") - if err != nil { - return tokInvalid, "" - } - return tokString, str - } - l.offset = i + 1 + if i == l.offset+1 { + l.offset += 2 l.inString = false return tokStringQuery, "" } - l.inString = true - return tokStringStart, "" + l.offset = i - 1 + l.token = l.source[start:l.offset] + str, err := unquote(l.token, true) + if err != nil { + return tokInvalid, "" + } + return tokString, str + default: + l.offset = i + 1 + l.token = l.source[l.offset-2 : l.offset] + return tokInvalidEscapeSequence, "" } - default: - if quote { - if !('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || - '0' <= ch && ch <= '9' || ch == '\'' || ch == '"') { - l.offset = i + 1 - l.token = string(l.source[l.offset-2 : l.offset]) + case '"': + if !l.inString { + l.offset = i + 1 + l.token = l.source[start:l.offset] + str, err := unquote(l.token, false) + if err != nil { return tokInvalid, "" } - quote = false + return tokString, str + } + if i > l.offset { + l.offset = i + l.token = l.source[start:l.offset] + str, err := unquote(l.token, true) + if err != nil { + return tokInvalid, "" + } + return tokString, str + } + l.inString = false + l.offset = i + 1 + return tokStringEnd, "" + default: + if !decode { + decode = ch > '~' + } + if ch < ' ' { // ref: unquoteBytes in encoding/json + controls++ } } } l.offset = len(l.source) - l.token = string(l.source[start:l.offset]) - return tokInvalid, "" -} - -type parseError struct { - offset int - token string - tokenType int + l.token = "" + return tokUnterminatedString, "" } -func (err *parseError) Error() string { - var message string - prefix := "unexpected" - switch { - case err.tokenType == eof: - message = "" - case err.tokenType == tokInvalid: - prefix = "invalid" - fallthrough - case err.tokenType >= utf8.RuneSelf: - if strings.HasPrefix(err.token, "\"") { - message = err.token +func quoteAndEscape(src string, quote bool, controls int) []byte { + size := len(src) + controls*5 + if quote { + size += 2 + } + buf := make([]byte, size) + var j int + if quote { + buf[0] = '"' + buf[len(buf)-1] = '"' + j++ + } + for i := 0; i < len(src); i++ { + if ch := src[i]; ch < ' ' { + const hex = "0123456789abcdef" + copy(buf[j:], `\u00`) + buf[j+4] = hex[ch>>4] + buf[j+5] = hex[ch&0xF] + j += 6 } else { - message = "\"" + err.token + "\"" + buf[j] = ch + j++ } - default: - message = strconv.Quote(string(err.tokenType)) } - return fmt.Sprintf("%s token %s", prefix, message) + return buf } -func (err *parseError) Token() (string, int) { - return err.token, err.offset +// ParseError represents a description of a query parsing error. +type ParseError struct { + Offset int // the error occurred after reading Offset bytes + Token string // the Token that caused the error (may be empty) + tokenType int } -func (l *lexer) Error(e string) { - offset, token := l.offset, l.token - switch { - case l.tokenType == eof: - offset++ - case l.tokenType >= utf8.RuneSelf: - offset -= len(token) - 1 +func (err *ParseError) Error() string { + switch err.tokenType { + case eof: + return "unexpected EOF" + case tokInvalid: + return "invalid token " + jsonMarshal(err.Token) + case tokInvalidEscapeSequence: + return `invalid escape sequence "` + err.Token + `" in string literal` + case tokUnterminatedString: + return "unterminated string literal" default: - token = fmt.Sprintf("%c", l.tokenType) + return "unexpected token " + jsonMarshal(err.Token) } - l.err = &parseError{offset, token, l.tokenType} +} + +func (l *lexer) Error(string) { + offset, token := l.offset, l.token + if l.tokenType != eof && l.tokenType < utf8.RuneSelf { + token = string(rune(l.tokenType)) + } + l.err = &ParseError{offset, token, l.tokenType} } func isWhite(ch byte) bool { @@ -482,15 +566,12 @@ func isIdent(ch byte, tail bool) bool { tail && isNumber(ch) } -func isNumber(ch byte) bool { - return '0' <= ch && ch <= '9' +func isHex(ch byte) bool { + return 'a' <= ch && ch <= 'f' || + 'A' <= ch && ch <= 'F' || + isNumber(ch) } -func isNewLine(ch byte) bool { - switch ch { - case '\n', '\r': - return true - default: - return false - } +func isNumber(ch byte) bool { + return '0' <= ch && ch <= '9' } diff --git a/vendor/github.com/itchyny/gojq/math.go b/vendor/github.com/itchyny/gojq/math.go deleted file mode 100644 index 55d64765c8..0000000000 --- a/vendor/github.com/itchyny/gojq/math.go +++ /dev/null @@ -1,10 +0,0 @@ -package gojq - -import "math/bits" - -const ( - maxInt = 1<<(bits.UintSize-1) - 1 // math.MaxInt64 or math.MaxInt32 - minInt = -maxInt - 1 // math.MinInt64 or math.MinInt32 - maxHalfInt = 1<<(bits.UintSize/2-1) - 1 // math.MaxInt32 or math.MaxInt16 - minHalfInt = -maxHalfInt - 1 // math.MinInt32 or math.MinInt16 -) diff --git a/vendor/github.com/itchyny/gojq/module_loader.go b/vendor/github.com/itchyny/gojq/module_loader.go index 9550bc9d7f..0a73ba05b8 100644 --- a/vendor/github.com/itchyny/gojq/module_loader.go +++ b/vendor/github.com/itchyny/gojq/module_loader.go @@ -1,22 +1,40 @@ package gojq import ( - "bytes" "encoding/json" "fmt" "io" - "io/ioutil" "os" "path/filepath" + "strings" ) -type moduleLoader struct { - paths []string -} +// ModuleLoader is the interface for loading modules. +// +// Implement following optional methods. Use [NewModuleLoader] to load local modules. +// +// LoadInitModules() ([]*Query, error) +// LoadModule(string) (*Query, error) +// LoadModuleWithMeta(string, map[string]any) (*Query, error) +// LoadJSON(string) (any, error) +// LoadJSONWithMeta(string, map[string]any) (any, error) +type ModuleLoader any -// NewModuleLoader creates a new ModuleLoader reading local modules in the paths. +// NewModuleLoader creates a new [ModuleLoader] loading local modules in the paths. +// Note that user can load modules outside the paths using "search" path of metadata. +// Empty paths are ignored, so specify "." for the current working directory. func NewModuleLoader(paths []string) ModuleLoader { - return &moduleLoader{paths} + ps := make([]string, 0, len(paths)) + for _, path := range paths { + if path = resolvePath(path, ""); path != "" { + ps = append(ps, path) + } + } + return &moduleLoader{ps} +} + +type moduleLoader struct { + paths []string } func (l *moduleLoader) LoadInitModules() ([]*Query, error) { @@ -35,40 +53,36 @@ func (l *moduleLoader) LoadInitModules() ([]*Query, error) { if fi.IsDir() { continue } - cnt, err := ioutil.ReadFile(path) + cnt, err := os.ReadFile(path) if err != nil { return nil, err } - q, err := parseModule(path, string(cnt)) + q, err := parseModule(string(cnt), filepath.Dir(path)) if err != nil { - return nil, &queryParseError{"query in module", path, string(cnt), err} + return nil, &queryParseError{path, string(cnt), err} } qs = append(qs, q) } return qs, nil } -func (l *moduleLoader) LoadModule(string) (*Query, error) { - panic("LocalModuleLoader#LoadModule: unreachable") -} - -func (l *moduleLoader) LoadModuleWithMeta(name string, meta map[string]interface{}) (*Query, error) { +func (l *moduleLoader) LoadModuleWithMeta(name string, meta map[string]any) (*Query, error) { path, err := l.lookupModule(name, ".jq", meta) if err != nil { return nil, err } - cnt, err := ioutil.ReadFile(path) + cnt, err := os.ReadFile(path) if err != nil { return nil, err } - q, err := parseModule(path, string(cnt)) + q, err := parseModule(string(cnt), filepath.Dir(path)) if err != nil { - return nil, &queryParseError{"query in module", path, string(cnt), err} + return nil, &queryParseError{path, string(cnt), err} } return q, nil } -func (l *moduleLoader) LoadJSONWithMeta(name string, meta map[string]interface{}) (interface{}, error) { +func (l *moduleLoader) LoadJSONWithMeta(name string, meta map[string]any) (any, error) { path, err := l.lookupModule(name, ".json", meta) if err != nil { return nil, err @@ -78,33 +92,40 @@ func (l *moduleLoader) LoadJSONWithMeta(name string, meta map[string]interface{} return nil, err } defer f.Close() - var vals []interface{} - var buf bytes.Buffer - dec := json.NewDecoder(io.TeeReader(f, &buf)) + vals := []any{} + dec := json.NewDecoder(f) + dec.UseNumber() for { - var val interface{} + var val any if err := dec.Decode(&val); err != nil { if err == io.EOF { break } - return nil, &jsonParseError{path, buf.String(), err} + if _, err := f.Seek(0, io.SeekStart); err != nil { + return nil, err + } + cnt, er := io.ReadAll(f) + if er != nil { + return nil, er + } + return nil, &jsonParseError{path, string(cnt), err} } vals = append(vals, val) } return vals, nil } -func (l *moduleLoader) lookupModule(name, extension string, meta map[string]interface{}) (string, error) { +func (l *moduleLoader) lookupModule(name, extension string, meta map[string]any) (string, error) { paths := l.paths - if path := searchPath(meta); path != "" { + if path, ok := meta["search"].(string); ok { paths = append([]string{path}, paths...) } for _, base := range paths { - path := filepath.Clean(filepath.Join(base, name+extension)) + path := filepath.Join(base, name+extension) if _, err := os.Stat(path); err == nil { return path, err } - path = filepath.Clean(filepath.Join(base, name, filepath.Base(name)+extension)) + path = filepath.Join(base, name, filepath.Base(name)+extension) if _, err := os.Stat(path); err == nil { return path, err } @@ -112,43 +133,50 @@ func (l *moduleLoader) lookupModule(name, extension string, meta map[string]inte return "", fmt.Errorf("module not found: %q", name) } -// This is a dirty hack to implement the "search" field. -func parseModule(path, cnt string) (*Query, error) { +func parseModule(cnt, dir string) (*Query, error) { q, err := Parse(cnt) if err != nil { return nil, err } for _, i := range q.Imports { - if i.Meta == nil { - continue + if i.Meta != nil { + for _, e := range i.Meta.KeyVals { + if e.Key == "search" || e.KeyString == "search" { + if path, ok := e.Val.toString(); ok { + if path = resolvePath(path, dir); path != "" { + e.Val.Str = path + } else { + e.Val.Null = true + } + } + } + } } - i.Meta.KeyVals = append( - i.Meta.KeyVals, - &ConstObjectKeyVal{ - Key: "$$path", - Val: &ConstTerm{Str: path}, - }, - ) } return q, nil } -func searchPath(meta map[string]interface{}) string { - x, ok := meta["$$path"] - if !ok { - return "" - } - path, ok := x.(string) - if !ok { - return "" - } - x, ok = meta["search"] - if !ok { - return "" - } - s, ok := x.(string) - if !ok { - return "" +func resolvePath(path, dir string) string { + switch { + case filepath.IsAbs(path): + return path + case strings.HasPrefix(path, "~/"): + dir, err := os.UserHomeDir() + if err != nil { + return "" + } + return filepath.Join(dir, path[2:]) + case strings.HasPrefix(path, "$ORIGIN/"): + exe, err := os.Executable() + if err != nil { + return "" + } + exe, err = filepath.EvalSymlinks(exe) + if err != nil { + return "" + } + return filepath.Join(filepath.Dir(exe), path[8:]) + default: + return filepath.Join(dir, path) } - return filepath.Join(filepath.Dir(path), s) } diff --git a/vendor/github.com/itchyny/gojq/normalize.go b/vendor/github.com/itchyny/gojq/normalize.go index d1bf86f6c5..2bfcd21569 100644 --- a/vendor/github.com/itchyny/gojq/normalize.go +++ b/vendor/github.com/itchyny/gojq/normalize.go @@ -7,36 +7,40 @@ import ( "strings" ) -func normalizeNumbers(v interface{}) interface{} { +func normalizeNumber(v json.Number) any { + if i, err := v.Int64(); err == nil && math.MinInt <= i && i <= math.MaxInt { + return int(i) + } + if strings.ContainsAny(v.String(), ".eE") { + if f, err := v.Float64(); err == nil { + return f + } + } + if bi, ok := new(big.Int).SetString(v.String(), 10); ok { + return bi + } + if strings.HasPrefix(v.String(), "-") { + return math.Inf(-1) + } + return math.Inf(1) +} + +func normalizeNumbers(v any) any { switch v := v.(type) { case json.Number: - if i, err := v.Int64(); err == nil && minInt <= i && i <= maxInt { - return int(i) - } - if strings.ContainsAny(string(v), ".eE") { - if f, err := v.Float64(); err == nil { - return f - } - } - if bi, ok := new(big.Int).SetString(string(v), 10); ok { - return bi - } - if strings.HasPrefix(string(v), "-") { - return -math.MaxFloat64 - } - return math.MaxFloat64 + return normalizeNumber(v) case *big.Int: if v.IsInt64() { - if i := v.Int64(); minInt <= i && i <= maxInt { + if i := v.Int64(); math.MinInt <= i && i <= math.MaxInt { return int(i) } } return v case int64: - if v > int64(maxInt) { - return new(big.Int).SetUint64(uint64(v)) + if math.MinInt <= v && v <= math.MaxInt { + return int(v) } - return int(v) + return big.NewInt(v) case int32: return int(v) case int16: @@ -44,95 +48,36 @@ func normalizeNumbers(v interface{}) interface{} { case int8: return int(v) case uint: - if v > uint(maxInt) { - return new(big.Int).SetUint64(uint64(v)) + if v <= math.MaxInt { + return int(v) } - return int(v) + return new(big.Int).SetUint64(uint64(v)) case uint64: - if v > uint64(maxInt) { - return new(big.Int).SetUint64(v) + if v <= math.MaxInt { + return int(v) } - return int(v) + return new(big.Int).SetUint64(v) case uint32: - if v > uint32(maxHalfInt) { - return new(big.Int).SetUint64(uint64(v)) + if uint64(v) <= math.MaxInt { + return int(v) } - return int(v) + return new(big.Int).SetUint64(uint64(v)) case uint16: return int(v) case uint8: return int(v) case float32: return float64(v) - case map[string]interface{}: - for k, x := range v { - v[k] = normalizeNumbers(x) - } - return v - case []interface{}: + case []any: for i, x := range v { v[i] = normalizeNumbers(x) } return v - default: - return v - } -} - -func normalizeValues(v interface{}) interface{} { - switch v := v.(type) { - case float64: - if math.IsNaN(v) { - return nil - } else if isinf(v) { - return math.Copysign(math.MaxFloat64, v) - } else { - return v - } - case map[string]interface{}: - u := make(map[string]interface{}, len(v)) - for k, v := range v { - u[k] = normalizeValues(v) - } - return u - case []interface{}: - u := make([]interface{}, len(v)) - for i, v := range v { - u[i] = normalizeValues(v) - } - return u - default: - return v - } -} - -// It's ok to delete destructively because this function is used right after -// updatePaths, where it shallow-copies maps or slices on updates. -func deleteEmpty(v interface{}) interface{} { - switch v := v.(type) { - case struct{}: - return nil - case map[string]interface{}: - for k, w := range v { - if w == struct{}{} { - delete(v, k) - } else { - v[k] = deleteEmpty(w) - } + case map[string]any: + for k, x := range v { + v[k] = normalizeNumbers(x) } return v - case []interface{}: - var j int - for _, w := range v { - if w != struct{}{} { - v[j] = deleteEmpty(w) - j++ - } - } - for i := j; i < len(v); i++ { - v[i] = nil - } - return v[:j] default: return v } diff --git a/vendor/github.com/itchyny/gojq/operator.go b/vendor/github.com/itchyny/gojq/operator.go index 4f919e3ee1..513dbfadc3 100644 --- a/vendor/github.com/itchyny/gojq/operator.go +++ b/vendor/github.com/itchyny/gojq/operator.go @@ -3,7 +3,6 @@ package gojq import ( "math" "math/big" - "reflect" "strings" ) @@ -38,34 +37,7 @@ const ( OpUpdateAlt ) -var operatorMap = map[string]Operator{ - "|": OpPipe, - ",": OpComma, - "+": OpAdd, - "-": OpSub, - "*": OpMul, - "/": OpDiv, - "%": OpMod, - "==": OpEq, - "!=": OpNe, - ">": OpGt, - "<": OpLt, - ">=": OpGe, - "<=": OpLe, - "and": OpAnd, - "or": OpOr, - "//": OpAlt, - "=": OpAssign, - "|=": OpModify, - "+=": OpUpdateAdd, - "-=": OpUpdateSub, - "*=": OpUpdateMul, - "/=": OpUpdateDiv, - "%=": OpUpdateMod, - "//=": OpUpdateAlt, -} - -// String implements Stringer. +// String implements [fmt.Stringer]. func (op Operator) String() string { switch op { case OpPipe: @@ -121,9 +93,12 @@ func (op Operator) String() string { } } -// GoString implements GoStringer. -func (op Operator) GoString() string { +// GoString implements [fmt.GoStringer]. +func (op Operator) GoString() (str string) { + defer func() { str = "gojq." + str }() switch op { + case Operator(0): + return "Operator(0)" case OpPipe: return "OpPipe" case OpComma: @@ -233,23 +208,19 @@ func (op Operator) getFunc() string { } func binopTypeSwitch( - l, r interface{}, - callbackInts func(int, int) interface{}, - callbackFloats func(float64, float64) interface{}, - callbackBigInts func(*big.Int, *big.Int) interface{}, - callbackStrings func(string, string) interface{}, - callbackArrays func(l, r []interface{}) interface{}, - callbackMaps func(l, r map[string]interface{}) interface{}, - fallback func(interface{}, interface{}) interface{}) interface{} { + l, r any, + callbackInts func(_, _ int) any, + callbackFloats func(_, _ float64) any, + callbackBigInts func(_, _ *big.Int) any, + callbackStrings func(_, _ string) any, + callbackArrays func(_, _ []any) any, + callbackMaps func(_, _ map[string]any) any, + fallback func(_, _ any) any) any { switch l := l.(type) { case int: switch r := r.(type) { case int: - if minHalfInt <= l && l <= maxHalfInt && - minHalfInt <= r && r <= maxHalfInt { - return callbackInts(l, r) - } - return callbackBigInts(big.NewInt(int64(l)), big.NewInt(int64(r))) + return callbackInts(l, r) case float64: return callbackFloats(float64(l), r) case *big.Int: @@ -286,16 +257,16 @@ func binopTypeSwitch( default: return fallback(l, r) } - case []interface{}: + case []any: switch r := r.(type) { - case []interface{}: + case []any: return callbackArrays(l, r) default: return fallback(l, r) } - case map[string]interface{}: + case map[string]any: switch r := r.(type) { - case map[string]interface{}: + case map[string]any: return callbackMaps(l, r) default: return fallback(l, r) @@ -305,7 +276,7 @@ func binopTypeSwitch( } } -func funcOpPlus(v interface{}) interface{} { +func funcOpPlus(v any) any { switch v := v.(type) { case int: return v @@ -318,7 +289,7 @@ func funcOpPlus(v interface{}) interface{} { } } -func funcOpNegate(v interface{}) interface{} { +func funcOpNegate(v any) any { switch v := v.(type) { case int: return -v @@ -331,28 +302,38 @@ func funcOpNegate(v interface{}) interface{} { } } -func funcOpAdd(_, l, r interface{}) interface{} { - if l == nil { - return r - } else if r == nil { - return l - } +func funcOpAdd(_, l, r any) any { return binopTypeSwitch(l, r, - func(l, r int) interface{} { return l + r }, - func(l, r float64) interface{} { return l + r }, - func(l, r *big.Int) interface{} { return new(big.Int).Add(l, r) }, - func(l, r string) interface{} { return l + r }, - func(l, r []interface{}) interface{} { + func(l, r int) any { + if v := l + r; (v >= l) == (r >= 0) { + return v + } + x, y := big.NewInt(int64(l)), big.NewInt(int64(r)) + return x.Add(x, y) + }, + func(l, r float64) any { return l + r }, + func(l, r *big.Int) any { return new(big.Int).Add(l, r) }, + func(l, r string) any { return l + r }, + func(l, r []any) any { + if len(l) == 0 { + return r + } if len(r) == 0 { return l - } else if len(l) == 0 { - return r } - v := make([]interface{}, 0, len(l)+len(r)) - return append(append(v, l...), r...) + v := make([]any, len(l)+len(r)) + copy(v, l) + copy(v[len(l):], r) + return v }, - func(l, r map[string]interface{}) interface{} { - m := make(map[string]interface{}) + func(l, r map[string]any) any { + if len(l) == 0 { + return r + } + if len(r) == 0 { + return l + } + m := make(map[string]any, len(l)+len(r)) for k, v := range l { m[k] = v } @@ -361,63 +342,71 @@ func funcOpAdd(_, l, r interface{}) interface{} { } return m }, - func(l, r interface{}) interface{} { return &binopTypeError{"add", l, r} }, + func(l, r any) any { + if l == nil { + return r + } + if r == nil { + return l + } + return &binopTypeError{"add", l, r} + }, ) } -func funcOpSub(_, l, r interface{}) interface{} { +func funcOpSub(_, l, r any) any { return binopTypeSwitch(l, r, - func(l, r int) interface{} { return l - r }, - func(l, r float64) interface{} { return l - r }, - func(l, r *big.Int) interface{} { return new(big.Int).Sub(l, r) }, - func(l, r string) interface{} { return &binopTypeError{"subtract", l, r} }, - func(l, r []interface{}) interface{} { - a := make([]interface{}, 0, len(l)) - for _, v := range l { - var found bool - for _, w := range r { - if reflect.DeepEqual(normalizeNumbers(v), normalizeNumbers(w)) { - found = true - break + func(l, r int) any { + if v := l - r; (v <= l) == (r >= 0) { + return v + } + x, y := big.NewInt(int64(l)), big.NewInt(int64(r)) + return x.Sub(x, y) + }, + func(l, r float64) any { return l - r }, + func(l, r *big.Int) any { return new(big.Int).Sub(l, r) }, + func(l, r string) any { return &binopTypeError{"subtract", l, r} }, + func(l, r []any) any { + v := make([]any, 0, len(l)) + L: + for _, l := range l { + for _, r := range r { + if compare(l, r) == 0 { + continue L } } - if !found { - a = append(a, v) - } + v = append(v, l) } - return a + return v }, - func(l, r map[string]interface{}) interface{} { return &binopTypeError{"subtract", l, r} }, - func(l, r interface{}) interface{} { return &binopTypeError{"subtract", l, r} }, + func(l, r map[string]any) any { return &binopTypeError{"subtract", l, r} }, + func(l, r any) any { return &binopTypeError{"subtract", l, r} }, ) } -func funcOpMul(_, l, r interface{}) interface{} { +func funcOpMul(_, l, r any) any { return binopTypeSwitch(l, r, - func(l, r int) interface{} { return l * r }, - func(l, r float64) interface{} { return l * r }, - func(l, r *big.Int) interface{} { return new(big.Int).Mul(l, r) }, - func(l, r string) interface{} { return &binopTypeError{"multiply", l, r} }, - func(l, r []interface{}) interface{} { return &binopTypeError{"multiply", l, r} }, - deepMergeObjects, - func(l, r interface{}) interface{} { - multiplyString := func(s string, cnt float64) interface{} { - if cnt <= 0.0 { - return nil - } - if cnt < 1.0 { - return s - } - return strings.Repeat(s, int(cnt)) + func(l, r int) any { + if v := l * r; r == 0 || v/r == l { + return v } + x, y := big.NewInt(int64(l)), big.NewInt(int64(r)) + return x.Mul(x, y) + }, + func(l, r float64) any { return l * r }, + func(l, r *big.Int) any { return new(big.Int).Mul(l, r) }, + func(l, r string) any { return &binopTypeError{"multiply", l, r} }, + func(l, r []any) any { return &binopTypeError{"multiply", l, r} }, + deepMergeObjects, + func(l, r any) any { if l, ok := l.(string); ok { - if f, ok := toFloat(r); ok { - return multiplyString(l, f) + if r, ok := toFloat(r); ok { + return repeatString(l, r) } } if r, ok := r.(string); ok { - if f, ok := toFloat(l); ok { - return multiplyString(r, f) + if l, ok := toFloat(l); ok { + return repeatString(r, l) } } return &binopTypeError{"multiply", l, r} @@ -425,15 +414,15 @@ func funcOpMul(_, l, r interface{}) interface{} { ) } -func deepMergeObjects(l, r map[string]interface{}) interface{} { - m := make(map[string]interface{}) +func deepMergeObjects(l, r map[string]any) any { + m := make(map[string]any, len(l)+len(r)) for k, v := range l { m[k] = v } for k, v := range r { if mk, ok := m[k]; ok { - if mk, ok := mk.(map[string]interface{}); ok { - if w, ok := v.(map[string]interface{}); ok { + if mk, ok := mk.(map[string]any); ok { + if w, ok := v.(map[string]any); ok { v = deepMergeObjects(mk, w) } } @@ -443,125 +432,118 @@ func deepMergeObjects(l, r map[string]interface{}) interface{} { return m } -func funcOpDiv(_, l, r interface{}) interface{} { +func repeatString(s string, n float64) any { + if n < 0.0 || len(s) > 0 && n > float64(0x10000000/len(s)) || math.IsNaN(n) { + return nil + } + if s == "" { + return "" + } + return strings.Repeat(s, int(n)) +} + +func funcOpDiv(_, l, r any) any { return binopTypeSwitch(l, r, - func(l, r int) interface{} { + func(l, r int) any { if r == 0 { - if l == 0 { - return math.NaN() - } return &zeroDivisionError{l, r} } + if l%r == 0 { + return l / r + } return float64(l) / float64(r) }, - func(l, r float64) interface{} { + func(l, r float64) any { if r == 0.0 { - if l == 0.0 { - return math.NaN() - } return &zeroDivisionError{l, r} - } else if isinf(r) { - if isinf(l) { - return math.NaN() - } - if (r >= 0) == (l >= 0) { - return 0.0 - } - return math.Copysign(0.0, -1) } return l / r }, - func(l, r *big.Int) interface{} { + func(l, r *big.Int) any { if r.Sign() == 0 { - if l.Sign() == 0 { - return math.NaN() - } return &zeroDivisionError{l, r} } - x := new(big.Int).Div(l, r) - if new(big.Int).Mul(x, r).Cmp(l) == 0 { - return x - } - rf := bigToFloat(r) - if isinf(rf) { - if l.Sign() == r.Sign() { - return 0.0 - } - return math.Copysign(0.0, -1) + d, m := new(big.Int).DivMod(l, r, new(big.Int)) + if m.Sign() == 0 { + return d } - return bigToFloat(l) / rf + return bigToFloat(l) / bigToFloat(r) }, - func(l, r string) interface{} { + func(l, r string) any { if l == "" { - return []interface{}{} + return []any{} } xs := strings.Split(l, r) - vs := make([]interface{}, len(xs)) + vs := make([]any, len(xs)) for i, x := range xs { vs[i] = x } return vs }, - func(l, r []interface{}) interface{} { return &binopTypeError{"divide", l, r} }, - func(l, r map[string]interface{}) interface{} { return &binopTypeError{"divide", l, r} }, - func(l, r interface{}) interface{} { return &binopTypeError{"divide", l, r} }, + func(l, r []any) any { return &binopTypeError{"divide", l, r} }, + func(l, r map[string]any) any { return &binopTypeError{"divide", l, r} }, + func(l, r any) any { return &binopTypeError{"divide", l, r} }, ) } -func funcOpMod(_, l, r interface{}) interface{} { +func funcOpMod(_, l, r any) any { return binopTypeSwitch(l, r, - func(l, r int) interface{} { + func(l, r int) any { if r == 0 { return &zeroModuloError{l, r} } return l % r }, - func(l, r float64) interface{} { - if r == 0.0 { + func(l, r float64) any { + ri := floatToInt(r) + if ri == 0 { return &zeroModuloError{l, r} } - return int(l) % int(r) + if math.IsNaN(l) || math.IsNaN(r) { + return math.NaN() + } + return floatToInt(l) % ri }, - func(l, r *big.Int) interface{} { + func(l, r *big.Int) any { if r.Sign() == 0 { return &zeroModuloError{l, r} } - return new(big.Int).Mod(l, r) + return new(big.Int).Rem(l, r) }, - func(l, r string) interface{} { return &binopTypeError{"modulo", l, r} }, - func(l, r []interface{}) interface{} { return &binopTypeError{"modulo", l, r} }, - func(l, r map[string]interface{}) interface{} { return &binopTypeError{"modulo", l, r} }, - func(l, r interface{}) interface{} { return &binopTypeError{"modulo", l, r} }, + func(l, r string) any { return &binopTypeError{"modulo", l, r} }, + func(l, r []any) any { return &binopTypeError{"modulo", l, r} }, + func(l, r map[string]any) any { return &binopTypeError{"modulo", l, r} }, + func(l, r any) any { return &binopTypeError{"modulo", l, r} }, ) } -func funcOpAlt(_, l, r interface{}) interface{} { +func funcOpAlt(_, l, r any) any { if l == nil || l == false { return r } return l } -func funcOpEq(_, l, r interface{}) interface{} { +func funcOpEq(_, l, r any) any { return compare(l, r) == 0 } -func funcOpNe(_, l, r interface{}) interface{} { +func funcOpNe(_, l, r any) any { return compare(l, r) != 0 } -func funcOpGt(_, l, r interface{}) interface{} { +func funcOpGt(_, l, r any) any { return compare(l, r) > 0 } -func funcOpLt(_, l, r interface{}) interface{} { +func funcOpLt(_, l, r any) any { return compare(l, r) < 0 } -func funcOpGe(_, l, r interface{}) interface{} { +func funcOpGe(_, l, r any) any { return compare(l, r) >= 0 } -func funcOpLe(_, l, r interface{}) interface{} { +func funcOpLe(_, l, r any) any { return compare(l, r) <= 0 } diff --git a/vendor/github.com/itchyny/gojq/option.go b/vendor/github.com/itchyny/gojq/option.go index d4ac541b9f..f1a110fae3 100644 --- a/vendor/github.com/itchyny/gojq/option.go +++ b/vendor/github.com/itchyny/gojq/option.go @@ -1,10 +1,12 @@ package gojq -// CompilerOption ... +import "fmt" + +// CompilerOption is a compiler option. type CompilerOption func(*compiler) // WithModuleLoader is a compiler option for module loader. -// If you want to load modules from the filesystem, use NewModuleLoader. +// If you want to load modules from the filesystem, use [NewModuleLoader]. func WithModuleLoader(moduleLoader ModuleLoader) CompilerOption { return func(c *compiler) { c.moduleLoader = moduleLoader @@ -13,7 +15,7 @@ func WithModuleLoader(moduleLoader ModuleLoader) CompilerOption { // WithEnvironLoader is a compiler option for environment variables loader. // The OS environment variables are not accessible by default due to security -// reason. You can pass os.Environ if you allow to access it. +// reasons. You can specify [os.Environ] as argument if you allow to access. func WithEnvironLoader(environLoader func() []string) CompilerOption { return func(c *compiler) { c.environLoader = environLoader @@ -21,19 +23,72 @@ func WithEnvironLoader(environLoader func() []string) CompilerOption { } // WithVariables is a compiler option for variable names. The variables can be -// used in the query. You have to give the values to query.Run or code.Run in -// the same order. +// used in the query. You have to give the values to [*Code.Run] in the same order. func WithVariables(variables []string) CompilerOption { return func(c *compiler) { c.variables = variables } } +// WithFunction is a compiler option for adding a custom internal function. +// Specify the minimum and maximum count of the function arguments. These +// values should satisfy 0 <= minarity <= maxarity <= 30, otherwise panics. +// On handling numbers, you should take account to int, float64 and *big.Int. +// These are the number types you are allowed to return, so do not return int64. +// Refer to [ValueError] to return a value error just like built-in error +// function. If you want to emit multiple values, call the empty function, +// accept a filter for its argument, or call another built-in function, then +// use LoadInitModules of the module loader. +func WithFunction(name string, minarity, maxarity int, f func(any, []any) any) CompilerOption { + return withFunction(name, minarity, maxarity, false, f) +} + +// WithIterFunction is a compiler option for adding a custom iterator function. +// This is like the [WithFunction] option, but you can add a function which +// returns an Iter to emit multiple values. You cannot define both iterator and +// non-iterator functions of the same name (with possibly different arities). +// See also [NewIter], which can be used to convert values or an error to an Iter. +func WithIterFunction(name string, minarity, maxarity int, f func(any, []any) Iter) CompilerOption { + return withFunction(name, minarity, maxarity, true, + func(v any, args []any) any { + return f(v, args) + }, + ) +} + +func withFunction(name string, minarity, maxarity int, iter bool, f func(any, []any) any) CompilerOption { + if !(0 <= minarity && minarity <= maxarity && maxarity <= 30) { + panic(fmt.Sprintf("invalid arity for %q: %d, %d", name, minarity, maxarity)) + } + argcount := 1<<(maxarity+1) - 1< 0 { - return nil, l.err +func reverseFuncDef(xs []*FuncDef) []*FuncDef { + for i, j := 0, len(xs)-1; i < j; i, j = i+1, j-1 { + xs[i], xs[j] = xs[j], xs[i] } - return l.result, nil + return xs } -//line parser.go.y:14 +func prependFuncDef(xs []*FuncDef, x *FuncDef) []*FuncDef { + xs = append(xs, nil) + copy(xs[1:], xs) + xs[0] = x + return xs +} + +//line parser.go.y:19 type yySymType struct { yys int - value interface{} + value any token string operator Operator } @@ -47,24 +52,26 @@ const tokModuleVariable = 57365 const tokIndex = 57366 const tokNumber = 57367 const tokFormat = 57368 -const tokInvalid = 57369 -const tokString = 57370 -const tokStringStart = 57371 -const tokStringQuery = 57372 -const tokStringEnd = 57373 -const tokIf = 57374 -const tokThen = 57375 -const tokElif = 57376 -const tokElse = 57377 -const tokEnd = 57378 -const tokTry = 57379 -const tokCatch = 57380 -const tokReduce = 57381 -const tokForeach = 57382 -const tokRecurse = 57383 -const tokFuncDefPost = 57384 -const tokTermPost = 57385 -const tokEmptyCatch = 57386 +const tokString = 57369 +const tokStringStart = 57370 +const tokStringQuery = 57371 +const tokStringEnd = 57372 +const tokIf = 57373 +const tokThen = 57374 +const tokElif = 57375 +const tokElse = 57376 +const tokEnd = 57377 +const tokTry = 57378 +const tokCatch = 57379 +const tokReduce = 57380 +const tokForeach = 57381 +const tokRecurse = 57382 +const tokFuncDefPost = 57383 +const tokTermPost = 57384 +const tokEmptyCatch = 57385 +const tokInvalid = 57386 +const tokInvalidEscapeSequence = 57387 +const tokUnterminatedString = 57388 var yyToknames = [...]string{ "$end", @@ -93,7 +100,6 @@ var yyToknames = [...]string{ "tokIndex", "tokNumber", "tokFormat", - "tokInvalid", "tokString", "tokStringStart", "tokStringQuery", @@ -111,6 +117,9 @@ var yyToknames = [...]string{ "tokFuncDefPost", "tokTermPost", "tokEmptyCatch", + "tokInvalid", + "tokInvalidEscapeSequence", + "tokUnterminatedString", "'|'", "','", "'+'", @@ -136,300 +145,303 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line parser.go.y:665 +//line parser.go.y:671 //line yacctab:1 -var yyExca = [...]int{ +var yyExca = [...]int16{ -1, 1, 1, -1, -2, 0, - -1, 132, + -1, 129, 5, 0, - -2, 32, - -1, 135, + -2, 26, + -1, 132, 9, 0, - -2, 35, - -1, 196, - 56, 113, - -2, 54, + -2, 29, + -1, 193, + 58, 113, + -2, 48, } const yyPrivate = 57344 -const yyLast = 1053 - -var yyAct = [...]int{ - 88, 234, 176, 111, 14, 171, 12, 122, 211, 31, - 177, 192, 109, 116, 9, 142, 48, 225, 97, 99, - 95, 96, 91, 143, 51, 162, 124, 10, 245, 223, - 233, 103, 224, 106, 157, 158, 232, 117, 107, 108, - 105, 244, 222, 238, 102, 112, 237, 77, 78, 104, - 79, 80, 81, 262, 257, 209, 144, 123, 208, 241, - 227, 226, 145, 165, 164, 128, 77, 78, 127, 79, - 80, 81, 84, 85, 86, 129, 75, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 74, 76, - 82, 83, 84, 85, 86, 149, 75, 90, 126, 198, - 243, 174, 197, 147, 47, 160, 75, 74, 76, 82, - 83, 84, 85, 86, 166, 75, 146, 276, 240, 156, - 275, 42, 43, 152, 163, 93, 92, 94, 125, 255, - 185, 186, 265, 90, 46, 181, 182, 183, 45, 51, - 119, 188, 175, 179, 42, 43, 180, 94, 100, 193, - 169, 199, 170, 168, 202, 194, 203, 204, 205, 101, - 190, 93, 92, 94, 207, 172, 173, 200, 201, 212, - 212, 215, 184, 112, 213, 98, 210, 217, 10, 216, - 187, 13, 123, 181, 182, 183, 121, 219, 220, 13, - 3, 179, 11, 5, 180, 90, 228, 7, 8, 230, - 44, 28, 27, 218, 221, 178, 87, 49, 77, 78, - 239, 79, 80, 81, 110, 82, 83, 84, 85, 86, - 184, 75, 151, 93, 92, 94, 10, 154, 254, 193, - 80, 81, 90, 252, 253, 194, 256, 247, 159, 246, - 120, 191, 248, 249, 258, 212, 212, 189, 261, 259, - 260, 82, 83, 84, 85, 86, 266, 75, 268, 141, - 93, 92, 94, 206, 270, 271, 6, 4, 272, 82, - 83, 84, 85, 86, 277, 75, 2, 278, 269, 20, - 1, 19, 37, 24, 25, 26, 38, 40, 39, 41, - 23, 29, 30, 0, 42, 43, 0, 0, 17, 0, - 0, 0, 0, 18, 0, 15, 16, 22, 0, 89, - 0, 0, 0, 34, 33, 0, 0, 0, 21, 90, - 36, 0, 150, 32, 0, 148, 35, 20, 0, 19, - 37, 24, 25, 26, 38, 40, 39, 41, 23, 29, - 30, 0, 42, 43, 0, 0, 17, 93, 92, 94, - 0, 18, 0, 15, 16, 22, 0, 0, 0, 0, - 0, 34, 33, 0, 0, 0, 21, 0, 36, 0, - 0, 32, 0, 229, 35, 20, 0, 19, 37, 24, - 25, 26, 38, 40, 39, 41, 23, 29, 30, 0, - 42, 43, 0, 0, 17, 0, 0, 0, 0, 18, - 0, 15, 16, 22, 0, 0, 0, 0, 0, 34, - 33, 0, 0, 0, 21, 0, 36, 0, 0, 32, - 0, 118, 35, 20, 0, 19, 37, 24, 25, 26, - 38, 40, 39, 41, 23, 29, 30, 0, 42, 43, - 0, 0, 17, 0, 0, 0, 0, 18, 0, 15, - 16, 22, 0, 0, 0, 0, 0, 34, 33, 0, - 0, 0, 21, 0, 36, 0, 0, 32, 53, 54, - 35, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 114, 196, 0, 0, 0, 0, 0, 0, 42, - 43, 0, 0, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 53, 54, 0, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 114, 115, 0, 195, 0, - 0, 0, 0, 42, 43, 0, 0, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 37, 24, 25, 26, - 38, 40, 39, 41, 23, 29, 30, 0, 42, 43, - 77, 78, 113, 79, 80, 81, 0, 0, 0, 0, - 0, 22, 0, 0, 0, 0, 0, 34, 33, 79, - 80, 81, 21, 0, 36, 0, 0, 32, 77, 78, - 35, 79, 80, 81, 0, 0, 0, 0, 0, 0, - 0, 74, 76, 82, 83, 84, 85, 86, 0, 75, - 0, 0, 0, 77, 78, 251, 79, 80, 81, 82, - 83, 84, 85, 86, 0, 75, 0, 0, 0, 74, - 76, 82, 83, 84, 85, 86, 81, 75, 0, 0, - 0, 77, 78, 231, 79, 80, 81, 0, 0, 0, - 0, 0, 0, 0, 74, 76, 82, 83, 84, 85, - 86, 0, 75, 0, 0, 0, 77, 78, 167, 79, - 80, 81, 0, 0, 82, 83, 84, 85, 86, 0, - 75, 0, 74, 76, 82, 83, 84, 85, 86, 0, - 75, 0, 0, 77, 78, 279, 79, 80, 81, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 76, 82, - 83, 84, 85, 86, 0, 75, 0, 0, 77, 78, - 274, 79, 80, 81, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 76, 82, 83, 84, 85, - 86, 0, 75, 0, 0, 77, 78, 250, 79, 80, - 81, 0, 0, 0, 0, 0, 0, 0, 0, 74, - 76, 82, 83, 84, 85, 86, 0, 75, 0, 0, - 77, 78, 242, 79, 80, 81, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 74, 76, 82, 83, - 84, 85, 86, 0, 75, 0, 0, 77, 78, 214, - 79, 80, 81, 0, 0, 0, 0, 0, 0, 0, - 0, 74, 76, 82, 83, 84, 85, 86, 0, 75, - 0, 0, 77, 78, 161, 79, 80, 81, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 74, 76, - 82, 83, 84, 85, 86, 0, 75, 0, 273, 77, - 78, 0, 79, 80, 81, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 76, 82, 83, 84, 85, 86, - 0, 75, 0, 264, 77, 78, 0, 79, 80, 81, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 74, 76, 82, 83, 84, 85, 86, 0, 75, 0, - 263, 77, 78, 0, 79, 80, 81, 0, 0, 0, - 0, 0, 0, 0, 0, 74, 76, 82, 83, 84, - 85, 86, 0, 75, 0, 236, 0, 0, 0, 77, - 78, 235, 79, 80, 81, 0, 0, 0, 0, 0, - 0, 0, 74, 76, 82, 83, 84, 85, 86, 0, - 75, 77, 78, 0, 79, 80, 81, 0, 267, 0, - 77, 78, 0, 79, 80, 81, 0, 0, 0, 0, - 74, 76, 82, 83, 84, 85, 86, 0, 75, 77, - 78, 0, 79, 80, 81, 155, 0, 0, 0, 153, - 0, 0, 74, 76, 82, 83, 84, 85, 86, 0, - 75, 74, 76, 82, 83, 84, 85, 86, 0, 75, +const yyLast = 1060 + +var yyAct = [...]int16{ + 85, 139, 173, 198, 209, 189, 9, 102, 101, 174, + 12, 150, 107, 6, 47, 140, 7, 88, 31, 242, + 49, 178, 179, 180, 245, 241, 226, 109, 157, 176, + 98, 177, 122, 114, 115, 96, 97, 244, 119, 111, + 112, 225, 252, 156, 103, 116, 117, 121, 263, 113, + 141, 178, 179, 180, 236, 206, 142, 235, 205, 176, + 181, 177, 238, 152, 153, 218, 7, 74, 75, 253, + 76, 77, 78, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 224, 239, 76, 77, 78, + 181, 228, 146, 227, 159, 201, 7, 158, 223, 155, + 125, 124, 123, 44, 151, 160, 185, 148, 143, 144, + 72, 73, 79, 80, 81, 82, 83, 42, 43, 164, + 265, 195, 258, 259, 194, 42, 43, 182, 183, 79, + 80, 81, 82, 83, 94, 49, 93, 172, 81, 82, + 83, 166, 169, 187, 170, 168, 91, 184, 196, 197, + 190, 87, 118, 202, 92, 74, 75, 204, 76, 77, + 78, 191, 95, 213, 211, 214, 208, 215, 216, 210, + 210, 217, 199, 200, 74, 75, 103, 76, 77, 78, + 149, 90, 89, 91, 220, 221, 3, 222, 79, 80, + 81, 82, 83, 229, 8, 165, 231, 24, 72, 73, + 79, 80, 81, 82, 83, 87, 84, 237, 151, 23, + 233, 219, 251, 175, 46, 86, 100, 72, 73, 79, + 80, 81, 82, 83, 163, 87, 246, 110, 257, 248, + 249, 232, 247, 11, 190, 90, 89, 91, 240, 11, + 254, 154, 260, 261, 256, 191, 120, 188, 262, 255, + 210, 186, 138, 203, 264, 90, 89, 91, 10, 266, + 267, 5, 87, 4, 2, 270, 1, 0, 0, 273, + 274, 0, 0, 275, 0, 0, 0, 51, 52, 279, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 105, 106, 90, 89, 91, 0, 0, 42, 43, 77, + 78, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 0, 0, 16, 0, 13, 36, 20, 21, 22, 38, + 40, 39, 41, 19, 27, 30, 42, 43, 0, 104, + 32, 0, 0, 207, 0, 33, 0, 34, 35, 18, + 79, 80, 81, 82, 83, 0, 0, 0, 28, 29, + 0, 0, 0, 17, 0, 26, 0, 147, 37, 0, + 145, 25, 51, 52, 0, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 105, 106, 0, 0, 0, + 0, 0, 42, 43, 0, 78, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 14, 15, 16, 0, 13, + 36, 20, 21, 22, 38, 40, 39, 41, 19, 27, + 30, 42, 43, 0, 104, 32, 0, 0, 99, 0, + 33, 0, 34, 35, 18, 79, 80, 81, 82, 83, + 0, 0, 0, 28, 29, 0, 0, 0, 17, 0, + 26, 0, 0, 37, 0, 16, 25, 13, 36, 20, + 21, 22, 38, 40, 39, 41, 19, 27, 30, 42, + 43, 0, 0, 32, 0, 0, 0, 0, 33, 0, + 34, 35, 18, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 29, 0, 0, 0, 17, 0, 26, 0, + 0, 37, 0, 230, 25, 16, 0, 13, 36, 20, + 21, 22, 38, 40, 39, 41, 19, 27, 30, 42, + 43, 0, 0, 32, 0, 0, 0, 0, 33, 0, + 34, 35, 18, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 29, 0, 0, 0, 17, 0, 26, 0, + 0, 37, 0, 108, 25, 16, 0, 13, 36, 20, + 21, 22, 38, 40, 39, 41, 19, 27, 30, 42, + 43, 74, 75, 32, 76, 77, 78, 0, 33, 0, + 34, 35, 18, 0, 0, 0, 0, 0, 0, 0, + 0, 28, 29, 0, 0, 0, 17, 0, 26, 0, + 0, 37, 51, 52, 25, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 48, 79, 80, 81, 82, + 83, 0, 50, 0, 0, 0, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 51, 52, 0, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 48, 0, + 0, 0, 0, 0, 0, 50, 0, 0, 171, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 0, 0, + 36, 20, 21, 22, 38, 40, 39, 41, 19, 27, + 30, 42, 43, 0, 0, 32, 0, 0, 0, 0, + 33, 45, 34, 35, 18, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 29, 0, 0, 0, 17, 0, + 26, 0, 0, 37, 51, 52, 25, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 105, 193, 0, + 0, 0, 0, 0, 42, 43, 0, 0, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 74, 75, 0, + 76, 77, 78, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 74, 75, 192, 76, 77, 78, + 0, 74, 75, 0, 76, 77, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 74, 76, 82, 83, 84, 85, 86, 0, 75, 53, - 54, 0, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 50, 0, 0, 0, 0, 0, 0, 0, - 52, 0, 0, 0, 65, 66, 67, 68, 69, 70, - 71, 72, 73, + 72, 73, 79, 80, 81, 82, 83, 0, 0, 0, + 278, 74, 75, 277, 76, 77, 78, 72, 73, 79, + 80, 81, 82, 83, 72, 73, 79, 80, 81, 82, + 83, 161, 0, 0, 0, 74, 75, 280, 76, 77, + 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 72, 73, 79, 80, 81, 82, + 83, 74, 75, 0, 76, 77, 78, 276, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 72, 73, + 79, 80, 81, 82, 83, 74, 75, 0, 76, 77, + 78, 250, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 72, 73, 79, 80, 81, 82, + 83, 74, 75, 0, 76, 77, 78, 243, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 72, 73, + 79, 80, 81, 82, 83, 74, 75, 0, 76, 77, + 78, 212, 0, 0, 0, 0, 74, 75, 0, 76, + 77, 78, 0, 0, 72, 73, 79, 80, 81, 82, + 83, 74, 75, 0, 76, 77, 78, 167, 0, 0, + 0, 0, 74, 75, 0, 76, 77, 78, 72, 73, + 79, 80, 81, 82, 83, 0, 0, 0, 271, 72, + 73, 79, 80, 81, 82, 83, 0, 74, 75, 269, + 76, 77, 78, 0, 72, 73, 79, 80, 81, 82, + 83, 0, 0, 0, 268, 72, 73, 79, 80, 81, + 82, 83, 0, 74, 75, 234, 76, 77, 78, 0, + 74, 75, 0, 76, 77, 78, 0, 0, 0, 0, + 72, 73, 79, 80, 81, 82, 83, 0, 0, 0, + 0, 272, 0, 0, 0, 0, 0, 0, 162, 0, + 0, 0, 0, 0, 0, 0, 72, 73, 79, 80, + 81, 82, 83, 72, 73, 79, 80, 81, 82, 83, } -var yyPact = [...]int{ - 180, -1000, 186, -33, -1000, 410, 186, 110, 106, 49, - 1012, -1000, 965, 410, 295, 520, 520, 410, 410, 127, - 139, 93, -1000, -1000, -1000, -1000, -1000, -8, -1000, -1000, - 116, -1000, 410, 520, 520, 495, 362, 119, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, 172, -33, -1000, -35, 82, - 42, 12, 9, -1000, -1000, -1000, -1000, -1000, -1000, -1000, +var yyPact = [...]int16{ + 176, -1000, -1000, -46, -1000, 384, 46, 618, -1000, 973, + -1000, 532, 201, 133, 109, 107, 142, 90, -1000, -1000, + -1000, -1000, -1000, -29, -1000, 355, 482, -1000, 644, 644, + 98, -1000, 532, 532, 644, 644, 131, 532, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -16, -1000, 44, 43, + 42, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 410, -1000, 410, 410, 410, 410, - 410, 410, 410, 410, 410, 410, 410, -1000, 965, 2, - -1000, -1000, -1000, 93, 266, 208, 109, 946, 410, 937, - 74, -22, -1000, -1000, 410, -1000, 756, 171, 171, -36, - 78, 8, 7, 410, -1000, -1000, -1000, 599, -1000, -1000, - 122, 145, 46, -1000, -1000, 1012, 166, 166, 166, 965, - 204, 204, 562, 222, 617, 168, 23, 23, 53, 53, - 53, 135, -1000, -1000, 2, 461, -1000, -1000, -1000, 43, - 410, 2, 2, 410, -1000, 410, 410, 410, 145, 0, - 965, -1000, -1000, 495, 520, 520, 731, -1000, -1000, -1000, - 410, -33, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 118, -1000, -1000, 410, 2, -17, - -1000, -29, -1000, 5, 4, 410, -1000, -1000, 314, 574, - -21, -27, 887, -1000, 965, 860, -12, -1000, -1000, 410, - -1000, -1000, 73, -1000, 3, 704, 45, -1000, -18, -1000, - 965, -1000, -1000, 2, -1000, 461, 2, 2, 679, -1000, - 546, -1000, 410, 410, 94, 410, -1000, -2, 145, 965, - 520, 520, -1000, -1000, -1000, 166, -1000, -1000, -1000, -1000, - -3, -1000, 835, 808, 96, 410, 915, 410, -1000, -1000, - -1000, -1000, 2, 410, 410, -1000, 965, 410, 783, -1000, - 652, 62, 887, -1000, -1000, -1000, 410, -1000, 627, -1000, + -1000, -1000, 532, 532, 532, 532, 532, 532, 532, 532, + 532, 532, 532, 532, -1000, 973, -6, -1000, -1000, -1000, + 90, 299, 60, 166, -46, 5, -1000, -1000, 532, -1000, + -20, -1000, 39, 36, 532, -1000, -1000, -1000, -1000, 750, + 532, 238, 238, -1000, 1006, 82, 181, 127, -1000, 887, + 115, -1000, 585, 34, 34, 34, 973, 557, 557, 80, + 291, 376, 139, 87, 87, -1000, -1000, -1000, 100, -1000, + -1000, -6, 697, -1000, -1000, -1000, 63, 532, 532, 152, + 38, -1000, 532, 152, -2, 973, -1000, 270, 644, 644, + 861, -1000, 532, -1000, 532, -6, -6, -1000, -1000, -1000, + 532, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, 4, -1000, -1000, 532, -6, 37, -1000, -22, -1000, + 35, 33, 532, -1000, -1000, 432, 170, 973, -46, -1000, + -1000, -1000, 948, -3, -1000, -1000, 532, -1000, -1000, 15, + 238, 15, 28, 973, -1000, -34, -40, 837, -1000, -24, + -1000, 973, -1000, -1000, -6, -1000, 697, -6, -6, 811, + -1000, 151, -1000, -15, -1000, 11, 152, 973, 644, 644, + 89, 532, 532, -1000, -1000, 34, -1000, -1000, -1000, -1000, + -10, -1000, -1000, 532, -1000, 238, 15, 85, 532, 532, + 937, 922, -1000, -6, 911, -1000, 999, 973, 532, 532, + -1000, -1000, 532, 787, 733, 973, -1000, -1000, 532, 757, + -1000, } -var yyPgo = [...]int{ - 0, 280, 276, 267, 193, 266, 7, 192, 175, 263, - 0, 259, 15, 247, 241, 11, 4, 9, 240, 22, - 238, 1, 228, 227, 12, 214, 8, 2, 10, 16, - 207, 205, 203, 5, 202, 201, 13, 3, +var yyPgo = [...]int16{ + 0, 266, 264, 263, 261, 258, 11, 194, 227, 253, + 0, 252, 1, 251, 247, 5, 10, 18, 246, 17, + 241, 238, 228, 224, 216, 8, 4, 2, 9, 214, + 14, 213, 211, 3, 209, 197, 12, 7, } -var yyR1 = [...]int{ +var yyR1 = [...]int8{ 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 33, 33, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, - 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, + 10, 10, 10, 10, 10, 10, 11, 11, 12, 12, + 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 17, 17, 18, 18, 18, 34, 34, 35, - 35, 19, 19, 19, 19, 19, 20, 20, 21, 21, - 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 17, 17, 18, 18, 18, 34, 34, + 35, 35, 19, 19, 19, 19, 19, 20, 20, 21, + 21, 22, 22, 23, 23, 24, 24, 25, 25, 25, 25, 25, 37, 37, 37, 26, 26, 27, 27, 27, - 27, 27, 27, 27, 28, 29, 29, 29, 30, 30, - 30, 31, 31, 32, 32, 36, 36, 36, 36, 36, + 27, 27, 27, 27, 28, 28, 28, 29, 29, 30, + 30, 30, 31, 31, 32, 32, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, } -var yyR2 = [...]int{ +var yyR2 = [...]int8{ 0, 2, 0, 3, 2, 2, 0, 2, 6, 4, 0, 1, 0, 2, 5, 8, 1, 3, 1, 1, - 2, 3, 5, 9, 9, 11, 7, 3, 4, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, - 3, 3, 3, 5, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, - 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, - 3, 3, 1, 3, 0, 2, 4, 1, 1, 1, - 1, 2, 3, 4, 4, 5, 1, 3, 0, 5, - 0, 2, 0, 2, 0, 1, 3, 3, 3, 5, + 2, 3, 5, 4, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 1, 1, 3, 1, 3, + 3, 1, 3, 1, 3, 3, 3, 5, 1, 1, + 1, 1, 2, 2, 1, 1, 1, 1, 4, 1, + 2, 3, 4, 2, 3, 1, 2, 2, 1, 2, + 1, 7, 3, 9, 9, 11, 2, 3, 2, 2, + 2, 3, 3, 1, 3, 0, 2, 4, 1, 1, + 1, 1, 2, 3, 4, 4, 5, 1, 3, 0, + 5, 0, 2, 0, 2, 1, 3, 3, 3, 5, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 3, 0, 1, 3, 3, 3, - 3, 2, 3, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 3, 4, 1, 3, 3, + 3, 3, 2, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, } -var yyChk = [...]int{ - -1000, -1, -2, 10, -3, -4, -5, 11, 12, -28, - 60, -7, -10, -8, -16, 39, 40, 32, 37, 15, - 13, 52, 41, 24, 17, 18, 19, -34, -35, 25, - 26, -17, 57, 48, 47, 60, 54, 16, 20, 22, - 21, 23, 28, 29, -4, 28, 28, 55, -29, -30, - 20, -36, 28, 7, 8, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 45, 53, 46, 4, 5, 7, - 8, 9, 47, 48, 49, 50, 51, -7, -10, 14, - 24, -19, 53, 52, 54, -16, -16, -10, -8, -10, - 21, 20, -19, -17, 57, -17, -10, -16, -16, -24, - -25, -37, -17, 57, 20, 21, -36, -10, 59, 21, - -18, 14, -6, -28, 61, 46, 56, 56, 56, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -11, -12, 21, 54, 60, -19, -17, 59, -10, - 56, 14, 14, 33, -23, 38, 45, 56, 57, -20, - -10, 58, 61, 46, 56, 56, -10, 59, 31, 28, - 30, -33, 20, 21, 55, -29, -27, -28, -31, 25, - 28, 17, 18, 19, 54, -27, -27, 45, 6, -13, - -12, -14, -15, -37, -17, 57, 21, 59, 56, -10, - -12, -12, -10, -10, -10, -10, -9, -33, 58, 55, - -24, -26, -16, -26, 58, -10, -6, 59, -32, -27, - -10, -12, 59, 46, 61, 46, 56, 56, -10, 59, - -10, 59, 57, 57, -21, 34, 55, 58, 55, -10, - 45, 56, 58, 55, 59, 46, -12, -15, -12, -12, - 58, 59, -10, -10, -22, 35, -10, 56, -33, -26, - -26, -27, 56, 55, 55, 36, -10, 33, -10, -12, - -10, -10, -10, 55, 58, 58, 55, -21, -10, 58, +var yyChk = [...]int16{ + -1000, -1, -2, 10, -3, -4, -28, 62, -7, -10, + -5, -8, -16, 15, 11, 12, 13, 54, 40, 24, + 17, 18, 19, -34, -35, 62, 56, 25, 49, 50, + 26, -17, 31, 36, 38, 39, 16, 59, 20, 22, + 21, 23, 27, 28, 57, 63, -29, -30, 20, -36, + 27, 7, 8, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 47, 48, 4, 5, 7, 8, 9, 49, + 50, 51, 52, 53, -7, -10, 14, 24, -19, 55, + 54, 56, 21, 27, 27, 20, -19, -17, 59, 63, + -24, -25, -37, -17, 59, 20, 21, -36, 61, -10, + -8, -16, -16, -17, -10, -10, -16, -16, 21, -10, + -18, 63, 48, 58, 58, 58, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -11, -12, + 21, 56, 62, -19, -17, 61, -10, 58, 47, 14, + -6, -28, 58, 59, -20, -10, 63, 48, 58, 58, + -10, 61, 32, -23, 37, 14, 14, 60, 30, 27, + 29, 63, -30, -27, -28, -31, 25, 27, 17, 18, + 19, 56, -27, -27, 47, 6, -13, -12, -14, -15, + -37, -17, 59, 21, 61, 58, -10, -10, -33, 20, + 21, 57, -10, -9, -33, 60, 57, 63, -25, -26, + -16, -26, 60, -10, -10, -12, -12, -10, 61, -32, + -27, -10, -12, 61, 48, 63, 48, 58, 58, -10, + 61, -10, 61, -6, 57, 60, 57, -10, 47, 58, + -21, 59, 59, 60, 61, 48, -12, -15, -12, -12, + 60, 61, 57, 58, -33, -16, -26, -22, 33, 34, + -10, -10, -27, 58, -10, 35, -10, -10, 57, 57, + -12, 57, 32, -10, -10, -10, 60, 60, 57, -10, + 60, } -var yyDef = [...]int{ - 2, -2, 6, 0, 1, 12, 6, 0, 0, 0, - 125, 4, 5, 12, 41, 0, 0, 0, 0, 0, - 0, 55, 56, 57, 60, 61, 62, 63, 65, 66, - 67, 69, 0, 0, 0, 104, 0, 0, 87, 88, - 89, 90, 82, 84, 7, 0, 10, 3, 0, 126, - 0, 0, 0, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 0, 29, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 20, 0, - 77, 78, 79, 0, 0, 0, 0, 0, 0, 102, - 0, 0, 58, 59, 0, 68, 0, 71, 72, 0, - 105, 110, 111, 0, 112, 113, 114, 0, 75, 76, - 0, 0, 0, 11, 124, 125, 0, 0, 0, 21, - 30, 31, -2, 33, 34, -2, 36, 37, 38, 39, - 40, 0, 42, 44, 0, 0, 80, 81, 91, 0, - 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, - 96, 70, 73, 104, 0, 0, 0, 74, 83, 85, - 0, 10, 18, 19, 9, 127, 128, 117, 118, 119, - 120, 121, 122, 123, 0, 129, 130, 0, 0, 0, - 47, 0, 49, 0, 0, 0, -2, 92, 0, 0, - 0, 0, 98, 103, 28, 0, 0, 16, 64, 0, - 106, 107, 115, 108, 0, 0, 0, 131, 0, 133, - 22, 43, 45, 0, 46, 0, 0, 0, 0, 93, - 0, 94, 0, 0, 100, 0, 14, 0, 0, 97, - 0, 0, 86, 8, 132, 0, 48, 50, 51, 52, - 0, 95, 0, 0, 0, 0, 0, 0, 17, 116, - 109, 134, 0, 0, 0, 26, 101, 0, 0, 53, - 0, 0, 98, 15, 23, 24, 0, 99, 0, 25, +var yyDef = [...]int16{ + 2, -2, 6, 0, 1, 12, 0, 0, 4, 5, + 7, 12, 35, 0, 0, 0, 0, 49, 50, 51, + 54, 55, 56, 57, 59, 0, 0, 65, 0, 0, + 68, 70, 0, 0, 0, 0, 0, 0, 88, 89, + 90, 91, 83, 85, 3, 124, 0, 127, 0, 0, + 0, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 13, 20, 0, 78, 79, 80, + 0, 0, 0, 0, 10, 0, 52, 53, 0, 60, + 0, 105, 110, 111, 0, 112, 113, 114, 63, 0, + 0, 66, 67, 69, 0, 103, 0, 0, 76, 0, + 0, 125, 0, 0, 0, 0, 21, 24, 25, -2, + 27, 28, -2, 30, 31, 32, 33, 34, 0, 36, + 38, 0, 0, 81, 82, 92, 0, 0, 0, 0, + 0, 11, 0, 0, 0, 97, 61, 0, 0, 0, + 0, 64, 0, 72, 0, 0, 0, 77, 84, 86, + 0, 126, 128, 129, 117, 118, 119, 120, 121, 122, + 123, 0, 130, 131, 0, 0, 0, 41, 0, 43, + 0, 0, 0, -2, 93, 0, 0, 23, 10, 18, + 19, 9, 0, 0, 16, 58, 0, 62, 106, 107, + 115, 108, 0, 99, 104, 0, 0, 0, 132, 0, + 134, 22, 37, 39, 0, 40, 0, 0, 0, 0, + 94, 0, 95, 0, 14, 0, 0, 98, 0, 0, + 101, 0, 0, 87, 133, 0, 42, 44, 45, 46, + 0, 96, 8, 0, 17, 116, 109, 0, 0, 0, + 0, 0, 135, 0, 0, 71, 0, 102, 0, 0, + 47, 15, 0, 0, 0, 100, 73, 74, 0, 0, + 75, } -var yyTok1 = [...]int{ +var yyTok1 = [...]int8{ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 51, 3, 3, - 57, 58, 49, 47, 46, 48, 52, 50, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 56, 55, - 3, 3, 3, 53, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 53, 3, 3, + 59, 60, 51, 49, 48, 50, 54, 52, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 58, 57, + 3, 3, 3, 55, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 54, 3, 59, 3, 3, 3, 3, 3, 3, + 3, 56, 3, 61, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 60, 45, 61, + 3, 3, 3, 62, 47, 63, } -var yyTok2 = [...]int{ +var yyTok2 = [...]int8{ 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, + 42, 43, 44, 45, 46, } -var yyTok3 = [...]int{ +var yyTok3 = [...]int8{ 0, } @@ -511,9 +523,9 @@ func yyErrorMessage(state, lookAhead int) string { expected := make([]int, 0, 4) // Look for shiftable tokens. - base := yyPact[state] + base := int(yyPact[state]) for tok := TOKSTART; tok-1 < len(yyToknames); tok++ { - if n := base + tok; n >= 0 && n < yyLast && yyChk[yyAct[n]] == tok { + if n := base + tok; n >= 0 && n < yyLast && int(yyChk[int(yyAct[n])]) == tok { if len(expected) == cap(expected) { return res } @@ -523,13 +535,13 @@ func yyErrorMessage(state, lookAhead int) string { if yyDef[state] == -2 { i := 0 - for yyExca[i] != -1 || yyExca[i+1] != state { + for yyExca[i] != -1 || int(yyExca[i+1]) != state { i += 2 } // Look for tokens that we accept or reduce. for i += 2; yyExca[i] >= 0; i += 2 { - tok := yyExca[i] + tok := int(yyExca[i]) if tok < TOKSTART || yyExca[i+1] == 0 { continue } @@ -560,30 +572,30 @@ func yylex1(lex yyLexer, lval *yySymType) (char, token int) { token = 0 char = lex.Lex(lval) if char <= 0 { - token = yyTok1[0] + token = int(yyTok1[0]) goto out } if char < len(yyTok1) { - token = yyTok1[char] + token = int(yyTok1[char]) goto out } if char >= yyPrivate { if char < yyPrivate+len(yyTok2) { - token = yyTok2[char-yyPrivate] + token = int(yyTok2[char-yyPrivate]) goto out } } for i := 0; i < len(yyTok3); i += 2 { - token = yyTok3[i+0] + token = int(yyTok3[i+0]) if token == char { - token = yyTok3[i+1] + token = int(yyTok3[i+1]) goto out } } out: if token == 0 { - token = yyTok2[1] /* unknown char */ + token = int(yyTok2[1]) /* unknown char */ } if yyDebug >= 3 { __yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char)) @@ -638,7 +650,7 @@ yystack: yyS[yyp].yys = yystate yynewstate: - yyn = yyPact[yystate] + yyn = int(yyPact[yystate]) if yyn <= yyFlag { goto yydefault /* simple state */ } @@ -649,8 +661,8 @@ yynewstate: if yyn < 0 || yyn >= yyLast { goto yydefault } - yyn = yyAct[yyn] - if yyChk[yyn] == yytoken { /* valid shift */ + yyn = int(yyAct[yyn]) + if int(yyChk[yyn]) == yytoken { /* valid shift */ yyrcvr.char = -1 yytoken = -1 yyVAL = yyrcvr.lval @@ -663,7 +675,7 @@ yynewstate: yydefault: /* default state action */ - yyn = yyDef[yystate] + yyn = int(yyDef[yystate]) if yyn == -2 { if yyrcvr.char < 0 { yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval) @@ -672,18 +684,18 @@ yydefault: /* look through exception table */ xi := 0 for { - if yyExca[xi+0] == -1 && yyExca[xi+1] == yystate { + if yyExca[xi+0] == -1 && int(yyExca[xi+1]) == yystate { break } xi += 2 } for xi += 2; ; xi += 2 { - yyn = yyExca[xi+0] + yyn = int(yyExca[xi+0]) if yyn < 0 || yyn == yytoken { break } } - yyn = yyExca[xi+1] + yyn = int(yyExca[xi+1]) if yyn < 0 { goto ret0 } @@ -705,10 +717,10 @@ yydefault: /* find a state where "error" is a legal shift action */ for yyp >= 0 { - yyn = yyPact[yyS[yyp].yys] + yyErrCode + yyn = int(yyPact[yyS[yyp].yys]) + yyErrCode if yyn >= 0 && yyn < yyLast { - yystate = yyAct[yyn] /* simulate a shift of "error" */ - if yyChk[yystate] == yyErrCode { + yystate = int(yyAct[yyn]) /* simulate a shift of "error" */ + if int(yyChk[yystate]) == yyErrCode { goto yystack } } @@ -744,7 +756,7 @@ yydefault: yypt := yyp _ = yypt // guard against "declared and not used" - yyp -= yyR2[yyn] + yyp -= int(yyR2[yyn]) // yyp is now the index of $0. Perform the default action. Iff the // reduced production is ε, $1 is possibly out of range. if yyp+1 >= len(yyS) { @@ -755,16 +767,16 @@ yydefault: yyVAL = yyS[yyp+1] /* consult goto table to find next state */ - yyn = yyR1[yyn] - yyg := yyPgo[yyn] + yyn = int(yyR1[yyn]) + yyg := int(yyPgo[yyn]) yyj := yyg + yyS[yyp].yys + 1 if yyj >= yyLast { - yystate = yyAct[yyg] + yystate = int(yyAct[yyg]) } else { - yystate = yyAct[yyj] - if yyChk[yystate] != -yyn { - yystate = yyAct[yyg] + yystate = int(yyAct[yyj]) + if int(yyChk[yystate]) != -yyn { + yystate = int(yyAct[yyg]) } } // dummy call; replaced with literal code @@ -772,7 +784,7 @@ yydefault: case 1: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:53 +//line parser.go.y:59 { if yyDollar[1].value != nil { yyDollar[2].value.(*Query).Meta = yyDollar[1].value.(*ConstObject) @@ -781,25 +793,25 @@ yydefault: } case 2: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:60 +//line parser.go.y:66 { yyVAL.value = nil } case 3: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:64 +//line parser.go.y:70 { yyVAL.value = yyDollar[2].value } case 4: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:70 +//line parser.go.y:76 { - yyVAL.value = &Query{Imports: yyDollar[1].value.([]*Import), FuncDefs: yyDollar[2].value.([]*FuncDef), Term: &Term{Type: TermTypeIdentity}} + yyVAL.value = &Query{Imports: yyDollar[1].value.([]*Import), FuncDefs: reverseFuncDef(yyDollar[2].value.([]*FuncDef)), Term: &Term{Type: TermTypeIdentity}} } case 5: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:74 +//line parser.go.y:80 { if yyDollar[1].value != nil { yyDollar[2].value.(*Query).Imports = yyDollar[1].value.([]*Import) @@ -808,322 +820,282 @@ yydefault: } case 6: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:81 +//line parser.go.y:87 { yyVAL.value = []*Import(nil) } case 7: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:85 +//line parser.go.y:91 { - yyVAL.value = prependImport(yyDollar[2].value.([]*Import), yyDollar[1].value.(*Import)) + yyVAL.value = append(yyDollar[1].value.([]*Import), yyDollar[2].value.(*Import)) } case 8: yyDollar = yyS[yypt-6 : yypt+1] -//line parser.go.y:91 +//line parser.go.y:97 { yyVAL.value = &Import{ImportPath: yyDollar[2].token, ImportAlias: yyDollar[4].token, Meta: yyDollar[5].value.(*ConstObject)} } case 9: yyDollar = yyS[yypt-4 : yypt+1] -//line parser.go.y:95 +//line parser.go.y:101 { yyVAL.value = &Import{IncludePath: yyDollar[2].token, Meta: yyDollar[3].value.(*ConstObject)} } case 10: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:101 +//line parser.go.y:107 { yyVAL.value = (*ConstObject)(nil) } case 11: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:104 +//line parser.go.y:110 { } case 12: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:108 +//line parser.go.y:114 { yyVAL.value = []*FuncDef(nil) } case 13: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:112 +//line parser.go.y:118 { - yyVAL.value = prependFuncDef(yyDollar[2].value.([]*FuncDef), yyDollar[1].value.(*FuncDef)) + yyVAL.value = append(yyDollar[2].value.([]*FuncDef), yyDollar[1].value.(*FuncDef)) } case 14: yyDollar = yyS[yypt-5 : yypt+1] -//line parser.go.y:118 +//line parser.go.y:124 { yyVAL.value = &FuncDef{Name: yyDollar[2].token, Body: yyDollar[4].value.(*Query)} } case 15: yyDollar = yyS[yypt-8 : yypt+1] -//line parser.go.y:122 +//line parser.go.y:128 { yyVAL.value = &FuncDef{yyDollar[2].token, yyDollar[4].value.([]string), yyDollar[7].value.(*Query)} } case 16: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:128 +//line parser.go.y:134 { yyVAL.value = []string{yyDollar[1].token} } case 17: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:132 +//line parser.go.y:138 { yyVAL.value = append(yyDollar[1].value.([]string), yyDollar[3].token) } case 18: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:137 +//line parser.go.y:143 { } case 19: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:138 +//line parser.go.y:144 { } case 20: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:142 +//line parser.go.y:148 { yyDollar[2].value.(*Query).FuncDefs = prependFuncDef(yyDollar[2].value.(*Query).FuncDefs, yyDollar[1].value.(*FuncDef)) yyVAL.value = yyDollar[2].value } case 21: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:147 +//line parser.go.y:153 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpPipe, Right: yyDollar[3].value.(*Query)} } case 22: yyDollar = yyS[yypt-5 : yypt+1] -//line parser.go.y:151 +//line parser.go.y:157 { yyDollar[1].value.(*Term).SuffixList = append(yyDollar[1].value.(*Term).SuffixList, &Suffix{Bind: &Bind{yyDollar[3].value.([]*Pattern), yyDollar[5].value.(*Query)}}) yyVAL.value = &Query{Term: yyDollar[1].value.(*Term)} } case 23: - yyDollar = yyS[yypt-9 : yypt+1] -//line parser.go.y:156 - { - yyVAL.value = &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{yyDollar[2].value.(*Term), yyDollar[4].value.(*Pattern), yyDollar[6].value.(*Query), yyDollar[8].value.(*Query)}}} - } - case 24: - yyDollar = yyS[yypt-9 : yypt+1] -//line parser.go.y:160 - { - yyVAL.value = &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{yyDollar[2].value.(*Term), yyDollar[4].value.(*Pattern), yyDollar[6].value.(*Query), yyDollar[8].value.(*Query), nil}}} - } - case 25: - yyDollar = yyS[yypt-11 : yypt+1] -//line parser.go.y:164 - { - yyVAL.value = &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{yyDollar[2].value.(*Term), yyDollar[4].value.(*Pattern), yyDollar[6].value.(*Query), yyDollar[8].value.(*Query), yyDollar[10].value.(*Query)}}} - } - case 26: - yyDollar = yyS[yypt-7 : yypt+1] -//line parser.go.y:168 - { - yyVAL.value = &Query{Term: &Term{Type: TermTypeIf, If: &If{yyDollar[2].value.(*Query), yyDollar[4].value.(*Query), yyDollar[5].value.([]*IfElif), yyDollar[6].value.(*Query)}}} - } - case 27: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:172 - { - yyVAL.value = &Query{Term: &Term{Type: TermTypeTry, Try: &Try{yyDollar[2].value.(*Query), yyDollar[3].value.(*Query)}}} - } - case 28: yyDollar = yyS[yypt-4 : yypt+1] -//line parser.go.y:176 +//line parser.go.y:162 { yyVAL.value = &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{yyDollar[2].token, yyDollar[4].value.(*Query)}}} } - case 29: - yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:180 - { - if t := yyDollar[1].value.(*Query).Term; t != nil { - t.SuffixList = append(t.SuffixList, &Suffix{Optional: true}) - } else { - yyVAL.value = &Query{Term: &Term{Type: TermTypeQuery, Query: yyDollar[1].value.(*Query), SuffixList: []*Suffix{&Suffix{Optional: true}}}} - } - } - case 30: + case 24: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:188 +//line parser.go.y:166 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpComma, Right: yyDollar[3].value.(*Query)} } - case 31: + case 25: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:192 +//line parser.go.y:170 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: yyDollar[2].operator, Right: yyDollar[3].value.(*Query)} } - case 32: + case 26: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:196 +//line parser.go.y:174 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: yyDollar[2].operator, Right: yyDollar[3].value.(*Query)} } - case 33: + case 27: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:200 +//line parser.go.y:178 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpOr, Right: yyDollar[3].value.(*Query)} } - case 34: + case 28: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:204 +//line parser.go.y:182 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpAnd, Right: yyDollar[3].value.(*Query)} } - case 35: + case 29: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:208 +//line parser.go.y:186 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: yyDollar[2].operator, Right: yyDollar[3].value.(*Query)} } - case 36: + case 30: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:212 +//line parser.go.y:190 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpAdd, Right: yyDollar[3].value.(*Query)} } - case 37: + case 31: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:216 +//line parser.go.y:194 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpSub, Right: yyDollar[3].value.(*Query)} } - case 38: + case 32: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:220 +//line parser.go.y:198 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpMul, Right: yyDollar[3].value.(*Query)} } - case 39: + case 33: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:224 +//line parser.go.y:202 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpDiv, Right: yyDollar[3].value.(*Query)} } - case 40: + case 34: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:228 +//line parser.go.y:206 { yyVAL.value = &Query{Left: yyDollar[1].value.(*Query), Op: OpMod, Right: yyDollar[3].value.(*Query)} } - case 41: + case 35: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:232 +//line parser.go.y:210 { yyVAL.value = &Query{Term: yyDollar[1].value.(*Term)} } - case 42: + case 36: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:238 +//line parser.go.y:216 { yyVAL.value = []*Pattern{yyDollar[1].value.(*Pattern)} } - case 43: + case 37: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:242 +//line parser.go.y:220 { yyVAL.value = append(yyDollar[1].value.([]*Pattern), yyDollar[3].value.(*Pattern)) } - case 44: + case 38: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:248 +//line parser.go.y:226 { yyVAL.value = &Pattern{Name: yyDollar[1].token} } - case 45: + case 39: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:252 +//line parser.go.y:230 { yyVAL.value = &Pattern{Array: yyDollar[2].value.([]*Pattern)} } - case 46: + case 40: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:256 +//line parser.go.y:234 { yyVAL.value = &Pattern{Object: yyDollar[2].value.([]*PatternObject)} } - case 47: + case 41: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:262 +//line parser.go.y:240 { yyVAL.value = []*Pattern{yyDollar[1].value.(*Pattern)} } - case 48: + case 42: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:266 +//line parser.go.y:244 { yyVAL.value = append(yyDollar[1].value.([]*Pattern), yyDollar[3].value.(*Pattern)) } - case 49: + case 43: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:272 +//line parser.go.y:250 { yyVAL.value = []*PatternObject{yyDollar[1].value.(*PatternObject)} } - case 50: + case 44: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:276 +//line parser.go.y:254 { yyVAL.value = append(yyDollar[1].value.([]*PatternObject), yyDollar[3].value.(*PatternObject)) } - case 51: + case 45: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:282 +//line parser.go.y:260 { yyVAL.value = &PatternObject{Key: yyDollar[1].token, Val: yyDollar[3].value.(*Pattern)} } - case 52: + case 46: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:286 +//line parser.go.y:264 { yyVAL.value = &PatternObject{KeyString: yyDollar[1].value.(*String), Val: yyDollar[3].value.(*Pattern)} } - case 53: + case 47: yyDollar = yyS[yypt-5 : yypt+1] -//line parser.go.y:290 +//line parser.go.y:268 { yyVAL.value = &PatternObject{KeyQuery: yyDollar[2].value.(*Query), Val: yyDollar[5].value.(*Pattern)} } - case 54: + case 48: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:294 +//line parser.go.y:272 { - yyVAL.value = &PatternObject{KeyOnly: yyDollar[1].token} + yyVAL.value = &PatternObject{Key: yyDollar[1].token} } - case 55: + case 49: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:300 +//line parser.go.y:278 { yyVAL.value = &Term{Type: TermTypeIdentity} } - case 56: + case 50: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:304 +//line parser.go.y:282 { yyVAL.value = &Term{Type: TermTypeRecurse} } - case 57: + case 51: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:308 +//line parser.go.y:286 { yyVAL.value = &Term{Type: TermTypeIndex, Index: &Index{Name: yyDollar[1].token}} } - case 58: + case 52: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:312 +//line parser.go.y:290 { if yyDollar[2].value.(*Suffix).Iter { yyVAL.value = &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{yyDollar[2].value.(*Suffix)}} @@ -1131,559 +1103,601 @@ yydefault: yyVAL.value = &Term{Type: TermTypeIndex, Index: yyDollar[2].value.(*Suffix).Index} } } - case 59: + case 53: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:320 +//line parser.go.y:298 { yyVAL.value = &Term{Type: TermTypeIndex, Index: &Index{Str: yyDollar[2].value.(*String)}} } - case 60: + case 54: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:324 +//line parser.go.y:302 { yyVAL.value = &Term{Type: TermTypeNull} } - case 61: + case 55: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:328 +//line parser.go.y:306 { yyVAL.value = &Term{Type: TermTypeTrue} } - case 62: + case 56: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:332 +//line parser.go.y:310 { yyVAL.value = &Term{Type: TermTypeFalse} } - case 63: + case 57: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:336 +//line parser.go.y:314 { yyVAL.value = &Term{Type: TermTypeFunc, Func: &Func{Name: yyDollar[1].token}} } - case 64: + case 58: yyDollar = yyS[yypt-4 : yypt+1] -//line parser.go.y:340 +//line parser.go.y:318 { yyVAL.value = &Term{Type: TermTypeFunc, Func: &Func{Name: yyDollar[1].token, Args: yyDollar[3].value.([]*Query)}} } - case 65: + case 59: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:344 +//line parser.go.y:322 { yyVAL.value = &Term{Type: TermTypeFunc, Func: &Func{Name: yyDollar[1].token}} } - case 66: + case 60: + yyDollar = yyS[yypt-2 : yypt+1] +//line parser.go.y:326 + { + yyVAL.value = &Term{Type: TermTypeObject, Object: &Object{}} + } + case 61: + yyDollar = yyS[yypt-3 : yypt+1] +//line parser.go.y:330 + { + yyVAL.value = &Term{Type: TermTypeObject, Object: &Object{yyDollar[2].value.([]*ObjectKeyVal)}} + } + case 62: + yyDollar = yyS[yypt-4 : yypt+1] +//line parser.go.y:334 + { + yyVAL.value = &Term{Type: TermTypeObject, Object: &Object{yyDollar[2].value.([]*ObjectKeyVal)}} + } + case 63: + yyDollar = yyS[yypt-2 : yypt+1] +//line parser.go.y:338 + { + yyVAL.value = &Term{Type: TermTypeArray, Array: &Array{}} + } + case 64: + yyDollar = yyS[yypt-3 : yypt+1] +//line parser.go.y:342 + { + yyVAL.value = &Term{Type: TermTypeArray, Array: &Array{yyDollar[2].value.(*Query)}} + } + case 65: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:348 +//line parser.go.y:346 { yyVAL.value = &Term{Type: TermTypeNumber, Number: yyDollar[1].token} } + case 66: + yyDollar = yyS[yypt-2 : yypt+1] +//line parser.go.y:350 + { + yyVAL.value = &Term{Type: TermTypeUnary, Unary: &Unary{OpAdd, yyDollar[2].value.(*Term)}} + } case 67: + yyDollar = yyS[yypt-2 : yypt+1] +//line parser.go.y:354 + { + yyVAL.value = &Term{Type: TermTypeUnary, Unary: &Unary{OpSub, yyDollar[2].value.(*Term)}} + } + case 68: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:352 +//line parser.go.y:358 { yyVAL.value = &Term{Type: TermTypeFormat, Format: yyDollar[1].token} } - case 68: + case 69: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:356 +//line parser.go.y:362 { yyVAL.value = &Term{Type: TermTypeFormat, Format: yyDollar[1].token, Str: yyDollar[2].value.(*String)} } - case 69: + case 70: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:360 +//line parser.go.y:366 { yyVAL.value = &Term{Type: TermTypeString, Str: yyDollar[1].value.(*String)} } - case 70: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:364 - { - yyVAL.value = &Term{Type: TermTypeQuery, Query: yyDollar[2].value.(*Query)} - } case 71: - yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:368 + yyDollar = yyS[yypt-7 : yypt+1] +//line parser.go.y:370 { - yyVAL.value = &Term{Type: TermTypeUnary, Unary: &Unary{OpSub, yyDollar[2].value.(*Term)}} + yyVAL.value = &Term{Type: TermTypeIf, If: &If{yyDollar[2].value.(*Query), yyDollar[4].value.(*Query), yyDollar[5].value.([]*IfElif), yyDollar[6].value.(*Query)}} } case 72: - yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:372 + yyDollar = yyS[yypt-3 : yypt+1] +//line parser.go.y:374 { - yyVAL.value = &Term{Type: TermTypeUnary, Unary: &Unary{OpAdd, yyDollar[2].value.(*Term)}} + yyVAL.value = &Term{Type: TermTypeTry, Try: &Try{yyDollar[2].value.(*Query), yyDollar[3].value.(*Query)}} } case 73: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:376 + yyDollar = yyS[yypt-9 : yypt+1] +//line parser.go.y:378 { - yyVAL.value = &Term{Type: TermTypeObject, Object: &Object{yyDollar[2].value.([]*ObjectKeyVal)}} + yyVAL.value = &Term{Type: TermTypeReduce, Reduce: &Reduce{yyDollar[2].value.(*Term), yyDollar[4].value.(*Pattern), yyDollar[6].value.(*Query), yyDollar[8].value.(*Query)}} } case 74: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:380 + yyDollar = yyS[yypt-9 : yypt+1] +//line parser.go.y:382 { - yyVAL.value = &Term{Type: TermTypeArray, Array: &Array{yyDollar[2].value.(*Query)}} + yyVAL.value = &Term{Type: TermTypeForeach, Foreach: &Foreach{yyDollar[2].value.(*Term), yyDollar[4].value.(*Pattern), yyDollar[6].value.(*Query), yyDollar[8].value.(*Query), nil}} } case 75: - yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:384 + yyDollar = yyS[yypt-11 : yypt+1] +//line parser.go.y:386 { - yyVAL.value = &Term{Type: TermTypeArray, Array: &Array{}} + yyVAL.value = &Term{Type: TermTypeForeach, Foreach: &Foreach{yyDollar[2].value.(*Term), yyDollar[4].value.(*Pattern), yyDollar[6].value.(*Query), yyDollar[8].value.(*Query), yyDollar[10].value.(*Query)}} } case 76: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:388 +//line parser.go.y:390 { yyVAL.value = &Term{Type: TermTypeBreak, Break: yyDollar[2].token} } case 77: + yyDollar = yyS[yypt-3 : yypt+1] +//line parser.go.y:394 + { + yyVAL.value = &Term{Type: TermTypeQuery, Query: yyDollar[2].value.(*Query)} + } + case 78: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:392 +//line parser.go.y:398 { yyDollar[1].value.(*Term).SuffixList = append(yyDollar[1].value.(*Term).SuffixList, &Suffix{Index: &Index{Name: yyDollar[2].token}}) } - case 78: + case 79: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:396 +//line parser.go.y:402 { yyDollar[1].value.(*Term).SuffixList = append(yyDollar[1].value.(*Term).SuffixList, yyDollar[2].value.(*Suffix)) } - case 79: + case 80: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:400 +//line parser.go.y:406 { yyDollar[1].value.(*Term).SuffixList = append(yyDollar[1].value.(*Term).SuffixList, &Suffix{Optional: true}) } - case 80: + case 81: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:404 +//line parser.go.y:410 { yyDollar[1].value.(*Term).SuffixList = append(yyDollar[1].value.(*Term).SuffixList, yyDollar[3].value.(*Suffix)) } - case 81: + case 82: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:408 +//line parser.go.y:414 { yyDollar[1].value.(*Term).SuffixList = append(yyDollar[1].value.(*Term).SuffixList, &Suffix{Index: &Index{Str: yyDollar[3].value.(*String)}}) } - case 82: + case 83: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:414 +//line parser.go.y:420 { yyVAL.value = &String{Str: yyDollar[1].token} } - case 83: + case 84: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:418 +//line parser.go.y:424 { yyVAL.value = &String{Queries: yyDollar[2].value.([]*Query)} } - case 84: + case 85: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:424 +//line parser.go.y:430 { yyVAL.value = []*Query{} } - case 85: + case 86: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:428 +//line parser.go.y:434 { yyVAL.value = append(yyDollar[1].value.([]*Query), &Query{Term: &Term{Type: TermTypeString, Str: &String{Str: yyDollar[2].token}}}) } - case 86: + case 87: yyDollar = yyS[yypt-4 : yypt+1] -//line parser.go.y:432 +//line parser.go.y:438 { yylex.(*lexer).inString = true yyVAL.value = append(yyDollar[1].value.([]*Query), &Query{Term: &Term{Type: TermTypeQuery, Query: yyDollar[3].value.(*Query)}}) } - case 87: - yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:438 - { - } case 88: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:439 +//line parser.go.y:444 { } case 89: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:442 +//line parser.go.y:445 { } case 90: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:443 +//line parser.go.y:448 { } case 91: + yyDollar = yyS[yypt-1 : yypt+1] +//line parser.go.y:449 + { + } + case 92: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:447 +//line parser.go.y:453 { yyVAL.value = &Suffix{Iter: true} } - case 92: + case 93: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:451 +//line parser.go.y:457 { yyVAL.value = &Suffix{Index: &Index{Start: yyDollar[2].value.(*Query)}} } - case 93: + case 94: yyDollar = yyS[yypt-4 : yypt+1] -//line parser.go.y:455 +//line parser.go.y:461 { yyVAL.value = &Suffix{Index: &Index{Start: yyDollar[2].value.(*Query), IsSlice: true}} } - case 94: + case 95: yyDollar = yyS[yypt-4 : yypt+1] -//line parser.go.y:459 +//line parser.go.y:465 { - yyVAL.value = &Suffix{Index: &Index{End: yyDollar[3].value.(*Query)}} + yyVAL.value = &Suffix{Index: &Index{End: yyDollar[3].value.(*Query), IsSlice: true}} } - case 95: + case 96: yyDollar = yyS[yypt-5 : yypt+1] -//line parser.go.y:463 +//line parser.go.y:469 { - yyVAL.value = &Suffix{Index: &Index{Start: yyDollar[2].value.(*Query), IsSlice: true, End: yyDollar[4].value.(*Query)}} + yyVAL.value = &Suffix{Index: &Index{Start: yyDollar[2].value.(*Query), End: yyDollar[4].value.(*Query), IsSlice: true}} } - case 96: + case 97: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:469 +//line parser.go.y:475 { yyVAL.value = []*Query{yyDollar[1].value.(*Query)} } - case 97: + case 98: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:473 +//line parser.go.y:479 { yyVAL.value = append(yyDollar[1].value.([]*Query), yyDollar[3].value.(*Query)) } - case 98: + case 99: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:479 +//line parser.go.y:485 { yyVAL.value = []*IfElif(nil) } - case 99: + case 100: yyDollar = yyS[yypt-5 : yypt+1] -//line parser.go.y:483 +//line parser.go.y:489 { - yyVAL.value = prependIfElif(yyDollar[5].value.([]*IfElif), &IfElif{yyDollar[2].value.(*Query), yyDollar[4].value.(*Query)}) + yyVAL.value = append(yyDollar[1].value.([]*IfElif), &IfElif{yyDollar[3].value.(*Query), yyDollar[5].value.(*Query)}) } - case 100: + case 101: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:489 +//line parser.go.y:495 { yyVAL.value = (*Query)(nil) } - case 101: + case 102: yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:493 +//line parser.go.y:499 { yyVAL.value = yyDollar[2].value } - case 102: + case 103: yyDollar = yyS[yypt-0 : yypt+1] -//line parser.go.y:499 +//line parser.go.y:505 { yyVAL.value = (*Query)(nil) } - case 103: - yyDollar = yyS[yypt-2 : yypt+1] -//line parser.go.y:503 - { - yyVAL.value = yyDollar[2].value - } case 104: - yyDollar = yyS[yypt-0 : yypt+1] + yyDollar = yyS[yypt-2 : yypt+1] //line parser.go.y:509 { - yyVAL.value = []*ObjectKeyVal(nil) + yyVAL.value = yyDollar[2].value } case 105: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:513 +//line parser.go.y:515 { yyVAL.value = []*ObjectKeyVal{yyDollar[1].value.(*ObjectKeyVal)} } case 106: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:517 +//line parser.go.y:519 { - yyVAL.value = prependObjectKeyVal(yyDollar[3].value.([]*ObjectKeyVal), yyDollar[1].value.(*ObjectKeyVal)) + yyVAL.value = append(yyDollar[1].value.([]*ObjectKeyVal), yyDollar[3].value.(*ObjectKeyVal)) } case 107: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:523 +//line parser.go.y:525 { yyVAL.value = &ObjectKeyVal{Key: yyDollar[1].token, Val: yyDollar[3].value.(*ObjectVal)} } case 108: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:527 +//line parser.go.y:529 { yyVAL.value = &ObjectKeyVal{KeyString: yyDollar[1].value.(*String), Val: yyDollar[3].value.(*ObjectVal)} } case 109: yyDollar = yyS[yypt-5 : yypt+1] -//line parser.go.y:531 +//line parser.go.y:533 { yyVAL.value = &ObjectKeyVal{KeyQuery: yyDollar[2].value.(*Query), Val: yyDollar[5].value.(*ObjectVal)} } case 110: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:535 +//line parser.go.y:537 { - yyVAL.value = &ObjectKeyVal{KeyOnly: yyDollar[1].token} + yyVAL.value = &ObjectKeyVal{Key: yyDollar[1].token} } case 111: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:539 +//line parser.go.y:541 { - yyVAL.value = &ObjectKeyVal{KeyOnlyString: yyDollar[1].value.(*String)} + yyVAL.value = &ObjectKeyVal{KeyString: yyDollar[1].value.(*String)} } case 112: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:544 +//line parser.go.y:546 { } case 113: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:545 +//line parser.go.y:547 { } case 114: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:546 +//line parser.go.y:548 { } case 115: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:550 +//line parser.go.y:552 { - yyVAL.value = &ObjectVal{[]*Query{&Query{Term: yyDollar[1].value.(*Term)}}} + yyVAL.value = &ObjectVal{[]*Query{{Term: yyDollar[1].value.(*Term)}}} } case 116: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:554 +//line parser.go.y:556 { - yyVAL.value = &ObjectVal{prependQuery(yyDollar[3].value.(*ObjectVal).Queries, &Query{Term: yyDollar[1].value.(*Term)})} + yyVAL.value = &ObjectVal{append(yyDollar[1].value.(*ObjectVal).Queries, &Query{Term: yyDollar[3].value.(*Term)})} } case 117: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:560 +//line parser.go.y:562 { yyVAL.value = &ConstTerm{Object: yyDollar[1].value.(*ConstObject)} } case 118: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:564 +//line parser.go.y:566 { yyVAL.value = &ConstTerm{Array: yyDollar[1].value.(*ConstArray)} } case 119: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:568 +//line parser.go.y:570 { yyVAL.value = &ConstTerm{Number: yyDollar[1].token} } case 120: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:572 +//line parser.go.y:574 { yyVAL.value = &ConstTerm{Str: yyDollar[1].token} } case 121: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:576 +//line parser.go.y:578 { yyVAL.value = &ConstTerm{Null: true} } case 122: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:580 +//line parser.go.y:582 { yyVAL.value = &ConstTerm{True: true} } case 123: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:584 +//line parser.go.y:586 { yyVAL.value = &ConstTerm{False: true} } case 124: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:590 + yyDollar = yyS[yypt-2 : yypt+1] +//line parser.go.y:592 { - yyVAL.value = &ConstObject{yyDollar[2].value.([]*ConstObjectKeyVal)} + yyVAL.value = &ConstObject{} } case 125: - yyDollar = yyS[yypt-0 : yypt+1] + yyDollar = yyS[yypt-3 : yypt+1] //line parser.go.y:596 { - yyVAL.value = []*ConstObjectKeyVal(nil) + yyVAL.value = &ConstObject{yyDollar[2].value.([]*ConstObjectKeyVal)} } case 126: - yyDollar = yyS[yypt-1 : yypt+1] + yyDollar = yyS[yypt-4 : yypt+1] //line parser.go.y:600 { - yyVAL.value = []*ConstObjectKeyVal{yyDollar[1].value.(*ConstObjectKeyVal)} + yyVAL.value = &ConstObject{yyDollar[2].value.([]*ConstObjectKeyVal)} } case 127: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:604 + yyDollar = yyS[yypt-1 : yypt+1] +//line parser.go.y:606 { - yyVAL.value = prependConstObjectKeyVal(yyDollar[3].value.([]*ConstObjectKeyVal), yyDollar[1].value.(*ConstObjectKeyVal)) + yyVAL.value = []*ConstObjectKeyVal{yyDollar[1].value.(*ConstObjectKeyVal)} } case 128: yyDollar = yyS[yypt-3 : yypt+1] //line parser.go.y:610 { - yyVAL.value = &ConstObjectKeyVal{Key: yyDollar[1].token, Val: yyDollar[3].value.(*ConstTerm)} + yyVAL.value = append(yyDollar[1].value.([]*ConstObjectKeyVal), yyDollar[3].value.(*ConstObjectKeyVal)) } case 129: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:614 +//line parser.go.y:616 { yyVAL.value = &ConstObjectKeyVal{Key: yyDollar[1].token, Val: yyDollar[3].value.(*ConstTerm)} } case 130: yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:618 +//line parser.go.y:620 { - yyVAL.value = &ConstObjectKeyVal{KeyString: yyDollar[1].token, Val: yyDollar[3].value.(*ConstTerm)} + yyVAL.value = &ConstObjectKeyVal{Key: yyDollar[1].token, Val: yyDollar[3].value.(*ConstTerm)} } case 131: - yyDollar = yyS[yypt-2 : yypt+1] + yyDollar = yyS[yypt-3 : yypt+1] //line parser.go.y:624 { - yyVAL.value = &ConstArray{} + yyVAL.value = &ConstObjectKeyVal{KeyString: yyDollar[1].token, Val: yyDollar[3].value.(*ConstTerm)} } case 132: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:628 + yyDollar = yyS[yypt-2 : yypt+1] +//line parser.go.y:630 { - yyVAL.value = &ConstArray{yyDollar[2].value.([]*ConstTerm)} + yyVAL.value = &ConstArray{} } case 133: - yyDollar = yyS[yypt-1 : yypt+1] + yyDollar = yyS[yypt-3 : yypt+1] //line parser.go.y:634 { - yyVAL.value = []*ConstTerm{yyDollar[1].value.(*ConstTerm)} + yyVAL.value = &ConstArray{yyDollar[2].value.([]*ConstTerm)} } case 134: - yyDollar = yyS[yypt-3 : yypt+1] -//line parser.go.y:638 + yyDollar = yyS[yypt-1 : yypt+1] +//line parser.go.y:640 { - yyVAL.value = append(yyDollar[1].value.([]*ConstTerm), yyDollar[3].value.(*ConstTerm)) + yyVAL.value = []*ConstTerm{yyDollar[1].value.(*ConstTerm)} } case 135: - yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:643 + yyDollar = yyS[yypt-3 : yypt+1] +//line parser.go.y:644 { + yyVAL.value = append(yyDollar[1].value.([]*ConstTerm), yyDollar[3].value.(*ConstTerm)) } case 136: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:644 +//line parser.go.y:649 { } case 137: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:645 +//line parser.go.y:650 { } case 138: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:646 +//line parser.go.y:651 { } case 139: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:647 +//line parser.go.y:652 { } case 140: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:648 +//line parser.go.y:653 { } case 141: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:649 +//line parser.go.y:654 { } case 142: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:650 +//line parser.go.y:655 { } case 143: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:651 +//line parser.go.y:656 { } case 144: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:652 +//line parser.go.y:657 { } case 145: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:653 +//line parser.go.y:658 { } case 146: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:654 +//line parser.go.y:659 { } case 147: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:655 +//line parser.go.y:660 { } case 148: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:656 +//line parser.go.y:661 { } case 149: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:657 +//line parser.go.y:662 { } case 150: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:658 +//line parser.go.y:663 { } case 151: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:659 +//line parser.go.y:664 { } case 152: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:660 +//line parser.go.y:665 { } case 153: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:661 +//line parser.go.y:666 { } case 154: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:662 +//line parser.go.y:667 { } case 155: yyDollar = yyS[yypt-1 : yypt+1] -//line parser.go.y:663 +//line parser.go.y:668 + { + } + case 156: + yyDollar = yyS[yypt-1 : yypt+1] +//line parser.go.y:669 { } } diff --git a/vendor/github.com/itchyny/gojq/parser.go.y b/vendor/github.com/itchyny/gojq/parser.go.y index 3cfacef690..e100a842e4 100644 --- a/vendor/github.com/itchyny/gojq/parser.go.y +++ b/vendor/github.com/itchyny/gojq/parser.go.y @@ -1,18 +1,23 @@ %{ package gojq -// Parse parses a query. -func Parse(src string) (*Query, error) { - l := newLexer(src) - if yyParse(l) > 0 { - return nil, l.err +func reverseFuncDef(xs []*FuncDef) []*FuncDef { + for i, j := 0, len(xs)-1; i < j; i, j = i+1, j-1 { + xs[i], xs[j] = xs[j], xs[i] } - return l.result, nil + return xs +} + +func prependFuncDef(xs []*FuncDef, x *FuncDef) []*FuncDef { + xs = append(xs, nil) + copy(xs[1:], xs) + xs[0] = x + return xs } %} %union { - value interface{} + value any token string operator Operator } @@ -20,20 +25,21 @@ func Parse(src string) (*Query, error) { %type program moduleheader programbody imports import metaopt funcdefs funcdef funcdefargs query %type bindpatterns pattern arraypatterns objectpatterns objectpattern %type term string stringparts suffix args ifelifs ifelse trycatch -%type object objectkeyval objectval +%type objectkeyvals objectkeyval objectval %type constterm constobject constobjectkeyvals constobjectkeyval constarray constarrayelems %type tokIdentVariable tokIdentModuleIdent tokVariableModuleVariable tokKeyword objectkey %token tokAltOp tokUpdateOp tokDestAltOp tokOrOp tokAndOp tokCompareOp %token tokModule tokImport tokInclude tokDef tokAs tokLabel tokBreak %token tokNull tokTrue tokFalse %token tokIdent tokVariable tokModuleIdent tokModuleVariable -%token tokIndex tokNumber tokFormat tokInvalid +%token tokIndex tokNumber tokFormat %token tokString tokStringStart tokStringQuery tokStringEnd %token tokIf tokThen tokElif tokElse tokEnd %token tokTry tokCatch tokReduce tokForeach %token tokRecurse tokFuncDefPost tokTermPost tokEmptyCatch +%token tokInvalid tokInvalidEscapeSequence tokUnterminatedString -%nonassoc tokFuncDefPost tokTermPost tokEmptyCatch +%nonassoc tokFuncDefPost tokTermPost %right '|' %left ',' %right tokAltOp @@ -43,7 +49,7 @@ func Parse(src string) (*Query, error) { %nonassoc tokCompareOp %left '+' '-' %left '*' '/' '%' -%nonassoc tokAs tokIndex '.' '?' +%nonassoc tokAs tokIndex '.' '?' tokEmptyCatch %nonassoc '[' tokTry tokCatch %% @@ -68,7 +74,7 @@ moduleheader programbody : imports funcdefs { - $$ = &Query{Imports: $1.([]*Import), FuncDefs: $2.([]*FuncDef), Term: &Term{Type: TermTypeIdentity}} + $$ = &Query{Imports: $1.([]*Import), FuncDefs: reverseFuncDef($2.([]*FuncDef)), Term: &Term{Type: TermTypeIdentity}} } | imports query { @@ -81,9 +87,9 @@ imports { $$ = []*Import(nil) } - | import imports + | imports import { - $$ = prependImport($2.([]*Import), $1.(*Import)) + $$ = append($1.([]*Import), $2.(*Import)) } import @@ -110,7 +116,7 @@ funcdefs } | funcdef funcdefs { - $$ = prependFuncDef($2.([]*FuncDef), $1.(*FuncDef)) + $$ = append($2.([]*FuncDef), $1.(*FuncDef)) } funcdef @@ -152,38 +158,10 @@ query $1.(*Term).SuffixList = append($1.(*Term).SuffixList, &Suffix{Bind: &Bind{$3.([]*Pattern), $5.(*Query)}}) $$ = &Query{Term: $1.(*Term)} } - | tokReduce term tokAs pattern '(' query ';' query ')' - { - $$ = &Query{Term: &Term{Type: TermTypeReduce, Reduce: &Reduce{$2.(*Term), $4.(*Pattern), $6.(*Query), $8.(*Query)}}} - } - | tokForeach term tokAs pattern '(' query ';' query ')' - { - $$ = &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{$2.(*Term), $4.(*Pattern), $6.(*Query), $8.(*Query), nil}}} - } - | tokForeach term tokAs pattern '(' query ';' query ';' query ')' - { - $$ = &Query{Term: &Term{Type: TermTypeForeach, Foreach: &Foreach{$2.(*Term), $4.(*Pattern), $6.(*Query), $8.(*Query), $10.(*Query)}}} - } - | tokIf query tokThen query ifelifs ifelse tokEnd - { - $$ = &Query{Term: &Term{Type: TermTypeIf, If: &If{$2.(*Query), $4.(*Query), $5.([]*IfElif), $6.(*Query)}}} - } - | tokTry query trycatch - { - $$ = &Query{Term: &Term{Type: TermTypeTry, Try: &Try{$2.(*Query), $3.(*Query)}}} - } | tokLabel tokVariable '|' query { $$ = &Query{Term: &Term{Type: TermTypeLabel, Label: &Label{$2, $4.(*Query)}}} } - | query '?' - { - if t := $1.(*Query).Term; t != nil { - t.SuffixList = append(t.SuffixList, &Suffix{Optional: true}) - } else { - $$ = &Query{Term: &Term{Type: TermTypeQuery, Query: $1.(*Query), SuffixList: []*Suffix{&Suffix{Optional: true}}}} - } - } | query ',' query { $$ = &Query{Left: $1.(*Query), Op: OpComma, Right: $3.(*Query)} @@ -292,7 +270,7 @@ objectpattern } | tokVariable { - $$ = &PatternObject{KeyOnly: $1} + $$ = &PatternObject{Key: $1} } term @@ -344,10 +322,38 @@ term { $$ = &Term{Type: TermTypeFunc, Func: &Func{Name: $1}} } + | '{' '}' + { + $$ = &Term{Type: TermTypeObject, Object: &Object{}} + } + | '{' objectkeyvals '}' + { + $$ = &Term{Type: TermTypeObject, Object: &Object{$2.([]*ObjectKeyVal)}} + } + | '{' objectkeyvals ',' '}' + { + $$ = &Term{Type: TermTypeObject, Object: &Object{$2.([]*ObjectKeyVal)}} + } + | '[' ']' + { + $$ = &Term{Type: TermTypeArray, Array: &Array{}} + } + | '[' query ']' + { + $$ = &Term{Type: TermTypeArray, Array: &Array{$2.(*Query)}} + } | tokNumber { $$ = &Term{Type: TermTypeNumber, Number: $1} } + | '+' term + { + $$ = &Term{Type: TermTypeUnary, Unary: &Unary{OpAdd, $2.(*Term)}} + } + | '-' term + { + $$ = &Term{Type: TermTypeUnary, Unary: &Unary{OpSub, $2.(*Term)}} + } | tokFormat { $$ = &Term{Type: TermTypeFormat, Format: $1} @@ -360,34 +366,34 @@ term { $$ = &Term{Type: TermTypeString, Str: $1.(*String)} } - | '(' query ')' + | tokIf query tokThen query ifelifs ifelse tokEnd { - $$ = &Term{Type: TermTypeQuery, Query: $2.(*Query)} + $$ = &Term{Type: TermTypeIf, If: &If{$2.(*Query), $4.(*Query), $5.([]*IfElif), $6.(*Query)}} } - | '-' term + | tokTry query trycatch { - $$ = &Term{Type: TermTypeUnary, Unary: &Unary{OpSub, $2.(*Term)}} + $$ = &Term{Type: TermTypeTry, Try: &Try{$2.(*Query), $3.(*Query)}} } - | '+' term + | tokReduce term tokAs pattern '(' query ';' query ')' { - $$ = &Term{Type: TermTypeUnary, Unary: &Unary{OpAdd, $2.(*Term)}} + $$ = &Term{Type: TermTypeReduce, Reduce: &Reduce{$2.(*Term), $4.(*Pattern), $6.(*Query), $8.(*Query)}} } - | '{' object '}' + | tokForeach term tokAs pattern '(' query ';' query ')' { - $$ = &Term{Type: TermTypeObject, Object: &Object{$2.([]*ObjectKeyVal)}} + $$ = &Term{Type: TermTypeForeach, Foreach: &Foreach{$2.(*Term), $4.(*Pattern), $6.(*Query), $8.(*Query), nil}} } - | '[' query ']' - { - $$ = &Term{Type: TermTypeArray, Array: &Array{$2.(*Query)}} - } - | '[' ']' + | tokForeach term tokAs pattern '(' query ';' query ';' query ')' { - $$ = &Term{Type: TermTypeArray, Array: &Array{}} + $$ = &Term{Type: TermTypeForeach, Foreach: &Foreach{$2.(*Term), $4.(*Pattern), $6.(*Query), $8.(*Query), $10.(*Query)}} } | tokBreak tokVariable { $$ = &Term{Type: TermTypeBreak, Break: $2} } + | '(' query ')' + { + $$ = &Term{Type: TermTypeQuery, Query: $2.(*Query)} + } | term tokIndex { $1.(*Term).SuffixList = append($1.(*Term).SuffixList, &Suffix{Index: &Index{Name: $2}}) @@ -457,11 +463,11 @@ suffix } | '[' ':' query ']' { - $$ = &Suffix{Index: &Index{End: $3.(*Query)}} + $$ = &Suffix{Index: &Index{End: $3.(*Query), IsSlice: true}} } | '[' query ':' query ']' { - $$ = &Suffix{Index: &Index{Start: $2.(*Query), IsSlice: true, End: $4.(*Query)}} + $$ = &Suffix{Index: &Index{Start: $2.(*Query), End: $4.(*Query), IsSlice: true}} } args @@ -479,9 +485,9 @@ ifelifs { $$ = []*IfElif(nil) } - | tokElif query tokThen query ifelifs + | ifelifs tokElif query tokThen query { - $$ = prependIfElif($5.([]*IfElif), &IfElif{$2.(*Query), $4.(*Query)}) + $$ = append($1.([]*IfElif), &IfElif{$3.(*Query), $5.(*Query)}) } ifelse @@ -504,18 +510,14 @@ trycatch $$ = $2 } -object - : - { - $$ = []*ObjectKeyVal(nil) - } - | objectkeyval +objectkeyvals + : objectkeyval { $$ = []*ObjectKeyVal{$1.(*ObjectKeyVal)} } - | objectkeyval ',' object + | objectkeyvals ',' objectkeyval { - $$ = prependObjectKeyVal($3.([]*ObjectKeyVal), $1.(*ObjectKeyVal)) + $$ = append($1.([]*ObjectKeyVal), $3.(*ObjectKeyVal)) } objectkeyval @@ -533,11 +535,11 @@ objectkeyval } | objectkey { - $$ = &ObjectKeyVal{KeyOnly: $1} + $$ = &ObjectKeyVal{Key: $1} } | string { - $$ = &ObjectKeyVal{KeyOnlyString: $1.(*String)} + $$ = &ObjectKeyVal{KeyString: $1.(*String)} } objectkey @@ -548,11 +550,11 @@ objectkey objectval : term { - $$ = &ObjectVal{[]*Query{&Query{Term: $1.(*Term)}}} + $$ = &ObjectVal{[]*Query{{Term: $1.(*Term)}}} } - | term '|' objectval + | objectval '|' term { - $$ = &ObjectVal{prependQuery($3.(*ObjectVal).Queries, &Query{Term: $1.(*Term)})} + $$ = &ObjectVal{append($1.(*ObjectVal).Queries, &Query{Term: $3.(*Term)})} } constterm @@ -586,23 +588,27 @@ constterm } constobject - : '{' constobjectkeyvals '}' + : '{' '}' + { + $$ = &ConstObject{} + } + | '{' constobjectkeyvals '}' { $$ = &ConstObject{$2.([]*ConstObjectKeyVal)} } - -constobjectkeyvals - : + | '{' constobjectkeyvals ',' '}' { - $$ = []*ConstObjectKeyVal(nil) + $$ = &ConstObject{$2.([]*ConstObjectKeyVal)} } - | constobjectkeyval + +constobjectkeyvals + : constobjectkeyval { $$ = []*ConstObjectKeyVal{$1.(*ConstObjectKeyVal)} } - | constobjectkeyval ',' constobjectkeyvals + | constobjectkeyvals ',' constobjectkeyval { - $$ = prependConstObjectKeyVal($3.([]*ConstObjectKeyVal), $1.(*ConstObjectKeyVal)) + $$ = append($1.([]*ConstObjectKeyVal), $3.(*ConstObjectKeyVal)) } constobjectkeyval diff --git a/vendor/github.com/itchyny/gojq/prepend.go b/vendor/github.com/itchyny/gojq/prepend.go deleted file mode 100644 index 6b57bbf846..0000000000 --- a/vendor/github.com/itchyny/gojq/prepend.go +++ /dev/null @@ -1,43 +0,0 @@ -package gojq - -func prependQuery(xs []*Query, x *Query) []*Query { - xs = append(xs, nil) - copy(xs[1:], xs) - xs[0] = x - return xs -} - -func prependImport(xs []*Import, x *Import) []*Import { - xs = append(xs, nil) - copy(xs[1:], xs) - xs[0] = x - return xs -} - -func prependFuncDef(xs []*FuncDef, x *FuncDef) []*FuncDef { - xs = append(xs, nil) - copy(xs[1:], xs) - xs[0] = x - return xs -} - -func prependIfElif(xs []*IfElif, x *IfElif) []*IfElif { - xs = append(xs, nil) - copy(xs[1:], xs) - xs[0] = x - return xs -} - -func prependObjectKeyVal(xs []*ObjectKeyVal, x *ObjectKeyVal) []*ObjectKeyVal { - xs = append(xs, nil) - copy(xs[1:], xs) - xs[0] = x - return xs -} - -func prependConstObjectKeyVal(xs []*ConstObjectKeyVal, x *ConstObjectKeyVal) []*ConstObjectKeyVal { - xs = append(xs, nil) - copy(xs[1:], xs) - xs[0] = x - return xs -} diff --git a/vendor/github.com/itchyny/gojq/preview.go b/vendor/github.com/itchyny/gojq/preview.go new file mode 100644 index 0000000000..e082eb5619 --- /dev/null +++ b/vendor/github.com/itchyny/gojq/preview.go @@ -0,0 +1,77 @@ +package gojq + +import "unicode/utf8" + +// Preview returns the preview string of v. The preview string is basically the +// same as the jq-flavored JSON encoding returned by [Marshal], but is truncated +// by 30 bytes, and more efficient than truncating the result of [Marshal]. +// +// This method is used by error messages of built-in operators and functions, +// and accepts only limited types (nil, bool, int, float64, *big.Int, string, +// []any, and map[string]any). Note that the maximum width and trailing strings +// on truncation may be changed in the future. +func Preview(v any) string { + bs := jsonLimitedMarshal(v, 32) + if l := 30; len(bs) > l { + var trailing string + switch v.(type) { + case string: + trailing = ` ..."` + case []any: + trailing = " ...]" + case map[string]any: + trailing = " ...}" + default: + trailing = " ..." + } + for len(bs) > l-len(trailing) { + _, size := utf8.DecodeLastRune(bs) + bs = bs[:len(bs)-size] + } + bs = append(bs, trailing...) + } + return string(bs) +} + +func jsonLimitedMarshal(v any, n int) (bs []byte) { + w := &limitedWriter{buf: make([]byte, n)} + defer func() { + _ = recover() + bs = w.Bytes() + }() + (&encoder{w: w}).encode(v) + return +} + +type limitedWriter struct { + buf []byte + off int +} + +func (w *limitedWriter) Write(bs []byte) (int, error) { + n := copy(w.buf[w.off:], bs) + if w.off += n; w.off == len(w.buf) { + panic(struct{}{}) + } + return n, nil +} + +func (w *limitedWriter) WriteByte(b byte) error { + w.buf[w.off] = b + if w.off++; w.off == len(w.buf) { + panic(struct{}{}) + } + return nil +} + +func (w *limitedWriter) WriteString(s string) (int, error) { + n := copy(w.buf[w.off:], s) + if w.off += n; w.off == len(w.buf) { + panic(struct{}{}) + } + return n, nil +} + +func (w *limitedWriter) Bytes() []byte { + return w.buf[:w.off] +} diff --git a/vendor/github.com/itchyny/gojq/query.go b/vendor/github.com/itchyny/gojq/query.go index 22f16a1036..7038b9dd57 100644 --- a/vendor/github.com/itchyny/gojq/query.go +++ b/vendor/github.com/itchyny/gojq/query.go @@ -2,13 +2,24 @@ package gojq import ( "context" - "encoding/json" - "fmt" - "strconv" "strings" ) -// Query ... +// Parse a query string, and returns the query struct. +// +// If parsing failed, it returns an error of type [*ParseError], which has +// the byte offset and the invalid token. The byte offset is the scanned bytes +// when the error occurred. The token is empty if the error occurred after +// scanning the entire query string. +func Parse(src string) (*Query, error) { + l := newLexer(src) + if yyParse(l) > 0 { + return nil, l.err + } + return l.result, nil +} + +// Query represents the abstract syntax tree of a jq query. type Query struct { Meta *ConstObject Imports []*Import @@ -20,33 +31,43 @@ type Query struct { Func string } -// Run query. -func (e *Query) Run(v interface{}) Iter { - return e.RunWithContext(nil, v) +// Run the query. +// +// It is safe to call this method in goroutines, to reuse a parsed [*Query]. +// But for arguments, do not give values sharing same data between goroutines. +func (e *Query) Run(v any) Iter { + return e.RunWithContext(context.Background(), v) } -// RunWithContext query. -func (e *Query) RunWithContext(ctx context.Context, v interface{}) Iter { +// RunWithContext runs the query with context. +func (e *Query) RunWithContext(ctx context.Context, v any) Iter { code, err := Compile(e) if err != nil { - return unitIterator(err) + return NewIter(err) } return code.RunWithContext(ctx, v) } func (e *Query) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Query) writeTo(s *strings.Builder) { if e.Meta != nil { - fmt.Fprintf(&s, "module %s;\n", e.Meta) + s.WriteString("module ") + e.Meta.writeTo(s) + s.WriteString(";\n") } for _, im := range e.Imports { - fmt.Fprint(&s, im) + im.writeTo(s) } for i, fd := range e.FuncDefs { if i > 0 { s.WriteByte(' ') } - fmt.Fprint(&s, fd) + fd.writeTo(s) } if len(e.FuncDefs) > 0 { s.WriteByte(' ') @@ -54,15 +75,18 @@ func (e *Query) String() string { if e.Func != "" { s.WriteString(e.Func) } else if e.Term != nil { - fmt.Fprint(&s, e.Term) + e.Term.writeTo(s) } else if e.Right != nil { + e.Left.writeTo(s) if e.Op == OpComma { - fmt.Fprintf(&s, "%s, %s", e.Left, e.Right) + s.WriteString(", ") } else { - fmt.Fprintf(&s, "%s %s %s", e.Left, e.Op, e.Right) + s.WriteByte(' ') + s.WriteString(e.Op.String()) + s.WriteByte(' ') } + e.Right.writeTo(s) } - return s.String() } func (e *Query) minify() { @@ -82,18 +106,18 @@ func (e *Query) minify() { } } -func (e *Query) toIndices() []interface{} { - if e.FuncDefs != nil || e.Right != nil || e.Term == nil { +func (e *Query) toIndexKey() any { + if e.Term == nil { return nil } - return e.Term.toIndices() + return e.Term.toIndexKey() } -func (e *Query) countCommaQueries() int { - if e.Op == OpComma { - return e.Left.countCommaQueries() + e.Right.countCommaQueries() +func (e *Query) toIndices(xs []any) []any { + if e.Term == nil { + return nil } - return 1 + return e.Term.toIndices(xs) } // Import ... @@ -106,16 +130,25 @@ type Import struct { func (e *Import) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Import) writeTo(s *strings.Builder) { if e.ImportPath != "" { - fmt.Fprintf(&s, "import %q as %s", e.ImportPath, e.ImportAlias) + s.WriteString("import ") + jsonEncodeString(s, e.ImportPath) + s.WriteString(" as ") + s.WriteString(e.ImportAlias) } else { - fmt.Fprintf(&s, "include %q", e.IncludePath) + s.WriteString("include ") + jsonEncodeString(s, e.IncludePath) } if e.Meta != nil { - fmt.Fprintf(&s, " %s", e.Meta) + s.WriteByte(' ') + e.Meta.writeTo(s) } s.WriteString(";\n") - return s.String() } // FuncDef ... @@ -127,19 +160,26 @@ type FuncDef struct { func (e *FuncDef) String() string { var s strings.Builder - fmt.Fprintf(&s, "def %s", e.Name) + e.writeTo(&s) + return s.String() +} + +func (e *FuncDef) writeTo(s *strings.Builder) { + s.WriteString("def ") + s.WriteString(e.Name) if len(e.Args) > 0 { s.WriteByte('(') for i, e := range e.Args { if i > 0 { s.WriteString("; ") } - fmt.Fprint(&s, e) + s.WriteString(e) } s.WriteByte(')') } - fmt.Fprintf(&s, ": %s;", e.Body) - return s.String() + s.WriteString(": ") + e.Body.writeTo(s) + s.WriteByte(';') } // Minify ... @@ -170,9 +210,14 @@ type Term struct { func (e *Term) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Term) writeTo(s *strings.Builder) { switch e.Type { case TermTypeIdentity: - s.WriteString(".") + s.WriteByte('.') case TermTypeRecurse: s.WriteString("..") case TermTypeNull: @@ -182,44 +227,46 @@ func (e *Term) String() string { case TermTypeFalse: s.WriteString("false") case TermTypeIndex: - fmt.Fprint(&s, e.Index) + e.Index.writeTo(s) case TermTypeFunc: - fmt.Fprint(&s, e.Func) + e.Func.writeTo(s) case TermTypeObject: - fmt.Fprint(&s, e.Object) + e.Object.writeTo(s) case TermTypeArray: - fmt.Fprint(&s, e.Array) + e.Array.writeTo(s) case TermTypeNumber: - fmt.Fprint(&s, e.Number) + s.WriteString(e.Number) case TermTypeUnary: - fmt.Fprint(&s, e.Unary) + e.Unary.writeTo(s) case TermTypeFormat: - if e.Str == nil { - s.WriteString(e.Format) - } else { - fmt.Fprintf(&s, "%s %s", e.Format, e.Str) + s.WriteString(e.Format) + if e.Str != nil { + s.WriteByte(' ') + e.Str.writeTo(s) } case TermTypeString: - fmt.Fprint(&s, e.Str) + e.Str.writeTo(s) case TermTypeIf: - fmt.Fprint(&s, e.If) + e.If.writeTo(s) case TermTypeTry: - fmt.Fprint(&s, e.Try) + e.Try.writeTo(s) case TermTypeReduce: - fmt.Fprint(&s, e.Reduce) + e.Reduce.writeTo(s) case TermTypeForeach: - fmt.Fprint(&s, e.Foreach) + e.Foreach.writeTo(s) case TermTypeLabel: - fmt.Fprint(&s, e.Label) + e.Label.writeTo(s) case TermTypeBreak: - fmt.Fprintf(&s, "break %s", e.Break) + s.WriteString("break ") + s.WriteString(e.Break) case TermTypeQuery: - fmt.Fprintf(&s, "(%s)", e.Query) + s.WriteByte('(') + e.Query.writeTo(s) + s.WriteByte(')') } for _, e := range e.SuffixList { - fmt.Fprint(&s, e) + e.writeTo(s) } - return s.String() } func (e *Term) minify() { @@ -281,25 +328,48 @@ func (e *Term) toFunc() string { } } -func (e *Term) toIndices() []interface{} { - if e.Index != nil { - xs := e.Index.toIndices() - if xs == nil { +func (e *Term) toIndexKey() any { + switch e.Type { + case TermTypeNumber: + return toNumber(e.Number) + case TermTypeUnary: + return e.Unary.toNumber() + case TermTypeString: + if e.Str.Queries == nil { + return e.Str.Str + } + return nil + default: + return nil + } +} + +func (e *Term) toIndices(xs []any) []any { + switch e.Type { + case TermTypeIndex: + if xs = e.Index.toIndices(xs); xs == nil { return nil } - for _, s := range e.SuffixList { - x := s.toIndices() - if x == nil { - return nil - } - xs = append(xs, x...) + case TermTypeQuery: + if xs = e.Query.toIndices(xs); xs == nil { + return nil } - return xs - } else if e.Query != nil && len(e.SuffixList) == 0 { - return e.Query.toIndices() - } else { + default: return nil } + for _, s := range e.SuffixList { + if xs = s.toIndices(xs); xs == nil { + return nil + } + } + return xs +} + +func (e *Term) toNumber() any { + if e.Type == TermTypeNumber { + return toNumber(e.Number) + } + return nil } // Unary ... @@ -309,13 +379,28 @@ type Unary struct { } func (e *Unary) String() string { - return fmt.Sprintf("%s%s", e.Op, e.Term) + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Unary) writeTo(s *strings.Builder) { + s.WriteString(e.Op.String()) + e.Term.writeTo(s) } func (e *Unary) minify() { e.Term.minify() } +func (e *Unary) toNumber() any { + v := e.Term.toNumber() + if v != nil && e.Op == OpSub { + v = funcOpNegate(v) + } + return v +} + // Pattern ... type Pattern struct { Name string @@ -325,28 +410,32 @@ type Pattern struct { func (e *Pattern) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Pattern) writeTo(s *strings.Builder) { if e.Name != "" { s.WriteString(e.Name) } else if len(e.Array) > 0 { - s.WriteRune('[') + s.WriteByte('[') for i, e := range e.Array { if i > 0 { s.WriteString(", ") } - fmt.Fprint(&s, e) + e.writeTo(s) } - s.WriteRune(']') + s.WriteByte(']') } else if len(e.Object) > 0 { - s.WriteRune('{') + s.WriteByte('{') for i, e := range e.Object { if i > 0 { s.WriteString(", ") } - fmt.Fprint(&s, e) + e.writeTo(s) } - s.WriteRune('}') + s.WriteByte('}') } - return s.String() } // PatternObject ... @@ -355,26 +444,28 @@ type PatternObject struct { KeyString *String KeyQuery *Query Val *Pattern - KeyOnly string } func (e *PatternObject) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *PatternObject) writeTo(s *strings.Builder) { if e.Key != "" { s.WriteString(e.Key) } else if e.KeyString != nil { - fmt.Fprint(&s, e.KeyString) + e.KeyString.writeTo(s) } else if e.KeyQuery != nil { - fmt.Fprintf(&s, "(%s)", e.KeyQuery) + s.WriteByte('(') + e.KeyQuery.writeTo(s) + s.WriteByte(')') } if e.Val != nil { s.WriteString(": ") - fmt.Fprint(&s, e.Val) - } - if e.KeyOnly != "" { - s.WriteString(e.KeyOnly) + e.Val.writeTo(s) } - return s.String() } // Index ... @@ -382,39 +473,53 @@ type Index struct { Name string Str *String Start *Query - IsSlice bool End *Query + IsSlice bool } func (e *Index) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Index) writeTo(s *strings.Builder) { + if l := s.Len(); l > 0 { + // ". .x" != "..x" and "0 .x" != "0.x" + if c := s.String()[l-1]; c == '.' || '0' <= c && c <= '9' { + s.WriteByte(' ') + } + } s.WriteByte('.') + e.writeSuffixTo(s) +} + +func (e *Index) writeSuffixTo(s *strings.Builder) { if e.Name != "" { s.WriteString(e.Name) + } else if e.Str != nil { + e.Str.writeTo(s) } else { - if e.Str != nil { - fmt.Fprint(&s, e.Str) - } else { - s.WriteByte('[') + s.WriteByte('[') + if e.IsSlice { if e.Start != nil { - fmt.Fprint(&s, e.Start) - if e.IsSlice { - s.WriteByte(':') - if e.End != nil { - fmt.Fprint(&s, e.End) - } - } - } else if e.End != nil { - s.WriteByte(':') - fmt.Fprint(&s, e.End) + e.Start.writeTo(s) } - s.WriteByte(']') + s.WriteByte(':') + if e.End != nil { + e.End.writeTo(s) + } + } else { + e.Start.writeTo(s) } + s.WriteByte(']') } - return s.String() } func (e *Index) minify() { + if e.Str != nil { + e.Str.minify() + } if e.Start != nil { e.Start.minify() } @@ -423,11 +528,38 @@ func (e *Index) minify() { } } -func (e *Index) toIndices() []interface{} { - if e.Name == "" { - return nil +func (e *Index) toIndexKey() any { + if e.Name != "" { + return e.Name + } else if e.Str != nil { + if e.Str.Queries == nil { + return e.Str.Str + } + } else if !e.IsSlice { + return e.Start.toIndexKey() + } else { + var start, end any + ok := true + if e.Start != nil { + start = e.Start.toIndexKey() + ok = start != nil + } + if e.End != nil && ok { + end = e.End.toIndexKey() + ok = end != nil + } + if ok { + return map[string]any{"start": start, "end": end} + } } - return []interface{}{e.Name} + return nil +} + +func (e *Index) toIndices(xs []any) []any { + if k := e.toIndexKey(); k != nil { + return append(xs, k) + } + return nil } // Func ... @@ -438,6 +570,11 @@ type Func struct { func (e *Func) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Func) writeTo(s *strings.Builder) { s.WriteString(e.Name) if len(e.Args) > 0 { s.WriteByte('(') @@ -445,11 +582,10 @@ func (e *Func) String() string { if i > 0 { s.WriteString("; ") } - fmt.Fprint(&s, e) + e.writeTo(s) } s.WriteByte(')') } - return s.String() } func (e *Func) minify() { @@ -472,21 +608,27 @@ type String struct { } func (e *String) String() string { + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *String) writeTo(s *strings.Builder) { if e.Queries == nil { - return strconv.Quote(e.Str) + jsonEncodeString(s, e.Str) + return } - var s strings.Builder - s.WriteRune('"') + s.WriteByte('"') for _, e := range e.Queries { if e.Term.Str == nil { - fmt.Fprintf(&s, "\\%s", e) + s.WriteString(`\`) + e.writeTo(s) } else { es := e.String() - fmt.Fprint(&s, es[1:len(es)-1]) + s.WriteString(es[1 : len(es)-1]) } } - s.WriteRune('"') - return s.String() + s.WriteByte('"') } func (e *String) minify() { @@ -501,19 +643,24 @@ type Object struct { } func (e *Object) String() string { + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Object) writeTo(s *strings.Builder) { if len(e.KeyVals) == 0 { - return "{}" + s.WriteString("{}") + return } - var s strings.Builder s.WriteString("{ ") for i, kv := range e.KeyVals { if i > 0 { s.WriteString(", ") } - fmt.Fprint(&s, kv) + kv.writeTo(s) } s.WriteString(" }") - return s.String() } func (e *Object) minify() { @@ -524,36 +671,38 @@ func (e *Object) minify() { // ObjectKeyVal ... type ObjectKeyVal struct { - Key string - KeyString *String - KeyQuery *Query - Val *ObjectVal - KeyOnly string - KeyOnlyString *String + Key string + KeyString *String + KeyQuery *Query + Val *ObjectVal } func (e *ObjectKeyVal) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *ObjectKeyVal) writeTo(s *strings.Builder) { if e.Key != "" { s.WriteString(e.Key) } else if e.KeyString != nil { - fmt.Fprint(&s, e.KeyString) + e.KeyString.writeTo(s) } else if e.KeyQuery != nil { - fmt.Fprintf(&s, "(%s)", e.KeyQuery) + s.WriteByte('(') + e.KeyQuery.writeTo(s) + s.WriteByte(')') } if e.Val != nil { - fmt.Fprintf(&s, ": %s", e.Val) - } - if e.KeyOnly != "" { - s.WriteString(e.KeyOnly) - } else if e.KeyOnlyString != nil { - fmt.Fprint(&s, e.KeyOnlyString) + s.WriteString(": ") + e.Val.writeTo(s) } - return s.String() } func (e *ObjectKeyVal) minify() { - if e.KeyQuery != nil { + if e.KeyString != nil { + e.KeyString.minify() + } else if e.KeyQuery != nil { e.KeyQuery.minify() } if e.Val != nil { @@ -568,13 +717,17 @@ type ObjectVal struct { func (e *ObjectVal) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *ObjectVal) writeTo(s *strings.Builder) { for i, e := range e.Queries { if i > 0 { s.WriteString(" | ") } - fmt.Fprint(&s, e) + e.writeTo(s) } - return s.String() } func (e *ObjectVal) minify() { @@ -589,10 +742,17 @@ type Array struct { } func (e *Array) String() string { - if e.Query == nil { - return "[]" + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Array) writeTo(s *strings.Builder) { + s.WriteByte('[') + if e.Query != nil { + e.Query.writeTo(s) } - return fmt.Sprintf("[%s]", e.Query) + s.WriteByte(']') } func (e *Array) minify() { @@ -611,20 +771,24 @@ type Suffix struct { func (e *Suffix) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Suffix) writeTo(s *strings.Builder) { if e.Index != nil { if e.Index.Name != "" || e.Index.Str != nil { - fmt.Fprint(&s, e.Index) + e.Index.writeTo(s) } else { - s.WriteString(e.Index.String()[1:]) + e.Index.writeSuffixTo(s) } } else if e.Iter { s.WriteString("[]") } else if e.Optional { - s.WriteString("?") + s.WriteByte('?') } else if e.Bind != nil { - fmt.Fprint(&s, e.Bind) + e.Bind.writeTo(s) } - return s.String() } func (e *Suffix) minify() { @@ -635,21 +799,21 @@ func (e *Suffix) minify() { } } -func (e *Suffix) toTerm() (*Term, bool) { +func (e *Suffix) toTerm() *Term { if e.Index != nil { - return &Term{Type: TermTypeIndex, Index: e.Index}, true + return &Term{Type: TermTypeIndex, Index: e.Index} } else if e.Iter { - return &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}}, true + return &Term{Type: TermTypeIdentity, SuffixList: []*Suffix{{Iter: true}}} } else { - return nil, false + return nil } } -func (e *Suffix) toIndices() []interface{} { +func (e *Suffix) toIndices(xs []any) []any { if e.Index == nil { return nil } - return e.Index.toIndices() + return e.Index.toIndices(xs) } // Bind ... @@ -660,15 +824,24 @@ type Bind struct { func (e *Bind) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Bind) writeTo(s *strings.Builder) { for i, p := range e.Patterns { if i == 0 { - fmt.Fprintf(&s, " as %s ", p) + s.WriteString(" as ") + p.writeTo(s) + s.WriteByte(' ') } else { - fmt.Fprintf(&s, "?// %s ", p) + s.WriteString("?// ") + p.writeTo(s) + s.WriteByte(' ') } } - fmt.Fprintf(&s, "| %s", e.Body) - return s.String() + s.WriteString("| ") + e.Body.writeTo(s) } func (e *Bind) minify() { @@ -685,15 +858,24 @@ type If struct { func (e *If) String() string { var s strings.Builder - fmt.Fprintf(&s, "if %s then %s", e.Cond, e.Then) + e.writeTo(&s) + return s.String() +} + +func (e *If) writeTo(s *strings.Builder) { + s.WriteString("if ") + e.Cond.writeTo(s) + s.WriteString(" then ") + e.Then.writeTo(s) for _, e := range e.Elif { - fmt.Fprintf(&s, " %s", e) + s.WriteByte(' ') + e.writeTo(s) } if e.Else != nil { - fmt.Fprintf(&s, " else %s", e.Else) + s.WriteString(" else ") + e.Else.writeTo(s) } s.WriteString(" end") - return s.String() } func (e *If) minify() { @@ -714,7 +896,16 @@ type IfElif struct { } func (e *IfElif) String() string { - return fmt.Sprintf("elif %s then %s", e.Cond, e.Then) + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *IfElif) writeTo(s *strings.Builder) { + s.WriteString("elif ") + e.Cond.writeTo(s) + s.WriteString(" then ") + e.Then.writeTo(s) } func (e *IfElif) minify() { @@ -730,11 +921,17 @@ type Try struct { func (e *Try) String() string { var s strings.Builder - fmt.Fprintf(&s, "try %s", e.Body) + e.writeTo(&s) + return s.String() +} + +func (e *Try) writeTo(s *strings.Builder) { + s.WriteString("try ") + e.Body.writeTo(s) if e.Catch != nil { - fmt.Fprintf(&s, " catch %s", e.Catch) + s.WriteString(" catch ") + e.Catch.writeTo(s) } - return s.String() } func (e *Try) minify() { @@ -753,7 +950,21 @@ type Reduce struct { } func (e *Reduce) String() string { - return fmt.Sprintf("reduce %s as %s (%s; %s)", e.Term, e.Pattern, e.Start, e.Update) + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Reduce) writeTo(s *strings.Builder) { + s.WriteString("reduce ") + e.Term.writeTo(s) + s.WriteString(" as ") + e.Pattern.writeTo(s) + s.WriteString(" (") + e.Start.writeTo(s) + s.WriteString("; ") + e.Update.writeTo(s) + s.WriteByte(')') } func (e *Reduce) minify() { @@ -773,12 +984,24 @@ type Foreach struct { func (e *Foreach) String() string { var s strings.Builder - fmt.Fprintf(&s, "foreach %s as %s (%s; %s", e.Term, e.Pattern, e.Start, e.Update) + e.writeTo(&s) + return s.String() +} + +func (e *Foreach) writeTo(s *strings.Builder) { + s.WriteString("foreach ") + e.Term.writeTo(s) + s.WriteString(" as ") + e.Pattern.writeTo(s) + s.WriteString(" (") + e.Start.writeTo(s) + s.WriteString("; ") + e.Update.writeTo(s) if e.Extract != nil { - fmt.Fprintf(&s, "; %s", e.Extract) + s.WriteString("; ") + e.Extract.writeTo(s) } s.WriteByte(')') - return s.String() } func (e *Foreach) minify() { @@ -797,7 +1020,16 @@ type Label struct { } func (e *Label) String() string { - return fmt.Sprintf("label %s | %s", e.Ident, e.Body) + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *Label) writeTo(s *strings.Builder) { + s.WriteString("label ") + s.WriteString(e.Ident) + s.WriteString(" | ") + e.Body.writeTo(s) } func (e *Label) minify() { @@ -817,31 +1049,35 @@ type ConstTerm struct { func (e *ConstTerm) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *ConstTerm) writeTo(s *strings.Builder) { if e.Object != nil { - fmt.Fprint(&s, e.Object) + e.Object.writeTo(s) } else if e.Array != nil { - fmt.Fprint(&s, e.Array) + e.Array.writeTo(s) } else if e.Number != "" { - fmt.Fprint(&s, e.Number) - } else if e.Str != "" { - fmt.Fprint(&s, strconv.Quote(e.Str)) + s.WriteString(e.Number) } else if e.Null { s.WriteString("null") } else if e.True { s.WriteString("true") } else if e.False { s.WriteString("false") + } else { + jsonEncodeString(s, e.Str) } - return s.String() } -func (e *ConstTerm) toValue() interface{} { +func (e *ConstTerm) toValue() any { if e.Object != nil { return e.Object.ToValue() } else if e.Array != nil { return e.Array.toValue() } else if e.Number != "" { - return normalizeNumbers(json.Number(e.Number)) + return toNumber(e.Number) } else if e.Null { return nil } else if e.True { @@ -853,33 +1089,46 @@ func (e *ConstTerm) toValue() interface{} { } } +func (e *ConstTerm) toString() (string, bool) { + if e.Object != nil || e.Array != nil || + e.Number != "" || e.Null || e.True || e.False { + return "", false + } + return e.Str, true +} + // ConstObject ... type ConstObject struct { KeyVals []*ConstObjectKeyVal } func (e *ConstObject) String() string { + var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *ConstObject) writeTo(s *strings.Builder) { if len(e.KeyVals) == 0 { - return "{}" + s.WriteString("{}") + return } - var s strings.Builder s.WriteString("{ ") for i, kv := range e.KeyVals { if i > 0 { s.WriteString(", ") } - fmt.Fprint(&s, kv) + kv.writeTo(s) } s.WriteString(" }") - return s.String() } -// ToValue converts the object to map[string]interface{}. -func (e *ConstObject) ToValue() map[string]interface{} { +// ToValue converts the object to map[string]any. +func (e *ConstObject) ToValue() map[string]any { if e == nil { return nil } - v := make(map[string]interface{}, len(e.KeyVals)) + v := make(map[string]any, len(e.KeyVals)) for _, e := range e.KeyVals { key := e.Key if key == "" { @@ -899,14 +1148,18 @@ type ConstObjectKeyVal struct { func (e *ConstObjectKeyVal) String() string { var s strings.Builder + e.writeTo(&s) + return s.String() +} + +func (e *ConstObjectKeyVal) writeTo(s *strings.Builder) { if e.Key != "" { s.WriteString(e.Key) } else { - s.WriteString(e.KeyString) + jsonEncodeString(s, e.KeyString) } s.WriteString(": ") - fmt.Fprint(&s, e.Val) - return s.String() + e.Val.writeTo(s) } // ConstArray ... @@ -916,19 +1169,23 @@ type ConstArray struct { func (e *ConstArray) String() string { var s strings.Builder - s.WriteString("[") + e.writeTo(&s) + return s.String() +} + +func (e *ConstArray) writeTo(s *strings.Builder) { + s.WriteByte('[') for i, e := range e.Elems { if i > 0 { s.WriteString(", ") } - fmt.Fprint(&s, e) + e.writeTo(s) } - s.WriteString("]") - return s.String() + s.WriteByte(']') } -func (e *ConstArray) toValue() []interface{} { - v := make([]interface{}, len(e.Elems)) +func (e *ConstArray) toValue() []any { + v := make([]any, len(e.Elems)) for i, e := range e.Elems { v[i] = e.toValue() } diff --git a/vendor/github.com/itchyny/gojq/release.go b/vendor/github.com/itchyny/gojq/release.go index 7f39519b6b..c34dfb45cb 100644 --- a/vendor/github.com/itchyny/gojq/release.go +++ b/vendor/github.com/itchyny/gojq/release.go @@ -1,8 +1,11 @@ -// +build !debug +//go:build !gojq_debug +// +build !gojq_debug package gojq -func (c *compiler) appendCodeInfo(interface{}) {} +type codeinfo struct{} + +func (c *compiler) appendCodeInfo(any) {} func (c *compiler) deleteCodeInfo(string) {} diff --git a/vendor/github.com/itchyny/gojq/scope_stack.go b/vendor/github.com/itchyny/gojq/scope_stack.go new file mode 100644 index 0000000000..e140ca15b8 --- /dev/null +++ b/vendor/github.com/itchyny/gojq/scope_stack.go @@ -0,0 +1,52 @@ +package gojq + +type scopeStack struct { + data []scopeBlock + index int + limit int +} + +type scopeBlock struct { + value scope + next int +} + +func newScopeStack() *scopeStack { + return &scopeStack{index: -1, limit: -1} +} + +func (s *scopeStack) push(v scope) { + b := scopeBlock{v, s.index} + i := s.index + 1 + if i <= s.limit { + i = s.limit + 1 + } + s.index = i + if i < len(s.data) { + s.data[i] = b + } else { + s.data = append(s.data, b) + } +} + +func (s *scopeStack) pop() scope { + b := s.data[s.index] + s.index = b.next + return b.value +} + +func (s *scopeStack) empty() bool { + return s.index < 0 +} + +func (s *scopeStack) save() (index, limit int) { + index, limit = s.index, s.limit + if s.index > s.limit { + s.limit = s.index + } + return +} + +func (s *scopeStack) restore(index, limit int) { + s.index, s.limit = index, limit +} diff --git a/vendor/github.com/itchyny/gojq/stack.go b/vendor/github.com/itchyny/gojq/stack.go index fc98dfee00..a0e265c8ca 100644 --- a/vendor/github.com/itchyny/gojq/stack.go +++ b/vendor/github.com/itchyny/gojq/stack.go @@ -7,7 +7,7 @@ type stack struct { } type block struct { - value interface{} + value any next int } @@ -15,7 +15,7 @@ func newStack() *stack { return &stack{index: -1, limit: -1} } -func (s *stack) push(v interface{}) { +func (s *stack) push(v any) { b := block{v, s.index} i := s.index + 1 if i <= s.limit { @@ -29,13 +29,13 @@ func (s *stack) push(v interface{}) { } } -func (s *stack) pop() interface{} { +func (s *stack) pop() any { b := s.data[s.index] s.index = b.next return b.value } -func (s *stack) top() interface{} { +func (s *stack) top() any { return s.data[s.index].value } @@ -43,20 +43,12 @@ func (s *stack) empty() bool { return s.index < 0 } -func (s *stack) lookup(f func(v interface{}) bool) interface{} { - for i := s.index; i >= 0; i = s.data[i].next { - if f(s.data[i].value) { - return s.data[i].value - } - } - panic("stack.lookup") -} - -func (s *stack) save(index, limit *int) { - if s.index >= s.limit { +func (s *stack) save() (index, limit int) { + index, limit = s.index, s.limit + if s.index > s.limit { s.limit = s.index } - *index, *limit = s.index, s.limit + return } func (s *stack) restore(index, limit int) { diff --git a/vendor/github.com/itchyny/gojq/term_type.go b/vendor/github.com/itchyny/gojq/term_type.go index cad0c94ca2..941e7ba9c0 100644 --- a/vendor/github.com/itchyny/gojq/term_type.go +++ b/vendor/github.com/itchyny/gojq/term_type.go @@ -1,6 +1,6 @@ package gojq -// TermType represents the type of Term. +// TermType represents the type of [Term]. type TermType int // TermType list. @@ -27,8 +27,9 @@ const ( TermTypeQuery ) -// GoString implements GoStringer. -func (termType TermType) GoString() string { +// GoString implements [fmt.GoStringer]. +func (termType TermType) GoString() (str string) { + defer func() { str = "gojq." + str }() switch termType { case TermTypeIdentity: return "TermTypeIdentity" diff --git a/vendor/github.com/itchyny/gojq/tools.go b/vendor/github.com/itchyny/gojq/tools.go deleted file mode 100644 index a17fe2236d..0000000000 --- a/vendor/github.com/itchyny/gojq/tools.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build tools - -package gojq - -import _ "github.com/itchyny/astgen-go" diff --git a/vendor/github.com/itchyny/gojq/type.go b/vendor/github.com/itchyny/gojq/type.go new file mode 100644 index 0000000000..bb388e20e4 --- /dev/null +++ b/vendor/github.com/itchyny/gojq/type.go @@ -0,0 +1,29 @@ +package gojq + +import ( + "fmt" + "math/big" +) + +// TypeOf returns the jq-flavored type name of v. +// +// This method is used by built-in type/0 function, and accepts only limited +// types (nil, bool, int, float64, *big.Int, string, []any, and map[string]any). +func TypeOf(v any) string { + switch v.(type) { + case nil: + return "null" + case bool: + return "boolean" + case int, float64, *big.Int: + return "number" + case string: + return "string" + case []any: + return "array" + case map[string]any: + return "object" + default: + panic(fmt.Sprintf("invalid type: %[1]T (%[1]v)", v)) + } +} diff --git a/vendor/github.com/itchyny/timefmt-go/CHANGELOG.md b/vendor/github.com/itchyny/timefmt-go/CHANGELOG.md new file mode 100644 index 0000000000..61a4e9dc4c --- /dev/null +++ b/vendor/github.com/itchyny/timefmt-go/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog +## [v0.1.5](https://github.com/itchyny/timefmt-go/compare/v0.1.4..v0.1.5) (2022-12-01) +* support parsing time zone offset with name using both `%z` and `%Z` + +## [v0.1.4](https://github.com/itchyny/timefmt-go/compare/v0.1.3..v0.1.4) (2022-09-01) +* improve documents +* drop support for Go 1.16 + +## [v0.1.3](https://github.com/itchyny/timefmt-go/compare/v0.1.2..v0.1.3) (2021-04-14) +* implement `ParseInLocation` for configuring the default location + +## [v0.1.2](https://github.com/itchyny/timefmt-go/compare/v0.1.1..v0.1.2) (2021-02-22) +* implement parsing/formatting time zone offset with colons (`%:z`, `%::z`, `%:::z`) +* recognize `Z` as UTC on parsing time zone offset (`%z`) +* fix padding on formatting time zone offset (`%z`) + +## [v0.1.1](https://github.com/itchyny/timefmt-go/compare/v0.1.0..v0.1.1) (2020-09-01) +* fix overflow check in 32-bit architecture + +## [v0.1.0](https://github.com/itchyny/timefmt-go/compare/2c02364..v0.1.0) (2020-08-16) +* initial implementation diff --git a/vendor/github.com/itchyny/astgen-go/LICENSE b/vendor/github.com/itchyny/timefmt-go/LICENSE similarity index 97% rename from vendor/github.com/itchyny/astgen-go/LICENSE rename to vendor/github.com/itchyny/timefmt-go/LICENSE index fcccadc5f9..84d6cb0339 100644 --- a/vendor/github.com/itchyny/astgen-go/LICENSE +++ b/vendor/github.com/itchyny/timefmt-go/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019,2020 itchyny +Copyright (c) 2020-2022 itchyny Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/github.com/itchyny/timefmt-go/Makefile b/vendor/github.com/itchyny/timefmt-go/Makefile new file mode 100644 index 0000000000..a87cb28644 --- /dev/null +++ b/vendor/github.com/itchyny/timefmt-go/Makefile @@ -0,0 +1,20 @@ +GOBIN ?= $(shell go env GOPATH)/bin + +.PHONY: all +all: test + +.PHONY: test +test: + go test -v -race ./... + +.PHONY: lint +lint: $(GOBIN)/staticcheck + go vet ./... + staticcheck -checks all,-ST1000 ./... + +$(GOBIN)/staticcheck: + go install honnef.co/go/tools/cmd/staticcheck@latest + +.PHONY: clean +clean: + go clean diff --git a/vendor/github.com/itchyny/timefmt-go/README.md b/vendor/github.com/itchyny/timefmt-go/README.md new file mode 100644 index 0000000000..f01af96112 --- /dev/null +++ b/vendor/github.com/itchyny/timefmt-go/README.md @@ -0,0 +1,69 @@ +# timefmt-go +[![CI Status](https://github.com/itchyny/timefmt-go/workflows/CI/badge.svg)](https://github.com/itchyny/timefmt-go/actions) +[![Go Report Card](https://goreportcard.com/badge/github.com/itchyny/timefmt-go)](https://goreportcard.com/report/github.com/itchyny/timefmt-go) +[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/itchyny/timefmt-go/blob/main/LICENSE) +[![release](https://img.shields.io/github/release/itchyny/timefmt-go/all.svg)](https://github.com/itchyny/timefmt-go/releases) +[![pkg.go.dev](https://pkg.go.dev/badge/github.com/itchyny/timefmt-go)](https://pkg.go.dev/github.com/itchyny/timefmt-go) + +### Efficient time formatting library (strftime, strptime) for Golang +This is a Go language package for formatting and parsing date time strings. + +```go +package main + +import ( + "fmt" + "log" + + "github.com/itchyny/timefmt-go" +) + +func main() { + t, err := timefmt.Parse("2020/07/24 09:07:29", "%Y/%m/%d %H:%M:%S") + if err != nil { + log.Fatal(err) + } + fmt.Println(t) // 2020-07-24 09:07:29 +0000 UTC + + str := timefmt.Format(t, "%Y/%m/%d %H:%M:%S") + fmt.Println(str) // 2020/07/24 09:07:29 + + str = timefmt.Format(t, "%a, %d %b %Y %T %z") + fmt.Println(str) // Fri, 24 Jul 2020 09:07:29 +0000 +} +``` + +Please refer to [`man 3 strftime`](https://linux.die.net/man/3/strftime) and +[`man 3 strptime`](https://linux.die.net/man/3/strptime) for formatters. +As an extension, `%f` directive is supported for zero-padded microseconds, which originates from Python. +Note that `E` and `O` modifier characters are not supported. + +## Comparison to other libraries +- This library + - provides both formatting and parsing functions in pure Go language, + - depends only on the Go standard libraries not to grow up dependency. +- `Format` (`strftime`) implements glibc extensions including + - width specifier like `%6Y %10B %4Z` (limited to 1024 bytes), + - omitting padding modifier like `%-y-%-m-%-d`, + - space padding modifier like `%_y-%_m-%_d`, + - upper case modifier like `%^a %^b`, + - swapping case modifier like `%#Z`, + - time zone offset modifier like `%:z %::z %:::z`, + - and its performance is very good. +- `AppendFormat` is provided for reducing allocations. +- `Parse` (`strptime`) allows to parse + - composed directives like `%F %T`, + - century years like `%C %y`, + - week names like `%A` `%a` (parsed results are discarded). +- `ParseInLocation` is provided for configuring the default location. + +![](https://user-images.githubusercontent.com/375258/88606920-de475c80-d0b8-11ea-8d40-cbfee9e35c2e.jpg) + +## Bug Tracker +Report bug at [Issues・itchyny/timefmt-go - GitHub](https://github.com/itchyny/timefmt-go/issues). + +## Author +itchyny (https://github.com/itchyny) + +## License +This software is released under the MIT License, see LICENSE. diff --git a/vendor/github.com/itchyny/timefmt-go/format.go b/vendor/github.com/itchyny/timefmt-go/format.go new file mode 100644 index 0000000000..eea976ee9c --- /dev/null +++ b/vendor/github.com/itchyny/timefmt-go/format.go @@ -0,0 +1,537 @@ +package timefmt + +import ( + "math" + "strconv" + "time" +) + +// Format time to string using the format. +func Format(t time.Time, format string) string { + return string(AppendFormat(make([]byte, 0, 64), t, format)) +} + +// AppendFormat appends formatted time string to the buffer. +func AppendFormat(buf []byte, t time.Time, format string) []byte { + year, month, day := t.Date() + hour, min, sec := t.Clock() + var width, colons int + var padding byte + var pending string + var upper, swap bool + for i := 0; i < len(format); i++ { + if b := format[i]; b == '%' { + if i++; i == len(format) { + buf = append(buf, '%') + break + } + b, width, padding, upper, swap = format[i], 0, '0', false, false + L: + switch b { + case '-': + if pending != "" { + buf = append(buf, '-') + break + } + if i++; i == len(format) { + goto K + } + padding = ^paddingMask + b = format[i] + goto L + case '_': + if i++; i == len(format) { + goto K + } + padding = ' ' | ^paddingMask + b = format[i] + goto L + case '^': + if i++; i == len(format) { + goto K + } + upper = true + b = format[i] + goto L + case '#': + if i++; i == len(format) { + goto K + } + swap = true + b = format[i] + goto L + case '0': + if i++; i == len(format) { + goto K + } + padding = '0' | ^paddingMask + b = format[i] + goto L + case '1', '2', '3', '4', '5', '6', '7', '8', '9': + width = int(b & 0x0F) + const maxWidth = 1024 + for i++; i < len(format); i++ { + b = format[i] + if b <= '9' && '0' <= b { + width = width*10 + int(b&0x0F) + if width >= math.MaxInt/10 { + width = maxWidth + } + } else { + break + } + } + if width > maxWidth { + width = maxWidth + } + if padding == ^paddingMask { + padding = ' ' | ^paddingMask + } + if i == len(format) { + goto K + } + goto L + case 'Y': + if width == 0 { + width = 4 + } + buf = appendInt(buf, year, width, padding) + case 'y': + if width < 2 { + width = 2 + } + buf = appendInt(buf, year%100, width, padding) + case 'C': + if width < 2 { + width = 2 + } + buf = appendInt(buf, year/100, width, padding) + case 'g': + if width < 2 { + width = 2 + } + year, _ := t.ISOWeek() + buf = appendInt(buf, year%100, width, padding) + case 'G': + if width == 0 { + width = 4 + } + year, _ := t.ISOWeek() + buf = appendInt(buf, year, width, padding) + case 'm': + if width < 2 { + width = 2 + } + buf = appendInt(buf, int(month), width, padding) + case 'B': + buf = appendString(buf, longMonthNames[month-1], width, padding, upper, swap) + case 'b', 'h': + buf = appendString(buf, shortMonthNames[month-1], width, padding, upper, swap) + case 'A': + buf = appendString(buf, longWeekNames[t.Weekday()], width, padding, upper, swap) + case 'a': + buf = appendString(buf, shortWeekNames[t.Weekday()], width, padding, upper, swap) + case 'w': + for ; width > 1; width-- { + buf = append(buf, padding&paddingMask) + } + buf = append(buf, '0'+byte(t.Weekday())) + case 'u': + w := int(t.Weekday()) + if w == 0 { + w = 7 + } + for ; width > 1; width-- { + buf = append(buf, padding&paddingMask) + } + buf = append(buf, '0'+byte(w)) + case 'V': + if width < 2 { + width = 2 + } + _, week := t.ISOWeek() + buf = appendInt(buf, week, width, padding) + case 'U': + if width < 2 { + width = 2 + } + week := (t.YearDay() + 6 - int(t.Weekday())) / 7 + buf = appendInt(buf, week, width, padding) + case 'W': + if width < 2 { + width = 2 + } + week := t.YearDay() + if int(t.Weekday()) > 0 { + week -= int(t.Weekday()) - 7 + } + week /= 7 + buf = appendInt(buf, week, width, padding) + case 'e': + if padding < ^paddingMask { + padding = ' ' + } + fallthrough + case 'd': + if width < 2 { + width = 2 + } + buf = appendInt(buf, day, width, padding) + case 'j': + if width < 3 { + width = 3 + } + buf = appendInt(buf, t.YearDay(), width, padding) + case 'k': + if padding < ^paddingMask { + padding = ' ' + } + fallthrough + case 'H': + if width < 2 { + width = 2 + } + buf = appendInt(buf, hour, width, padding) + case 'l': + if width < 2 { + width = 2 + } + if padding < ^paddingMask { + padding = ' ' + } + h := hour + if h > 12 { + h -= 12 + } + buf = appendInt(buf, h, width, padding) + case 'I': + if width < 2 { + width = 2 + } + h := hour + if h > 12 { + h -= 12 + } else if h == 0 { + h = 12 + } + buf = appendInt(buf, h, width, padding) + case 'p': + if hour < 12 { + buf = appendString(buf, "AM", width, padding, upper, swap) + } else { + buf = appendString(buf, "PM", width, padding, upper, swap) + } + case 'P': + if hour < 12 { + buf = appendString(buf, "am", width, padding, upper, swap) + } else { + buf = appendString(buf, "pm", width, padding, upper, swap) + } + case 'M': + if width < 2 { + width = 2 + } + buf = appendInt(buf, min, width, padding) + case 'S': + if width < 2 { + width = 2 + } + buf = appendInt(buf, sec, width, padding) + case 's': + if padding < ^paddingMask { + padding = ' ' + } + buf = appendInt(buf, int(t.Unix()), width, padding) + case 'f': + if width == 0 { + width = 6 + } + buf = appendInt(buf, t.Nanosecond()/1000, width, padding) + case 'Z', 'z': + name, offset := t.Zone() + if b == 'Z' && name != "" { + buf = appendString(buf, name, width, padding, upper, swap) + break + } + i := len(buf) + if padding != ^paddingMask { + for ; width > 1; width-- { + buf = append(buf, padding&paddingMask) + } + } + j := len(buf) + if offset < 0 { + buf = append(buf, '-') + offset = -offset + } else { + buf = append(buf, '+') + } + k := len(buf) + buf = appendInt(buf, offset/3600, 2, padding) + if buf[k] == ' ' { + buf[k-1], buf[k] = buf[k], buf[k-1] + } + if k = offset % 3600; colons <= 2 || k != 0 { + if colons != 0 { + buf = append(buf, ':') + } + buf = appendInt(buf, k/60, 2, '0') + if k %= 60; colons == 2 || colons == 3 && k != 0 { + buf = append(buf, ':') + buf = appendInt(buf, k, 2, '0') + } + } + colons = 0 + if i != j { + l := len(buf) + k = j + 1 - (l - j) + if k < i { + l = j + 1 + i - k + k = i + } else { + l = j + 1 + } + copy(buf[k:], buf[j:]) + buf = buf[:l] + if padding&paddingMask == '0' { + for ; k > i; k-- { + buf[k-1], buf[k] = buf[k], buf[k-1] + } + } + } + case ':': + if pending != "" { + buf = append(buf, ':') + } else { + colons = 1 + M: + for i++; i < len(format); i++ { + switch format[i] { + case ':': + colons++ + case 'z': + if colons > 3 { + i++ + break M + } + b = 'z' + goto L + default: + break M + } + } + buf = appendLast(buf, format[:i], width, padding) + i-- + colons = 0 + } + case 't': + buf = appendString(buf, "\t", width, padding, false, false) + case 'n': + buf = appendString(buf, "\n", width, padding, false, false) + case '%': + buf = appendString(buf, "%", width, padding, false, false) + default: + if pending == "" { + var ok bool + if pending, ok = compositions[b]; ok { + swap = false + break + } + buf = appendLast(buf, format[:i], width-1, padding) + } + buf = append(buf, b) + } + if pending != "" { + b, pending, width, padding = pending[0], pending[1:], 0, '0' + goto L + } + } else { + buf = append(buf, b) + } + } + return buf +K: + return appendLast(buf, format, width, padding) +} + +func appendInt(buf []byte, num, width int, padding byte) []byte { + if padding != ^paddingMask { + padding &= paddingMask + switch width { + case 2: + if num < 10 { + buf = append(buf, padding) + goto L1 + } else if num < 100 { + goto L2 + } else if num < 1000 { + goto L3 + } else if num < 10000 { + goto L4 + } + case 4: + if num < 1000 { + buf = append(buf, padding) + if num < 100 { + buf = append(buf, padding) + if num < 10 { + buf = append(buf, padding) + goto L1 + } + goto L2 + } + goto L3 + } else if num < 10000 { + goto L4 + } + default: + i := len(buf) + for ; width > 1; width-- { + buf = append(buf, padding) + } + j := len(buf) + buf = strconv.AppendInt(buf, int64(num), 10) + l := len(buf) + if j+1 == l || i == j { + return buf + } + k := j + 1 - (l - j) + if k < i { + l = j + 1 + i - k + k = i + } else { + l = j + 1 + } + copy(buf[k:], buf[j:]) + return buf[:l] + } + } + if num < 100 { + if num < 10 { + goto L1 + } + goto L2 + } else if num < 10000 { + if num < 1000 { + goto L3 + } + goto L4 + } + return strconv.AppendInt(buf, int64(num), 10) +L4: + buf = append(buf, byte(num/1000)|'0') + num %= 1000 +L3: + buf = append(buf, byte(num/100)|'0') + num %= 100 +L2: + buf = append(buf, byte(num/10)|'0') + num %= 10 +L1: + return append(buf, byte(num)|'0') +} + +func appendString(buf []byte, str string, width int, padding byte, upper, swap bool) []byte { + if width > len(str) && padding != ^paddingMask { + if padding < ^paddingMask { + padding = ' ' + } else { + padding &= paddingMask + } + for width -= len(str); width > 0; width-- { + buf = append(buf, padding) + } + } + switch { + case swap: + if str[len(str)-1] < 'a' { + for _, b := range []byte(str) { + buf = append(buf, b|0x20) + } + break + } + fallthrough + case upper: + for _, b := range []byte(str) { + buf = append(buf, b&0x5F) + } + default: + buf = append(buf, str...) + } + return buf +} + +func appendLast(buf []byte, format string, width int, padding byte) []byte { + for i := len(format) - 1; i >= 0; i-- { + if format[i] == '%' { + buf = appendString(buf, format[i:], width, padding, false, false) + break + } + } + return buf +} + +const paddingMask byte = 0x7F + +var longMonthNames = []string{ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +} + +var shortMonthNames = []string{ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", +} + +var longWeekNames = []string{ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", +} + +var shortWeekNames = []string{ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat", +} + +var compositions = map[byte]string{ + 'c': "a b e H:M:S Y", + '+': "a b e H:M:S Z Y", + 'F': "Y-m-d", + 'D': "m/d/y", + 'x': "m/d/y", + 'v': "e-b-Y", + 'T': "H:M:S", + 'X': "H:M:S", + 'r': "I:M:S p", + 'R': "H:M", +} diff --git a/vendor/github.com/itchyny/timefmt-go/parse.go b/vendor/github.com/itchyny/timefmt-go/parse.go new file mode 100644 index 0000000000..83b0df2c4e --- /dev/null +++ b/vendor/github.com/itchyny/timefmt-go/parse.go @@ -0,0 +1,408 @@ +package timefmt + +import ( + "errors" + "fmt" + "time" +) + +// Parse time string using the format. +func Parse(source, format string) (t time.Time, err error) { + return parse(source, format, time.UTC, time.Local) +} + +// ParseInLocation parses time string with the default location. +// The location is also used to parse the time zone name (%Z). +func ParseInLocation(source, format string, loc *time.Location) (t time.Time, err error) { + return parse(source, format, loc, loc) +} + +func parse(source, format string, loc, base *time.Location) (t time.Time, err error) { + year, month, day, hour, min, sec, nsec := 1900, 1, 1, 0, 0, 0, 0 + defer func() { + if err != nil { + err = fmt.Errorf("failed to parse %q with %q: %w", source, format, err) + } + }() + var j, century, yday, colons int + var pm, hasZoneName, hasZoneOffset bool + var pending string + for i, l := 0, len(source); i < len(format); i++ { + if b := format[i]; b == '%' { + i++ + if i == len(format) { + err = errors.New("stray %") + return + } + b = format[i] + L: + switch b { + case 'Y': + if year, j, err = parseNumber(source, j, 4, 'Y'); err != nil { + return + } + case 'y': + if year, j, err = parseNumber(source, j, 2, 'y'); err != nil { + return + } + if year < 69 { + year += 2000 + } else { + year += 1900 + } + case 'C': + if century, j, err = parseNumber(source, j, 2, 'C'); err != nil { + return + } + case 'g': + if year, j, err = parseNumber(source, j, 2, b); err != nil { + return + } + year += 2000 + case 'G': + if year, j, err = parseNumber(source, j, 4, b); err != nil { + return + } + case 'm': + if month, j, err = parseNumber(source, j, 2, 'm'); err != nil { + return + } + case 'B': + if month, j, err = lookup(source, j, longMonthNames, 'B'); err != nil { + return + } + case 'b', 'h': + if month, j, err = lookup(source, j, shortMonthNames, b); err != nil { + return + } + case 'A': + if _, j, err = lookup(source, j, longWeekNames, 'A'); err != nil { + return + } + case 'a': + if _, j, err = lookup(source, j, shortWeekNames, 'a'); err != nil { + return + } + case 'w': + if j >= l || source[j] < '0' || '6' < source[j] { + err = parseFormatError(b) + return + } + j++ + case 'u': + if j >= l || source[j] < '1' || '7' < source[j] { + err = parseFormatError(b) + return + } + j++ + case 'V', 'U', 'W': + if _, j, err = parseNumber(source, j, 2, b); err != nil { + return + } + case 'e': + if j < l && source[j] == ' ' { + j++ + } + fallthrough + case 'd': + if day, j, err = parseNumber(source, j, 2, b); err != nil { + return + } + case 'j': + if yday, j, err = parseNumber(source, j, 3, 'j'); err != nil { + return + } + case 'k': + if j < l && source[j] == ' ' { + j++ + } + fallthrough + case 'H': + if hour, j, err = parseNumber(source, j, 2, b); err != nil { + return + } + case 'l': + if j < l && source[j] == ' ' { + j++ + } + fallthrough + case 'I': + if hour, j, err = parseNumber(source, j, 2, b); err != nil { + return + } + if hour == 12 { + hour = 0 + } + case 'p', 'P': + var ampm int + if ampm, j, err = lookup(source, j, []string{"AM", "PM"}, 'p'); err != nil { + return + } + pm = ampm == 2 + case 'M': + if min, j, err = parseNumber(source, j, 2, 'M'); err != nil { + return + } + case 'S': + if sec, j, err = parseNumber(source, j, 2, 'S'); err != nil { + return + } + case 's': + var unix int + if unix, j, err = parseNumber(source, j, 10, 's'); err != nil { + return + } + t = time.Unix(int64(unix), 0).In(time.UTC) + var mon time.Month + year, mon, day = t.Date() + hour, min, sec = t.Clock() + month = int(mon) + case 'f': + var usec, k, d int + if usec, k, err = parseNumber(source, j, 6, 'f'); err != nil { + return + } + for j, d = k, k-j; d < 6; d++ { + usec *= 10 + } + nsec = usec * 1000 + case 'Z': + k := j + for ; k < l; k++ { + if c := source[k]; c < 'A' || 'Z' < c { + break + } + } + t, err = time.ParseInLocation("MST", source[j:k], base) + if err != nil { + err = fmt.Errorf(`cannot parse %q with "%%Z"`, source[j:k]) + return + } + if hasZoneOffset { + name, _ := t.Zone() + _, offset := locationZone(loc) + loc = time.FixedZone(name, offset) + } else { + loc = t.Location() + } + hasZoneName = true + j = k + case 'z': + if j >= l { + err = parseZFormatError(colons) + return + } + sign := 1 + switch source[j] { + case '-': + sign = -1 + fallthrough + case '+': + var hour, min, sec, k int + if hour, k, _ = parseNumber(source, j+1, 2, 'z'); k != j+3 { + err = parseZFormatError(colons) + return + } + if j = k; j >= l || source[j] != ':' { + switch colons { + case 1: + err = errors.New("expected ':' for %:z") + return + case 2: + err = errors.New("expected ':' for %::z") + return + } + } else if j++; colons == 0 { + colons = 4 + } + if min, k, _ = parseNumber(source, j, 2, 'z'); k != j+2 { + if colons == 0 { + k = j + } else { + err = parseZFormatError(colons & 3) + return + } + } + if j = k; colons > 1 { + if j >= l || source[j] != ':' { + if colons == 2 { + err = errors.New("expected ':' for %::z") + return + } + } else if sec, k, _ = parseNumber(source, j+1, 2, 'z'); k != j+3 { + if colons == 2 { + err = parseZFormatError(colons) + return + } + } else { + j = k + } + } + var name string + if hasZoneName { + name, _ = locationZone(loc) + } + loc, colons = time.FixedZone(name, sign*((hour*60+min)*60+sec)), 0 + hasZoneOffset = true + case 'Z': + loc, colons, j = time.UTC, 0, j+1 + default: + err = parseZFormatError(colons) + return + } + case ':': + if pending != "" { + if j >= l || source[j] != b { + err = expectedFormatError(b) + return + } + j++ + } else { + if i++; i == len(format) { + err = errors.New(`expected 'z' after "%:"`) + return + } else if b = format[i]; b == 'z' { + colons = 1 + } else if b != ':' { + err = errors.New(`expected 'z' after "%:"`) + return + } else if i++; i == len(format) { + err = errors.New(`expected 'z' after "%::"`) + return + } else if b = format[i]; b == 'z' { + colons = 2 + } else { + err = errors.New(`expected 'z' after "%::"`) + return + } + goto L + } + case 't', 'n': + k := j + K: + for ; k < l; k++ { + switch source[k] { + case ' ', '\t', '\n', '\v', '\f', '\r': + default: + break K + } + } + if k == j { + err = fmt.Errorf("expected a space for %%%c", b) + return + } + j = k + case '%': + if j >= l || source[j] != b { + err = expectedFormatError(b) + return + } + j++ + default: + if pending == "" { + var ok bool + if pending, ok = compositions[b]; ok { + break + } + err = fmt.Errorf(`unexpected format: "%%%c"`, b) + return + } + if j >= l || source[j] != b { + err = expectedFormatError(b) + return + } + j++ + } + if pending != "" { + b, pending = pending[0], pending[1:] + goto L + } + } else if j >= len(source) || source[j] != b { + err = expectedFormatError(b) + return + } else { + j++ + } + } + if j < len(source) { + err = fmt.Errorf("unconverted string: %q", source[j:]) + return + } + if pm { + hour += 12 + } + if century > 0 { + year = century*100 + year%100 + } + if yday > 0 { + return time.Date(year, time.January, 1, hour, min, sec, nsec, loc).AddDate(0, 0, yday-1), nil + } + return time.Date(year, time.Month(month), day, hour, min, sec, nsec, loc), nil +} + +func locationZone(loc *time.Location) (name string, offset int) { + return time.Date(2000, time.January, 1, 0, 0, 0, 0, loc).Zone() +} + +type parseFormatError byte + +func (err parseFormatError) Error() string { + return fmt.Sprintf("cannot parse %%%c", byte(err)) +} + +type expectedFormatError byte + +func (err expectedFormatError) Error() string { + return fmt.Sprintf("expected %q", byte(err)) +} + +type parseZFormatError int + +func (err parseZFormatError) Error() string { + switch int(err) { + case 0: + return "cannot parse %z" + case 1: + return "cannot parse %:z" + default: + return "cannot parse %::z" + } +} + +func parseNumber(source string, min, size int, format byte) (int, int, error) { + var val int + if l := len(source); min+size > l { + size = l + } else { + size += min + } + i := min + for ; i < size; i++ { + if b := source[i]; '0' <= b && b <= '9' { + val = val*10 + int(b&0x0F) + } else { + break + } + } + if i == min { + return 0, 0, parseFormatError(format) + } + return val, i, nil +} + +func lookup(source string, min int, candidates []string, format byte) (int, int, error) { +L: + for i, xs := range candidates { + j := min + for k := 0; k < len(xs); k, j = k+1, j+1 { + if j >= len(source) { + continue L + } + if x, y := xs[k], source[j]; x != y && x|('a'-'A') != y|('a'-'A') { + continue L + } + } + return i + 1, j, nil + } + return 0, 0, parseFormatError(format) +} diff --git a/vendor/github.com/itchyny/timefmt-go/timefmt.go b/vendor/github.com/itchyny/timefmt-go/timefmt.go new file mode 100644 index 0000000000..45bf6ae903 --- /dev/null +++ b/vendor/github.com/itchyny/timefmt-go/timefmt.go @@ -0,0 +1,2 @@ +// Package timefmt provides functions for formatting and parsing date time strings. +package timefmt diff --git a/vendor/github.com/lestrrat-go/strftime/.gitignore b/vendor/github.com/lestrrat-go/strftime/.gitignore deleted file mode 100644 index daf913b1b3..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/lestrrat-go/strftime/.travis.yml b/vendor/github.com/lestrrat-go/strftime/.travis.yml deleted file mode 100644 index 7345555a38..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: go -sudo: false -go: - - 1.13.x - - tip diff --git a/vendor/github.com/lestrrat-go/strftime/LICENSE b/vendor/github.com/lestrrat-go/strftime/LICENSE deleted file mode 100644 index eed693818e..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 lestrrat - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/lestrrat-go/strftime/Makefile b/vendor/github.com/lestrrat-go/strftime/Makefile deleted file mode 100644 index e55946134c..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -bench: - go test -tags bench -benchmem -bench . - @git checkout go.mod - @rm go.sum diff --git a/vendor/github.com/lestrrat-go/strftime/README.md b/vendor/github.com/lestrrat-go/strftime/README.md deleted file mode 100644 index f94f38e0e6..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/README.md +++ /dev/null @@ -1,202 +0,0 @@ -# strftime - -Fast strftime for Go - -[![Build Status](https://travis-ci.org/lestrrat-go/strftime.png?branch=master)](https://travis-ci.org/lestrrat-go/strftime) - -[![GoDoc](https://godoc.org/github.com/lestrrat-go/strftime?status.svg)](https://godoc.org/github.com/lestrrat-go/strftime) - -# SYNOPSIS - -```go -f := strftime.New(`.... pattern ...`) -if err := f.Format(buf, time.Now()); err != nil { - log.Println(err.Error()) -} -``` - -# DESCRIPTION - -The goals for this library are - -* Optimized for the same pattern being called repeatedly -* Be flexible about destination to write the results out -* Be as complete as possible in terms of conversion specifications - -# API - -## Format(string, time.Time) (string, error) - -Takes the pattern and the time, and formats it. This function is a utility function that recompiles the pattern every time the function is called. If you know beforehand that you will be formatting the same pattern multiple times, consider using `New` to create a `Strftime` object and reuse it. - -## New(string) (\*Strftime, error) - -Takes the pattern and creates a new `Strftime` object. - -## obj.Pattern() string - -Returns the pattern string used to create this `Strftime` object - -## obj.Format(io.Writer, time.Time) error - -Formats the time according to the pre-compiled pattern, and writes the result to the specified `io.Writer` - -## obj.FormatString(time.Time) string - -Formats the time according to the pre-compiled pattern, and returns the result string. - -# SUPPORTED CONVERSION SPECIFICATIONS - -| pattern | description | -|:--------|:------------| -| %A | national representation of the full weekday name | -| %a | national representation of the abbreviated weekday | -| %B | national representation of the full month name | -| %b | national representation of the abbreviated month name | -| %C | (year / 100) as decimal number; single digits are preceded by a zero | -| %c | national representation of time and date | -| %D | equivalent to %m/%d/%y | -| %d | day of the month as a decimal number (01-31) | -| %e | the day of the month as a decimal number (1-31); single digits are preceded by a blank | -| %F | equivalent to %Y-%m-%d | -| %H | the hour (24-hour clock) as a decimal number (00-23) | -| %h | same as %b | -| %I | the hour (12-hour clock) as a decimal number (01-12) | -| %j | the day of the year as a decimal number (001-366) | -| %k | the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank | -| %l | the hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank | -| %M | the minute as a decimal number (00-59) | -| %m | the month as a decimal number (01-12) | -| %n | a newline | -| %p | national representation of either "ante meridiem" (a.m.) or "post meridiem" (p.m.) as appropriate. | -| %R | equivalent to %H:%M | -| %r | equivalent to %I:%M:%S %p | -| %S | the second as a decimal number (00-60) | -| %T | equivalent to %H:%M:%S | -| %t | a tab | -| %U | the week number of the year (Sunday as the first day of the week) as a decimal number (00-53) | -| %u | the weekday (Monday as the first day of the week) as a decimal number (1-7) | -| %V | the week number of the year (Monday as the first day of the week) as a decimal number (01-53) | -| %v | equivalent to %e-%b-%Y | -| %W | the week number of the year (Monday as the first day of the week) as a decimal number (00-53) | -| %w | the weekday (Sunday as the first day of the week) as a decimal number (0-6) | -| %X | national representation of the time | -| %x | national representation of the date | -| %Y | the year with century as a decimal number | -| %y | the year without century as a decimal number (00-99) | -| %Z | the time zone name | -| %z | the time zone offset from UTC | -| %% | a '%' | - -# EXTENSIONS / CUSTOM SPECIFICATIONS - -This library in general tries to be POSIX compliant, but sometimes you just need that -extra specification or two that is relatively widely used but is not included in the -POSIX specification. - -For example, POSIX does not specify how to print out milliseconds, -but popular implementations allow `%f` or `%L` to achieve this. - -For those instances, `strftime.Strftime` can be configured to use a custom set of -specifications: - -``` -ss := strftime.NewSpecificationSet() -ss.Set('L', ...) // provide implementation for `%L` - -// pass this new specification set to the strftime instance -p, err := strftime.New(`%L`, strftime.WithSpecificationSet(ss)) -p.Format(..., time.Now()) -``` - -The implementation must implement the `Appender` interface, which is - -``` -type Appender interface { - Append([]byte, time.Time) []byte -} -``` - -For commonly used extensions such as the millisecond example, we provide a default -implementation so the user can do one of the following: - -``` -// (1) Pass a speficication byte and the Appender -// This allows you to pass arbitrary Appenders -p, err := strftime.New( - `%L`, - strftime.WithSpecification('L', strftime.Milliseconds), -) - -// (2) Pass an option that knows to use strftime.Milliseconds -p, err := strftime.New( - `%L`, - strftime.WithMilliseconds('L'), -) -``` - -If a common specification is missing, please feel free to submit a PR -(but please be sure to be able to defend how "common" it is) - -# PERFORMANCE / OTHER LIBRARIES - -The following benchmarks were run separately because some libraries were using cgo on specific platforms (notabley, the fastly version) - -``` -// On my OS X 10.14.6, 2.3 GHz Intel Core i5, 16GB memory. -// go version go1.13.4 darwin/amd64 -hummingbird% go test -tags bench -benchmem -bench . - -BenchmarkTebeka-4 297471 3905 ns/op 257 B/op 20 allocs/op -BenchmarkJehiah-4 818444 1773 ns/op 256 B/op 17 allocs/op -BenchmarkFastly-4 2330794 550 ns/op 80 B/op 5 allocs/op -BenchmarkLestrrat-4 916365 1458 ns/op 80 B/op 2 allocs/op -BenchmarkLestrratCachedString-4 2527428 546 ns/op 128 B/op 2 allocs/op -BenchmarkLestrratCachedWriter-4 537422 2155 ns/op 192 B/op 3 allocs/op -PASS -ok github.com/lestrrat-go/strftime 25.618s -``` - -``` -// On a host on Google Cloud Platform, machine-type: f1-micro (vCPU x 1, memory: 0.6GB) -// (Yes, I was being skimpy) -// Linux 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64 GNU/Linux -// go version go1.13.4 linux/amd64 -hummingbird% go test -tags bench -benchmem -bench . - -BenchmarkTebeka 254997 4726 ns/op 256 B/op 20 allocs/op -BenchmarkJehiah 659289 1882 ns/op 256 B/op 17 allocs/op -BenchmarkFastly 389150 3044 ns/op 224 B/op 13 allocs/op -BenchmarkLestrrat 699069 1780 ns/op 80 B/op 2 allocs/op -BenchmarkLestrratCachedString 2081594 589 ns/op 128 B/op 2 allocs/op -BenchmarkLestrratCachedWriter 825763 1480 ns/op 192 B/op 3 allocs/op -PASS -ok github.com/lestrrat-go/strftime 11.355s -``` - -This library is much faster than other libraries *IF* you can reuse the format pattern. - -Here's the annotated list from the benchmark results. You can clearly see that (re)using a `Strftime` object -and producing a string is the fastest. Writing to an `io.Writer` seems a bit sluggish, but since -the one producing the string is doing almost exactly the same thing, we believe this is purely the overhead of -writing to an `io.Writer` - -| Import Path | Score | Note | -|:------------------------------------|--------:|:--------------------------------| -| github.com/lestrrat-go/strftime | 3000000 | Using `FormatString()` (cached) | -| github.com/fastly/go-utils/strftime | 2000000 | Pure go version on OS X | -| github.com/lestrrat-go/strftime | 1000000 | Using `Format()` (NOT cached) | -| github.com/jehiah/go-strftime | 1000000 | | -| github.com/fastly/go-utils/strftime | 1000000 | cgo version on Linux | -| github.com/lestrrat-go/strftime | 500000 | Using `Format()` (cached) | -| github.com/tebeka/strftime | 300000 | | - -However, depending on your pattern, this speed may vary. If you find a particular pattern that seems sluggish, -please send in patches or tests. - -Please also note that this benchmark only uses the subset of conversion specifications that are supported by *ALL* of the libraries compared. - -Somethings to consider when making performance comparisons in the future: - -* Can it write to io.Writer? -* Which `%specification` does it handle? diff --git a/vendor/github.com/lestrrat-go/strftime/appenders.go b/vendor/github.com/lestrrat-go/strftime/appenders.go deleted file mode 100644 index e4b4204dfd..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/appenders.go +++ /dev/null @@ -1,293 +0,0 @@ -package strftime - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" - "time" -) - -// These are all of the standard, POSIX compliant specifications. -// Extensions should be in extensions.go -var ( - fullWeekDayName = StdlibFormat("Monday") - abbrvWeekDayName = StdlibFormat("Mon") - fullMonthName = StdlibFormat("January") - abbrvMonthName = StdlibFormat("Jan") - centuryDecimal = AppendFunc(appendCentury) - timeAndDate = StdlibFormat("Mon Jan _2 15:04:05 2006") - mdy = StdlibFormat("01/02/06") - dayOfMonthZeroPad = StdlibFormat("02") - dayOfMonthSpacePad = StdlibFormat("_2") - ymd = StdlibFormat("2006-01-02") - twentyFourHourClockZeroPad = StdlibFormat("15") - twelveHourClockZeroPad = StdlibFormat("3") - dayOfYear = AppendFunc(appendDayOfYear) - twentyFourHourClockSpacePad = hourwblank(false) - twelveHourClockSpacePad = hourwblank(true) - minutesZeroPad = StdlibFormat("04") - monthNumberZeroPad = StdlibFormat("01") - newline = Verbatim("\n") - ampm = StdlibFormat("PM") - hm = StdlibFormat("15:04") - imsp = StdlibFormat("3:04:05 PM") - secondsNumberZeroPad = StdlibFormat("05") - hms = StdlibFormat("15:04:05") - tab = Verbatim("\t") - weekNumberSundayOrigin = weeknumberOffset(0) // week number of the year, Sunday first - weekdayMondayOrigin = weekday(1) - // monday as the first day, and 01 as the first value - weekNumberMondayOriginOneOrigin = AppendFunc(appendWeekNumber) - eby = StdlibFormat("_2-Jan-2006") - // monday as the first day, and 00 as the first value - weekNumberMondayOrigin = weeknumberOffset(1) // week number of the year, Monday first - weekdaySundayOrigin = weekday(0) - natReprTime = StdlibFormat("15:04:05") // national representation of the time XXX is this correct? - natReprDate = StdlibFormat("01/02/06") // national representation of the date XXX is this correct? - year = StdlibFormat("2006") // year with century - yearNoCentury = StdlibFormat("06") // year w/o century - timezone = StdlibFormat("MST") // time zone name - timezoneOffset = StdlibFormat("-0700") // time zone ofset from UTC - percent = Verbatim("%") -) - -// Appender is the interface that must be fulfilled by components that -// implement the translation of specifications to actual time value. -// -// The Append method takes the accumulated byte buffer, and the time to -// use to generate the textual representation. The resulting byte -// sequence must be returned by this method, normally by using the -// append() builtin function. -type Appender interface { - Append([]byte, time.Time) []byte -} - -// AppendFunc is an utility type to allow users to create a -// function-only version of an Appender -type AppendFunc func([]byte, time.Time) []byte - -func (af AppendFunc) Append(b []byte, t time.Time) []byte { - return af(b, t) -} - -type appenderList []Appender - -type dumper interface { - dump(io.Writer) -} - -func (l appenderList) dump(out io.Writer) { - var buf bytes.Buffer - ll := len(l) - for i, a := range l { - if dumper, ok := a.(dumper); ok { - dumper.dump(&buf) - } else { - fmt.Fprintf(&buf, "%#v", a) - } - - if i < ll-1 { - fmt.Fprintf(&buf, ",\n") - } - } - buf.WriteTo(out) -} - -// does the time.Format thing -type stdlibFormat struct { - s string -} - -// StdlibFormat returns an Appender that simply goes through `time.Format()` -// For example, if you know you want to display the abbreviated month name for %b, -// you can create a StdlibFormat with the pattern `Jan` and register that -// for specification `b`: -// -// a := StdlibFormat(`Jan`) -// ss := NewSpecificationSet() -// ss.Set('b', a) // does %b -> abbreviated month name -func StdlibFormat(s string) Appender { - return &stdlibFormat{s: s} -} - -func (v stdlibFormat) Append(b []byte, t time.Time) []byte { - return t.AppendFormat(b, v.s) -} - -func (v stdlibFormat) str() string { - return v.s -} - -func (v stdlibFormat) canCombine() bool { - return true -} - -func (v stdlibFormat) combine(w combiner) Appender { - return StdlibFormat(v.s + w.str()) -} - -func (v stdlibFormat) dump(out io.Writer) { - fmt.Fprintf(out, "stdlib: %s", v.s) -} - -type verbatimw struct { - s string -} - -// Verbatim returns an Appender suitable for generating static text. -// For static text, this method is slightly favorable than creating -// your own appender, as adjacent verbatim blocks will be combined -// at compile time to produce more efficient Appenders -func Verbatim(s string) Appender { - return &verbatimw{s: s} -} - -func (v verbatimw) Append(b []byte, _ time.Time) []byte { - return append(b, v.s...) -} - -func (v verbatimw) canCombine() bool { - return canCombine(v.s) -} - -func (v verbatimw) combine(w combiner) Appender { - if _, ok := w.(*stdlibFormat); ok { - return StdlibFormat(v.s + w.str()) - } - return Verbatim(v.s + w.str()) -} - -func (v verbatimw) str() string { - return v.s -} - -func (v verbatimw) dump(out io.Writer) { - fmt.Fprintf(out, "verbatim: %s", v.s) -} - -// These words below, as well as any decimal character -var combineExclusion = []string{ - "Mon", - "Monday", - "Jan", - "January", - "MST", - "PM", - "pm", -} - -func canCombine(s string) bool { - if strings.ContainsAny(s, "0123456789") { - return false - } - for _, word := range combineExclusion { - if strings.Contains(s, word) { - return false - } - } - return true -} - -type combiner interface { - canCombine() bool - combine(combiner) Appender - str() string -} - -// this is container for the compiler to keep track of appenders, -// and combine them as we parse and compile the pattern -type combiningAppend struct { - list appenderList - prev Appender - prevCanCombine bool -} - -func (ca *combiningAppend) Append(w Appender) { - if ca.prevCanCombine { - if wc, ok := w.(combiner); ok && wc.canCombine() { - ca.prev = ca.prev.(combiner).combine(wc) - ca.list[len(ca.list)-1] = ca.prev - return - } - } - - ca.list = append(ca.list, w) - ca.prev = w - ca.prevCanCombine = false - if comb, ok := w.(combiner); ok { - if comb.canCombine() { - ca.prevCanCombine = true - } - } -} - -func appendCentury(b []byte, t time.Time) []byte { - n := t.Year() / 100 - if n < 10 { - b = append(b, '0') - } - return append(b, strconv.Itoa(n)...) -} - -type weekday int - -func (v weekday) Append(b []byte, t time.Time) []byte { - n := int(t.Weekday()) - if n < int(v) { - n += 7 - } - return append(b, byte(n+48)) -} - -type weeknumberOffset int - -func (v weeknumberOffset) Append(b []byte, t time.Time) []byte { - yd := t.YearDay() - offset := int(t.Weekday()) - int(v) - if offset < 0 { - offset += 7 - } - - if yd < offset { - return append(b, '0', '0') - } - - n := ((yd - offset) / 7) + 1 - if n < 10 { - b = append(b, '0') - } - return append(b, strconv.Itoa(n)...) -} - -func appendWeekNumber(b []byte, t time.Time) []byte { - _, n := t.ISOWeek() - if n < 10 { - b = append(b, '0') - } - return append(b, strconv.Itoa(n)...) -} - -func appendDayOfYear(b []byte, t time.Time) []byte { - n := t.YearDay() - if n < 10 { - b = append(b, '0', '0') - } else if n < 100 { - b = append(b, '0') - } - return append(b, strconv.Itoa(n)...) -} - -type hourwblank bool - -func (v hourwblank) Append(b []byte, t time.Time) []byte { - h := t.Hour() - if bool(v) && h > 12 { - h = h - 12 - } - if h < 10 { - b = append(b, ' ') - } - return append(b, strconv.Itoa(h)...) -} diff --git a/vendor/github.com/lestrrat-go/strftime/extension.go b/vendor/github.com/lestrrat-go/strftime/extension.go deleted file mode 100644 index b0218b9a94..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/extension.go +++ /dev/null @@ -1,31 +0,0 @@ -package strftime - -import ( - "strconv" - "time" -) - -// NOTE: declare private variable and iniitalize once in init(), -// and leave the Milliseconds() function as returning static content. -// This way, `go doc -all` does not show the contents of the -// milliseconds function -var milliseconds Appender - -func init() { - milliseconds = AppendFunc(func(b []byte, t time.Time) []byte { - millisecond := int(t.Nanosecond()) / int(time.Millisecond) - if millisecond < 100 { - b = append(b, '0') - } - if millisecond < 10 { - b = append(b, '0') - } - return append(b, strconv.Itoa(millisecond)...) - }) -} - -// Milliseconds returns the Appender suitable for creating a zero-padded, -// 3-digit millisecond textual representation. -func Milliseconds() Appender { - return milliseconds -} diff --git a/vendor/github.com/lestrrat-go/strftime/options.go b/vendor/github.com/lestrrat-go/strftime/options.go deleted file mode 100644 index 8697a9b53c..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/options.go +++ /dev/null @@ -1,51 +0,0 @@ -package strftime - -type Option interface { - Name() string - Value() interface{} -} - -type option struct { - name string - value interface{} -} - -func (o *option) Name() string { return o.name } -func (o *option) Value() interface{} { return o.value } - -const optSpecificationSet = `opt-specification-set` - -// WithSpecification allows you to specify a custom specification set -func WithSpecificationSet(ds SpecificationSet) Option { - return &option{ - name: optSpecificationSet, - value: ds, - } -} - -type optSpecificationPair struct { - name byte - appender Appender -} - -const optSpecification = `opt-specification` - -// WithSpecification allows you to create a new specification set on the fly, -// to be used only for that invocation. -func WithSpecification(b byte, a Appender) Option { - return &option{ - name: optSpecification, - value: &optSpecificationPair{ - name: b, - appender: a, - }, - } -} - -// WithMilliseconds is similar to WithSpecification, and specifies that -// the Strftime object should interpret the pattern `%b` (where b -// is the byte that you specify as the argument) -// as the zero-padded, 3 letter milliseconds of the time. -func WithMilliseconds(b byte) Option { - return WithSpecification(b, Milliseconds()) -} diff --git a/vendor/github.com/lestrrat-go/strftime/specifications.go b/vendor/github.com/lestrrat-go/strftime/specifications.go deleted file mode 100644 index 9d3f55b94c..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/specifications.go +++ /dev/null @@ -1,143 +0,0 @@ -package strftime - -import ( - "sync" - - "github.com/pkg/errors" -) - -// because there is no such thing was a sync.RWLocker -type rwLocker interface { - RLock() - RUnlock() - sync.Locker -} - -// SpecificationSet is a container for patterns that Strftime uses. -// If you want a custom strftime, you can copy the default -// SpecificationSet and tweak it -type SpecificationSet interface { - Lookup(byte) (Appender, error) - Delete(byte) error - Set(byte, Appender) error -} - -type specificationSet struct { - mutable bool - lock rwLocker - store map[byte]Appender -} - -// The default specification set does not need any locking as it is never -// accessed from the outside, and is never mutated. -var defaultSpecificationSet SpecificationSet - -func init() { - defaultSpecificationSet = newImmutableSpecificationSet() -} - -func newImmutableSpecificationSet() SpecificationSet { - // Create a mutable one so that populateDefaultSpecifications work through - // its magic, then copy the associated map - // (NOTE: this is done this way because there used to be - // two struct types for specification set, united under an interface. - // it can now be removed, but we would need to change the entire - // populateDefaultSpecifications method, and I'm currently too lazy - // PRs welcome) - tmp := NewSpecificationSet() - - ss := &specificationSet{ - mutable: false, - lock: nil, // never used, so intentionally not initialized - store: tmp.(*specificationSet).store, - } - - return ss -} - -// NewSpecificationSet creates a specification set with the default specifications. -func NewSpecificationSet() SpecificationSet { - ds := &specificationSet{ - mutable: true, - lock: &sync.RWMutex{}, - store: make(map[byte]Appender), - } - populateDefaultSpecifications(ds) - - return ds -} - -func populateDefaultSpecifications(ds SpecificationSet) { - ds.Set('A', fullWeekDayName) - ds.Set('a', abbrvWeekDayName) - ds.Set('B', fullMonthName) - ds.Set('b', abbrvMonthName) - ds.Set('C', centuryDecimal) - ds.Set('c', timeAndDate) - ds.Set('D', mdy) - ds.Set('d', dayOfMonthZeroPad) - ds.Set('e', dayOfMonthSpacePad) - ds.Set('F', ymd) - ds.Set('H', twentyFourHourClockZeroPad) - ds.Set('h', abbrvMonthName) - ds.Set('I', twelveHourClockZeroPad) - ds.Set('j', dayOfYear) - ds.Set('k', twentyFourHourClockSpacePad) - ds.Set('l', twelveHourClockSpacePad) - ds.Set('M', minutesZeroPad) - ds.Set('m', monthNumberZeroPad) - ds.Set('n', newline) - ds.Set('p', ampm) - ds.Set('R', hm) - ds.Set('r', imsp) - ds.Set('S', secondsNumberZeroPad) - ds.Set('T', hms) - ds.Set('t', tab) - ds.Set('U', weekNumberSundayOrigin) - ds.Set('u', weekdayMondayOrigin) - ds.Set('V', weekNumberMondayOriginOneOrigin) - ds.Set('v', eby) - ds.Set('W', weekNumberMondayOrigin) - ds.Set('w', weekdaySundayOrigin) - ds.Set('X', natReprTime) - ds.Set('x', natReprDate) - ds.Set('Y', year) - ds.Set('y', yearNoCentury) - ds.Set('Z', timezone) - ds.Set('z', timezoneOffset) - ds.Set('%', percent) -} - -func (ds *specificationSet) Lookup(b byte) (Appender, error) { - if ds.mutable { - ds.lock.RLock() - defer ds.lock.RLock() - } - v, ok := ds.store[b] - if !ok { - return nil, errors.Errorf(`lookup failed: '%%%c' was not found in specification set`, b) - } - return v, nil -} - -func (ds *specificationSet) Delete(b byte) error { - if !ds.mutable { - return errors.New(`delete failed: this specification set is marked immutable`) - } - - ds.lock.Lock() - defer ds.lock.Unlock() - delete(ds.store, b) - return nil -} - -func (ds *specificationSet) Set(b byte, a Appender) error { - if !ds.mutable { - return errors.New(`set failed: this specification set is marked immutable`) - } - - ds.lock.Lock() - defer ds.lock.Unlock() - ds.store[b] = a - return nil -} diff --git a/vendor/github.com/lestrrat-go/strftime/strftime.go b/vendor/github.com/lestrrat-go/strftime/strftime.go deleted file mode 100644 index 81c0d88703..0000000000 --- a/vendor/github.com/lestrrat-go/strftime/strftime.go +++ /dev/null @@ -1,213 +0,0 @@ -package strftime - -import ( - "io" - "strings" - "sync" - "time" - - "github.com/pkg/errors" -) - -type compileHandler interface { - handle(Appender) -} - -// compile, and create an appender list -type appenderListBuilder struct { - list *combiningAppend -} - -func (alb *appenderListBuilder) handle(a Appender) { - alb.list.Append(a) -} - -// compile, and execute the appenders on the fly -type appenderExecutor struct { - t time.Time - dst []byte -} - -func (ae *appenderExecutor) handle(a Appender) { - ae.dst = a.Append(ae.dst, ae.t) -} - -func compile(handler compileHandler, p string, ds SpecificationSet) error { - for l := len(p); l > 0; l = len(p) { - // This is a really tight loop, so we don't even calls to - // Verbatim() to cuase extra stuff - var verbatim verbatimw - - i := strings.IndexByte(p, '%') - if i < 0 { - verbatim.s = p - handler.handle(&verbatim) - // this is silly, but I don't trust break keywords when there's a - // possibility of this piece of code being rearranged - p = p[l:] - continue - } - if i == l-1 { - return errors.New(`stray % at the end of pattern`) - } - - // we found a '%'. we need the next byte to decide what to do next - // we already know that i < l - 1 - // everything up to the i is verbatim - if i > 0 { - verbatim.s = p[:i] - handler.handle(&verbatim) - p = p[i:] - } - - specification, err := ds.Lookup(p[1]) - if err != nil { - return errors.Wrap(err, `pattern compilation failed`) - } - - handler.handle(specification) - p = p[2:] - } - return nil -} - -func getSpecificationSetFor(options ...Option) SpecificationSet { - var ds SpecificationSet = defaultSpecificationSet - var extraSpecifications []*optSpecificationPair - for _, option := range options { - switch option.Name() { - case optSpecificationSet: - ds = option.Value().(SpecificationSet) - case optSpecification: - extraSpecifications = append(extraSpecifications, option.Value().(*optSpecificationPair)) - } - } - - if len(extraSpecifications) > 0 { - // If ds is immutable, we're going to need to create a new - // one. oh what a waste! - if raw, ok := ds.(*specificationSet); ok && !raw.mutable { - ds = NewSpecificationSet() - } - for _, v := range extraSpecifications { - ds.Set(v.name, v.appender) - } - } - return ds -} - -var fmtAppendExecutorPool = sync.Pool{ - New: func() interface{} { - var h appenderExecutor - h.dst = make([]byte, 0, 32) - return &h - }, -} - -func getFmtAppendExecutor() *appenderExecutor { - return fmtAppendExecutorPool.Get().(*appenderExecutor) -} - -func releasdeFmtAppendExecutor(v *appenderExecutor) { - // TODO: should we discard the buffer if it's too long? - v.dst = v.dst[:0] - fmtAppendExecutorPool.Put(v) -} - -// Format takes the format `s` and the time `t` to produce the -// format date/time. Note that this function re-compiles the -// pattern every time it is called. -// -// If you know beforehand that you will be reusing the pattern -// within your application, consider creating a `Strftime` object -// and reusing it. -func Format(p string, t time.Time, options ...Option) (string, error) { - // TODO: this may be premature optimization - ds := getSpecificationSetFor(options...) - h := getFmtAppendExecutor() - defer releasdeFmtAppendExecutor(h) - - h.t = t - if err := compile(h, p, ds); err != nil { - return "", errors.Wrap(err, `failed to compile format`) - } - - return string(h.dst), nil -} - -// Strftime is the object that represents a compiled strftime pattern -type Strftime struct { - pattern string - compiled appenderList -} - -// New creates a new Strftime object. If the compilation fails, then -// an error is returned in the second argument. -func New(p string, options ...Option) (*Strftime, error) { - // TODO: this may be premature optimization - ds := getSpecificationSetFor(options...) - - var h appenderListBuilder - h.list = &combiningAppend{} - - if err := compile(&h, p, ds); err != nil { - return nil, errors.Wrap(err, `failed to compile format`) - } - - return &Strftime{ - pattern: p, - compiled: h.list.list, - }, nil -} - -// Pattern returns the original pattern string -func (f *Strftime) Pattern() string { - return f.pattern -} - -// Format takes the destination `dst` and time `t`. It formats the date/time -// using the pre-compiled pattern, and outputs the results to `dst` -func (f *Strftime) Format(dst io.Writer, t time.Time) error { - const bufSize = 64 - var b []byte - max := len(f.pattern) + 10 - if max < bufSize { - var buf [bufSize]byte - b = buf[:0] - } else { - b = make([]byte, 0, max) - } - if _, err := dst.Write(f.format(b, t)); err != nil { - return err - } - return nil -} - -// Dump outputs the internal structure of the formatter, for debugging purposes. -// Please do NOT assume the output format to be fixed: it is expected to change -// in the future. -func (f *Strftime) Dump(out io.Writer) { - f.compiled.dump(out) -} - -func (f *Strftime) format(b []byte, t time.Time) []byte { - for _, w := range f.compiled { - b = w.Append(b, t) - } - return b -} - -// FormatString takes the time `t` and formats it, returning the -// string containing the formated data. -func (f *Strftime) FormatString(t time.Time) string { - const bufSize = 64 - var b []byte - max := len(f.pattern) + 10 - if max < bufSize { - var buf [bufSize]byte - b = buf[:0] - } else { - b = make([]byte, 0, max) - } - return string(f.format(b, t)) -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go index d569c0c949..d0ea68f408 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_bsd.go +++ b/vendor/github.com/mattn/go-isatty/isatty_bsd.go @@ -1,6 +1,7 @@ -//go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine +//go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo // +build darwin freebsd openbsd netbsd dragonfly hurd // +build !appengine +// +build !tinygo package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index 31503226f6..7402e0618a 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,5 +1,6 @@ -//go:build appengine || js || nacl || wasm -// +build appengine js nacl wasm +//go:build (appengine || js || nacl || tinygo || wasm) && !windows +// +build appengine js nacl tinygo wasm +// +build !windows package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go index 67787657fb..0337d8cf6d 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go +++ b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go @@ -1,6 +1,7 @@ -//go:build (linux || aix || zos) && !appengine +//go:build (linux || aix || zos) && !appengine && !tinygo // +build linux aix zos // +build !appengine +// +build !tinygo package isatty diff --git a/vendor/github.com/mitchellh/hashstructure/README.md b/vendor/github.com/mitchellh/hashstructure/README.md index 28ce45a3e1..feb0c24962 100644 --- a/vendor/github.com/mitchellh/hashstructure/README.md +++ b/vendor/github.com/mitchellh/hashstructure/README.md @@ -17,12 +17,14 @@ sending data across the network, caching values locally (de-dup), and so on. doesn't affect the hash code but the field itself is still taken into account to create the hash value. - * Optionally specify a custom hash function to optimize for speed, collision + * Optionally, specify a custom hash function to optimize for speed, collision avoidance for your data set, etc. - - * Optionally hash the output of `.String()` on structs that implement fmt.Stringer, + + * Optionally, hash the output of `.String()` on structs that implement fmt.Stringer, allowing effective hashing of time.Time + * Optionally, override the hashing process by implementing `Hashable`. + ## Installation Standard `go get`: diff --git a/vendor/github.com/mitchellh/hashstructure/hashstructure.go b/vendor/github.com/mitchellh/hashstructure/hashstructure.go index ea13a1583c..89dd4d3ea8 100644 --- a/vendor/github.com/mitchellh/hashstructure/hashstructure.go +++ b/vendor/github.com/mitchellh/hashstructure/hashstructure.go @@ -6,6 +6,7 @@ import ( "hash" "hash/fnv" "reflect" + "time" ) // ErrNotStringer is returned when there's an error with hash:"string" @@ -31,6 +32,21 @@ type HashOptions struct { // ZeroNil is flag determining if nil pointer should be treated equal // to a zero value of pointed type. By default this is false. ZeroNil bool + + // IgnoreZeroValue is determining if zero value fields should be + // ignored for hash calculation. + IgnoreZeroValue bool + + // SlicesAsSets assumes that a `set` tag is always present for slices. + // Default is false (in which case the tag is used instead) + SlicesAsSets bool + + // UseStringer will attempt to use fmt.Stringer aways. If the struct + // doesn't implement fmt.Stringer, it'll fall back to trying usual tricks. + // If this is true, and the "string" tag is also set, the tag takes + // precedense (meaning that if the type doesn't implement fmt.Stringer, we + // panic) + UseStringer bool } // Hash returns the hash value of an arbitrary value. @@ -82,17 +98,23 @@ func Hash(v interface{}, opts *HashOptions) (uint64, error) { // Create our walker and walk the structure w := &walker{ - h: opts.Hasher, - tag: opts.TagName, - zeronil: opts.ZeroNil, + h: opts.Hasher, + tag: opts.TagName, + zeronil: opts.ZeroNil, + ignorezerovalue: opts.IgnoreZeroValue, + sets: opts.SlicesAsSets, + stringer: opts.UseStringer, } return w.visit(reflect.ValueOf(v), nil) } type walker struct { - h hash.Hash64 - tag string - zeronil bool + h hash.Hash64 + tag string + zeronil bool + ignorezerovalue bool + sets bool + stringer bool } type visitOpts struct { @@ -104,6 +126,8 @@ type visitOpts struct { StructField string } +var timeType = reflect.TypeOf(time.Time{}) + func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { t := reflect.TypeOf(0) @@ -159,6 +183,18 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { return w.h.Sum64(), err } + switch v.Type() { + case timeType: + w.h.Reset() + b, err := v.Interface().(time.Time).MarshalBinary() + if err != nil { + return 0, err + } + + err = binary.Write(w.h, binary.LittleEndian, b) + return w.h.Sum64(), err + } + switch k { case reflect.Array: var h uint64 @@ -220,6 +256,24 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { include = impl } + if impl, ok := parent.(Hashable); ok { + return impl.Hash() + } + + // If we can address this value, check if the pointer value + // implements our interfaces and use that if so. + if v.CanAddr() { + vptr := v.Addr() + parentptr := vptr.Interface() + if impl, ok := parentptr.(Includable); ok { + include = impl + } + + if impl, ok := parentptr.(Hashable); ok { + return impl.Hash() + } + } + t := v.Type() h, err := w.visit(reflect.ValueOf(t.Name()), nil) if err != nil { @@ -229,6 +283,7 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { l := v.NumField() for i := 0; i < l; i++ { if innerV := v.Field(i); v.CanSet() || t.Field(i).Name != "_" { + var f visitFlag fieldType := t.Field(i) if fieldType.PkgPath != "" { @@ -242,11 +297,20 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { continue } + if w.ignorezerovalue { + zeroVal := reflect.Zero(reflect.TypeOf(innerV.Interface())).Interface() + if innerV.Interface() == zeroVal { + continue + } + } + // if string is set, use the string value - if tag == "string" { + if tag == "string" || w.stringer { if impl, ok := innerV.Interface().(fmt.Stringer); ok { innerV = reflect.ValueOf(impl.String()) - } else { + } else if tag == "string" { + // We only show this error if the tag explicitly + // requests a stringer. return 0, &ErrNotStringer{ Field: v.Type().Field(i).Name, } @@ -306,7 +370,7 @@ func (w *walker) visit(v reflect.Value, opts *visitOpts) (uint64, error) { return 0, err } - if set { + if set || w.sets { h = hashUpdateUnordered(h, current) } else { h = hashUpdateOrdered(w.h, h, current) diff --git a/vendor/github.com/mitchellh/hashstructure/include.go b/vendor/github.com/mitchellh/hashstructure/include.go index b6289c0bee..702d35415d 100644 --- a/vendor/github.com/mitchellh/hashstructure/include.go +++ b/vendor/github.com/mitchellh/hashstructure/include.go @@ -13,3 +13,10 @@ type Includable interface { type IncludableMap interface { HashIncludeMap(field string, k, v interface{}) (bool, error) } + +// Hashable is an interface that can optionally be implemented by a struct +// to override the hash value. This value will override the hash value for +// the entire struct. Entries in the struct will not be hashed. +type Hashable interface { + Hash() (uint64, error) +} diff --git a/vendor/github.com/pbnjay/strptime/README.md b/vendor/github.com/pbnjay/strptime/README.md deleted file mode 100644 index 64afef2b40..0000000000 --- a/vendor/github.com/pbnjay/strptime/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Strptime -======== - -Simple C-style strptime wrappers for Go's `time.Parse`. Support is available -for the following subset of format strings (descriptions blatantly stolen from -python docs): - - %d Day of the month as a zero-padded decimal number. - %b Month as locale’s abbreviated name. - %B Month as locale’s full name. - %m Month as a zero-padded decimal number. - %y Year without century as a zero-padded decimal number. - %Y Year with century as a decimal number. - %H Hour (24-hour clock) as a zero-padded decimal number. - %I Hour (12-hour clock) as a zero-padded decimal number. - %p Locale’s equivalent of either AM or PM. - %M Minute as a zero-padded decimal number. - %S Second as a zero-padded decimal number. - %f Microsecond as a decimal number, zero-padded on the left. - %z UTC offset in the form +HHMM or -HHMM. - %Z Time zone name. UTC, EST, CST - %% A literal '%' character. - -A small test suite is included to test many common use cases. Code is available -under the MIT License in case anyone else has a need for it like I do. - diff --git a/vendor/github.com/pbnjay/strptime/strptime.go b/vendor/github.com/pbnjay/strptime/strptime.go deleted file mode 100644 index 94b88f8f2d..0000000000 --- a/vendor/github.com/pbnjay/strptime/strptime.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -Copyright (c) 2013 Jeremy Jay - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -// Package strptime provides a C-style strptime wrappers for time.Parse. -// -// It supports the following subset of format strings (stolen from python docs): -// %d Day of the month as a zero-padded decimal number. -// %b Month as locale’s abbreviated name. -// %B Month as locale’s full name. -// %m Month as a zero-padded decimal number. -// %y Year without century as a zero-padded decimal number. -// %Y Year with century as a decimal number. -// %H Hour (24-hour clock) as a zero-padded decimal number. -// %I Hour (12-hour clock) as a zero-padded decimal number. -// %p Locale’s equivalent of either AM or PM. -// %M Minute as a zero-padded decimal number. -// %S Second as a zero-padded decimal number. -// %f Microsecond as a decimal number, zero-padded on the left. -// %z UTC offset in the form +HHMM or -HHMM. -// %Z Time zone name. UTC, EST, CST -// %% A literal '%' character. -// -// BUG(pbnjay): If an unsupported specifier is used, it may NOT directly precede a -// supported specifier (i.e. there must be intervening text to match first) -package strptime - -import ( - "errors" - "strings" - "time" -) - -// Parse accepts a percent-encoded strptime format string, converts it for use with -// time.Parse, and returns the resulting time.Time value. If non-date-related format -// text does not match within the string value, then ErrFormatMismatch will be returned. -// Errors from time.Parse are passed through untouched. -// -// If a unsupported format specifier is provided, it will be ignored and matching -// text will be skipped. To receive errors for unsupported formats, use ParseStrict or call Check. -func Parse(value, format string) (time.Time, error) { - return strptime(value, format, true) -} - -// ParseStrict returns ErrFormatUnsupported for unsupported formats strings, but is otherwise -// identical to Parse. -func ParseStrict(value, format string) (time.Time, error) { - return strptime(value, format, false) -} - -// MustParse is a wrapper for Parse which panics on any error. -func MustParse(value, format string) time.Time { - t, err := strptime(value, format, true) - if err != nil { - panic(err) - } - return t -} - -// Check verifies that format is a fully-supported strptime format string for this implementation. -func Check(format string) error { - parts := strings.Split(format, "%") - for _, ps := range parts { - // since we split on '%', this is the format code - c := int(ps[0]) - if c == '%' { - continue - } - if _, found := formatMap[c]; !found { - return ErrFormatUnsupported - } - } - - return nil -} - -func strptime(value, format string, ignoreUnsupported bool) (time.Time, error) { - parseStr := "" - parseFmt := "" - vi := 0 - - parts := strings.Split(format, "%") - for pi, ps := range parts { - if pi == 0 { - // check prefix string - if value[:len(ps)] != ps { - return time.Time{}, ErrFormatMismatch - } - vi += len(ps) - continue - } - // since we split on '%', this is the format code - c := int(ps[0]) - - if c == '%' { // handle %% quickly - if ps != value[vi:vi+len(ps)] { - return time.Time{}, ErrFormatMismatch - } - vi += len(ps) - continue - } - - // Check if format is supported and get the time.Parse translation - f, supported := formatMap[c] - if !supported && !ignoreUnsupported { - return time.Time{}, ErrFormatUnsupported - } - - // Check the intervening text between format strings. - // There may be some edge cases where this isn't quite right - // but if that's the case you've got other problems... - vj := len(ps) - 1 - if vj > 0 { - vj = strings.Index(value[vi:], ps[1:]) - } - if vj == -1 { - return time.Time{}, ErrFormatMismatch - } - - if supported { - // Build up a new format and date string - if vj == 0 { // no intervening text - if c == 'f' { - vj = len(value) - vi - } else { - vj = len(f) - if vj > len(value)-vi { - return time.Time{}, ErrFormatMismatch - } - } - } - - if c == 'f' { - parseFmt += "." + f - parseStr += "." + value[vi:vi+vj] - } else if c == 'p' { - parseFmt += " " + f - parseStr += " " + strings.ToUpper(value[vi:vi+vj]) - } else { - parseFmt += " " + f - parseStr += " " + value[vi:vi+vj] - } - } - - if !supported && vj == 0 { - // ignore to the end of the string - vi = len(value) - } else { - vi += (len(ps) - 1) + vj - } - } - - if vi < len(value) { - // extra text on end of value - return time.Time{}, ErrFormatMismatch - } - - return time.Parse(parseFmt, parseStr) -} - -var ( - // ErrFormatMismatch means that intervening text in the strptime format string did not - // match within the parsed string. - ErrFormatMismatch = errors.New("date format mismatch") - // ErrFormatUnsupported means that the format string includes unsupport percent-escapes. - ErrFormatUnsupported = errors.New("date format contains unsupported percent-encodings") - - formatMap = map[int]string{ - 'd': "02", - 'b': "Jan", - 'B': "January", - 'm': "01", - 'y': "06", - 'Y': "2006", - 'H': "15", - 'I': "03", - 'p': "PM", - 'M': "04", - 'S': "05", - 'f': "999999", - 'z': "-0700", - 'Z': "MST", - } -) diff --git a/vendor/github.com/rivo/uniseg/README.md b/vendor/github.com/rivo/uniseg/README.md index 25e9346874..a8191b8154 100644 --- a/vendor/github.com/rivo/uniseg/README.md +++ b/vendor/github.com/rivo/uniseg/README.md @@ -3,7 +3,7 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/rivo/uniseg.svg)](https://pkg.go.dev/github.com/rivo/uniseg) [![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/uniseg) -This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](https://unicode.org/reports/tr29/), Unicode Line Breaking according to [Unicode Standard Annex #14](https://unicode.org/reports/tr14/) (Unicode version 14.0.0), and monospace font string width calculation similar to [wcwidth](https://man7.org/linux/man-pages/man3/wcwidth.3.html). +This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](https://unicode.org/reports/tr29/), Unicode Line Breaking according to [Unicode Standard Annex #14](https://unicode.org/reports/tr14/) (Unicode version 15.0.0), and monospace font string width calculation similar to [wcwidth](https://man7.org/linux/man-pages/man3/wcwidth.3.html). ## Background @@ -73,7 +73,7 @@ for gr.Next() { ### Using the [`Step`](https://pkg.go.dev/github.com/rivo/uniseg#Step) or [`StepString`](https://pkg.go.dev/github.com/rivo/uniseg#StepString) Function -This is orders of magnitude faster than the `Graphemes` class, but it requires the handling of states and boundaries: +This avoids allocating a new `Graphemes` object but it requires the handling of states and boundaries: ```go str := "🇩🇪ðŸ³ï¸â€ðŸŒˆ" @@ -88,29 +88,7 @@ for len(str) > 0 { ### Advanced Examples -Breaking into grapheme clusters and evaluating line breaks: - -```go -str := "First line.\nSecond line." -state := -1 -var ( - c string - boundaries int -) -for len(str) > 0 { - c, str, boundaries, state = uniseg.StepString(str, state) - fmt.Print(c) - if boundaries&uniseg.MaskLine == uniseg.LineCanBreak { - fmt.Print("|") - } else if boundaries&uniseg.MaskLine == uniseg.LineMustBreak { - fmt.Print("‖") - } -} -// First |line. -// ‖Second |line.‖ -``` - -If you're only interested in word segmentation, use [`FirstWord`](https://pkg.go.dev/github.com/rivo/uniseg#FirstWord) or [`FirstWordInString`](https://pkg.go.dev/github.com/rivo/uniseg#FirstWordInString): +The [`Graphemes`](https://pkg.go.dev/github.com/rivo/uniseg#Graphemes) class offers the most convenient way to access all functionality of this package. But in some cases, it may be better to use the specialized functions directly. For example, if you're only interested in word segmentation, use [`FirstWord`](https://pkg.go.dev/github.com/rivo/uniseg#FirstWord) or [`FirstWordInString`](https://pkg.go.dev/github.com/rivo/uniseg#FirstWordInString): ```go str := "Hello, world!" @@ -133,6 +111,8 @@ Similarly, use - [`FirstSentence`](https://pkg.go.dev/github.com/rivo/uniseg#FirstSentence) or [`FirstSentenceInString`](https://pkg.go.dev/github.com/rivo/uniseg#FirstSentenceInString) for sentence segmentation only, and - [`FirstLineSegment`](https://pkg.go.dev/github.com/rivo/uniseg#FirstLineSegment) or [`FirstLineSegmentInString`](https://pkg.go.dev/github.com/rivo/uniseg#FirstLineSegmentInString) for line breaking / word wrapping (although using [`Step`](https://pkg.go.dev/github.com/rivo/uniseg#Step) or [`StepString`](https://pkg.go.dev/github.com/rivo/uniseg#StepString) is preferred as it will observe grapheme cluster boundaries). +If you're only interested in the width of characters, use [`FirstGraphemeCluster`](https://pkg.go.dev/github.com/rivo/uniseg#FirstGraphemeCluster) or [`FirstGraphemeClusterInString`](https://pkg.go.dev/github.com/rivo/uniseg#FirstGraphemeClusterInString). It is much faster than using [`Step`](https://pkg.go.dev/github.com/rivo/uniseg#Step), [`StepString`](https://pkg.go.dev/github.com/rivo/uniseg#StepString), or the [`Graphemes`](https://pkg.go.dev/github.com/rivo/uniseg#Graphemes) class because it does not include the logic for word / sentence / line boundaries. + Finally, if you need to reverse a string while preserving grapheme clusters, use [`ReverseString`](https://pkg.go.dev/github.com/rivo/uniseg#ReverseString): ```go diff --git a/vendor/github.com/rivo/uniseg/eastasianwidth.go b/vendor/github.com/rivo/uniseg/eastasianwidth.go index 661934ac2d..5fc54d9915 100644 --- a/vendor/github.com/rivo/uniseg/eastasianwidth.go +++ b/vendor/github.com/rivo/uniseg/eastasianwidth.go @@ -1,13 +1,13 @@ -package uniseg - // Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg + // eastAsianWidth are taken from -// https://www.unicode.org/Public/14.0.0/ucd/EastAsianWidth.txt +// https://www.unicode.org/Public/15.0.0/ucd/EastAsianWidth.txt // and -// https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt +// https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt // ("Extended_Pictographic" only) -// on September 10, 2022. See https://www.unicode.org/license.html for the Unicode +// on September 5, 2023. See https://www.unicode.org/license.html for the Unicode // license agreement. var eastAsianWidth = [][3]int{ {0x0000, 0x001F, prN}, // Cc [32] .. @@ -504,6 +504,7 @@ var eastAsianWidth = [][3]int{ {0x0CE2, 0x0CE3, prN}, // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL {0x0CE6, 0x0CEF, prN}, // Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE {0x0CF1, 0x0CF2, prN}, // Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA + {0x0CF3, 0x0CF3, prN}, // Mc KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT {0x0D00, 0x0D01, prN}, // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU {0x0D02, 0x0D03, prN}, // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA {0x0D04, 0x0D0C, prN}, // Lo [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -565,7 +566,7 @@ var eastAsianWidth = [][3]int{ {0x0EBD, 0x0EBD, prN}, // Lo LAO SEMIVOWEL SIGN NYO {0x0EC0, 0x0EC4, prN}, // Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI {0x0EC6, 0x0EC6, prN}, // Lm LAO KO LA - {0x0EC8, 0x0ECD, prN}, // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + {0x0EC8, 0x0ECE, prN}, // Mn [7] LAO TONE MAI EK..LAO YAMAKKAN {0x0ED0, 0x0ED9, prN}, // Nd [10] LAO DIGIT ZERO..LAO DIGIT NINE {0x0EDC, 0x0EDF, prN}, // Lo [4] LAO HO NO..LAO LETTER KHMU NYO {0x0F00, 0x0F00, prN}, // Lo TIBETAN SYLLABLE OM @@ -1916,6 +1917,7 @@ var eastAsianWidth = [][3]int{ {0x10EAB, 0x10EAC, prN}, // Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK {0x10EAD, 0x10EAD, prN}, // Pd YEZIDI HYPHENATION MARK {0x10EB0, 0x10EB1, prN}, // Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE + {0x10EFD, 0x10EFF, prN}, // Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA {0x10F00, 0x10F1C, prN}, // Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL {0x10F1D, 0x10F26, prN}, // No [10] OLD SOGDIAN NUMBER ONE..OLD SOGDIAN FRACTION ONE HALF {0x10F27, 0x10F27, prN}, // Lo OLD SOGDIAN LIGATURE AYIN-DALETH @@ -1998,6 +2000,8 @@ var eastAsianWidth = [][3]int{ {0x11236, 0x11237, prN}, // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA {0x11238, 0x1123D, prN}, // Po [6] KHOJKI DANDA..KHOJKI ABBREVIATION SIGN {0x1123E, 0x1123E, prN}, // Mn KHOJKI SIGN SUKUN + {0x1123F, 0x11240, prN}, // Lo [2] KHOJKI LETTER QA..KHOJKI LETTER SHORT I + {0x11241, 0x11241, prN}, // Mn KHOJKI VOWEL SIGN VOCALIC R {0x11280, 0x11286, prN}, // Lo [7] MULTANI LETTER A..MULTANI LETTER GA {0x11288, 0x11288, prN}, // Lo MULTANI LETTER GHA {0x1128A, 0x1128D, prN}, // Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA @@ -2160,6 +2164,7 @@ var eastAsianWidth = [][3]int{ {0x11A9E, 0x11AA2, prN}, // Po [5] SOYOMBO HEAD MARK WITH MOON AND SUN AND TRIPLE FLAME..SOYOMBO TERMINAL MARK-2 {0x11AB0, 0x11ABF, prN}, // Lo [16] CANADIAN SYLLABICS NATTILIK HI..CANADIAN SYLLABICS SPA {0x11AC0, 0x11AF8, prN}, // Lo [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL + {0x11B00, 0x11B09, prN}, // Po [10] DEVANAGARI HEAD MARK..DEVANAGARI SIGN MINDU {0x11C00, 0x11C08, prN}, // Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L {0x11C0A, 0x11C2E, prN}, // Lo [37] BHAIKSUKI LETTER E..BHAIKSUKI LETTER HA {0x11C2F, 0x11C2F, prN}, // Mc BHAIKSUKI VOWEL SIGN AA @@ -2205,6 +2210,19 @@ var eastAsianWidth = [][3]int{ {0x11EF3, 0x11EF4, prN}, // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U {0x11EF5, 0x11EF6, prN}, // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O {0x11EF7, 0x11EF8, prN}, // Po [2] MAKASAR PASSIMBANG..MAKASAR END OF SECTION + {0x11F00, 0x11F01, prN}, // Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA + {0x11F02, 0x11F02, prN}, // Lo KAWI SIGN REPHA + {0x11F03, 0x11F03, prN}, // Mc KAWI SIGN VISARGA + {0x11F04, 0x11F10, prN}, // Lo [13] KAWI LETTER A..KAWI LETTER O + {0x11F12, 0x11F33, prN}, // Lo [34] KAWI LETTER KA..KAWI LETTER JNYA + {0x11F34, 0x11F35, prN}, // Mc [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA + {0x11F36, 0x11F3A, prN}, // Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R + {0x11F3E, 0x11F3F, prN}, // Mc [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI + {0x11F40, 0x11F40, prN}, // Mn KAWI VOWEL SIGN EU + {0x11F41, 0x11F41, prN}, // Mc KAWI SIGN KILLER + {0x11F42, 0x11F42, prN}, // Mn KAWI CONJOINER + {0x11F43, 0x11F4F, prN}, // Po [13] KAWI DANDA..KAWI PUNCTUATION CLOSING SPIRAL + {0x11F50, 0x11F59, prN}, // Nd [10] KAWI DIGIT ZERO..KAWI DIGIT NINE {0x11FB0, 0x11FB0, prN}, // Lo LISU LETTER YHA {0x11FC0, 0x11FD4, prN}, // No [21] TAMIL FRACTION ONE THREE-HUNDRED-AND-TWENTIETH..TAMIL FRACTION DOWNSCALING FACTOR KIIZH {0x11FD5, 0x11FDC, prN}, // So [8] TAMIL SIGN NEL..TAMIL SIGN MUKKURUNI @@ -2217,8 +2235,11 @@ var eastAsianWidth = [][3]int{ {0x12480, 0x12543, prN}, // Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU {0x12F90, 0x12FF0, prN}, // Lo [97] CYPRO-MINOAN SIGN CM001..CYPRO-MINOAN SIGN CM114 {0x12FF1, 0x12FF2, prN}, // Po [2] CYPRO-MINOAN SIGN CM301..CYPRO-MINOAN SIGN CM302 - {0x13000, 0x1342E, prN}, // Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032 - {0x13430, 0x13438, prN}, // Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT + {0x13000, 0x1342F, prN}, // Lo [1072] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH V011D + {0x13430, 0x1343F, prN}, // Cf [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE + {0x13440, 0x13440, prN}, // Mn EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY + {0x13441, 0x13446, prN}, // Lo [6] EGYPTIAN HIEROGLYPH FULL BLANK..EGYPTIAN HIEROGLYPH WIDE LOST SIGN + {0x13447, 0x13455, prN}, // Mn [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED {0x14400, 0x14646, prN}, // Lo [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530 {0x16800, 0x16A38, prN}, // Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ {0x16A40, 0x16A5E, prN}, // Lo [31] MRO LETTER TA..MRO LETTER TEK @@ -2263,7 +2284,9 @@ var eastAsianWidth = [][3]int{ {0x1AFFD, 0x1AFFE, prW}, // Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 {0x1B000, 0x1B0FF, prW}, // Lo [256] KATAKANA LETTER ARCHAIC E..HENTAIGANA LETTER RE-2 {0x1B100, 0x1B122, prW}, // Lo [35] HENTAIGANA LETTER RE-3..KATAKANA LETTER ARCHAIC WU + {0x1B132, 0x1B132, prW}, // Lo HIRAGANA LETTER SMALL KO {0x1B150, 0x1B152, prW}, // Lo [3] HIRAGANA LETTER SMALL WI..HIRAGANA LETTER SMALL WO + {0x1B155, 0x1B155, prW}, // Lo KATAKANA LETTER SMALL KO {0x1B164, 0x1B167, prW}, // Lo [4] KATAKANA LETTER SMALL WI..KATAKANA LETTER SMALL N {0x1B170, 0x1B2FB, prW}, // Lo [396] NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB {0x1BC00, 0x1BC6A, prN}, // Lo [107] DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M @@ -2294,6 +2317,7 @@ var eastAsianWidth = [][3]int{ {0x1D200, 0x1D241, prN}, // So [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54 {0x1D242, 0x1D244, prN}, // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME {0x1D245, 0x1D245, prN}, // So GREEK MUSICAL LEIMMA + {0x1D2C0, 0x1D2D3, prN}, // No [20] KAKTOVIK NUMERAL ZERO..KAKTOVIK NUMERAL NINETEEN {0x1D2E0, 0x1D2F3, prN}, // No [20] MAYAN NUMERAL ZERO..MAYAN NUMERAL NINETEEN {0x1D300, 0x1D356, prN}, // So [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING {0x1D360, 0x1D378, prN}, // No [25] COUNTING ROD UNIT DIGIT ONE..TALLY MARK FIVE @@ -2353,11 +2377,14 @@ var eastAsianWidth = [][3]int{ {0x1DF00, 0x1DF09, prN}, // Ll [10] LATIN SMALL LETTER FENG DIGRAPH WITH TRILL..LATIN SMALL LETTER T WITH HOOK AND RETROFLEX HOOK {0x1DF0A, 0x1DF0A, prN}, // Lo LATIN LETTER RETROFLEX CLICK WITH RETROFLEX HOOK {0x1DF0B, 0x1DF1E, prN}, // Ll [20] LATIN SMALL LETTER ESH WITH DOUBLE BAR..LATIN SMALL LETTER S WITH CURL + {0x1DF25, 0x1DF2A, prN}, // Ll [6] LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK {0x1E000, 0x1E006, prN}, // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE {0x1E008, 0x1E018, prN}, // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU {0x1E01B, 0x1E021, prN}, // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI {0x1E023, 0x1E024, prN}, // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS {0x1E026, 0x1E02A, prN}, // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + {0x1E030, 0x1E06D, prN}, // Lm [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE + {0x1E08F, 0x1E08F, prN}, // Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I {0x1E100, 0x1E12C, prN}, // Lo [45] NYIAKENG PUACHUE HMONG LETTER MA..NYIAKENG PUACHUE HMONG LETTER W {0x1E130, 0x1E136, prN}, // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D {0x1E137, 0x1E13D, prN}, // Lm [7] NYIAKENG PUACHUE HMONG SIGN FOR PERSON..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER @@ -2370,6 +2397,10 @@ var eastAsianWidth = [][3]int{ {0x1E2EC, 0x1E2EF, prN}, // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI {0x1E2F0, 0x1E2F9, prN}, // Nd [10] WANCHO DIGIT ZERO..WANCHO DIGIT NINE {0x1E2FF, 0x1E2FF, prN}, // Sc WANCHO NGUN SIGN + {0x1E4D0, 0x1E4EA, prN}, // Lo [27] NAG MUNDARI LETTER O..NAG MUNDARI LETTER ELL + {0x1E4EB, 0x1E4EB, prN}, // Lm NAG MUNDARI SIGN OJOD + {0x1E4EC, 0x1E4EF, prN}, // Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH + {0x1E4F0, 0x1E4F9, prN}, // Nd [10] NAG MUNDARI DIGIT ZERO..NAG MUNDARI DIGIT NINE {0x1E7E0, 0x1E7E6, prN}, // Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO {0x1E7E8, 0x1E7EB, prN}, // Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE {0x1E7ED, 0x1E7EE, prN}, // Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -2498,13 +2529,14 @@ var eastAsianWidth = [][3]int{ {0x1F6D0, 0x1F6D2, prW}, // So [3] PLACE OF WORSHIP..SHOPPING TROLLEY {0x1F6D3, 0x1F6D4, prN}, // So [2] STUPA..PAGODA {0x1F6D5, 0x1F6D7, prW}, // So [3] HINDU TEMPLE..ELEVATOR - {0x1F6DD, 0x1F6DF, prW}, // So [3] PLAYGROUND SLIDE..RING BUOY + {0x1F6DC, 0x1F6DF, prW}, // So [4] WIRELESS..RING BUOY {0x1F6E0, 0x1F6EA, prN}, // So [11] HAMMER AND WRENCH..NORTHEAST-POINTING AIRPLANE {0x1F6EB, 0x1F6EC, prW}, // So [2] AIRPLANE DEPARTURE..AIRPLANE ARRIVING {0x1F6F0, 0x1F6F3, prN}, // So [4] SATELLITE..PASSENGER SHIP {0x1F6F4, 0x1F6FC, prW}, // So [9] SCOOTER..ROLLER SKATE - {0x1F700, 0x1F773, prN}, // So [116] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE - {0x1F780, 0x1F7D8, prN}, // So [89] BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE..NEGATIVE CIRCLED SQUARE + {0x1F700, 0x1F776, prN}, // So [119] ALCHEMICAL SYMBOL FOR QUINTESSENCE..LUNAR ECLIPSE + {0x1F77B, 0x1F77F, prN}, // So [5] HAUMEA..ORCUS + {0x1F780, 0x1F7D9, prN}, // So [90] BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE..NINE POINTED WHITE STAR {0x1F7E0, 0x1F7EB, prW}, // So [12] LARGE ORANGE CIRCLE..LARGE BROWN SQUARE {0x1F7F0, 0x1F7F0, prW}, // So HEAVY EQUALS SIGN {0x1F800, 0x1F80B, prN}, // So [12] LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD..DOWNWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD @@ -2521,22 +2553,20 @@ var eastAsianWidth = [][3]int{ {0x1F947, 0x1F9FF, prW}, // So [185] FIRST PLACE MEDAL..NAZAR AMULET {0x1FA00, 0x1FA53, prN}, // So [84] NEUTRAL CHESS KING..BLACK CHESS KNIGHT-BISHOP {0x1FA60, 0x1FA6D, prN}, // So [14] XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER - {0x1FA70, 0x1FA74, prW}, // So [5] BALLET SHOES..THONG SANDAL - {0x1FA78, 0x1FA7C, prW}, // So [5] DROP OF BLOOD..CRUTCH - {0x1FA80, 0x1FA86, prW}, // So [7] YO-YO..NESTING DOLLS - {0x1FA90, 0x1FAAC, prW}, // So [29] RINGED PLANET..HAMSA - {0x1FAB0, 0x1FABA, prW}, // So [11] FLY..NEST WITH EGGS - {0x1FAC0, 0x1FAC5, prW}, // So [6] ANATOMICAL HEART..PERSON WITH CROWN - {0x1FAD0, 0x1FAD9, prW}, // So [10] BLUEBERRIES..JAR - {0x1FAE0, 0x1FAE7, prW}, // So [8] MELTING FACE..BUBBLES - {0x1FAF0, 0x1FAF6, prW}, // So [7] HAND WITH INDEX FINGER AND THUMB CROSSED..HEART HANDS + {0x1FA70, 0x1FA7C, prW}, // So [13] BALLET SHOES..CRUTCH + {0x1FA80, 0x1FA88, prW}, // So [9] YO-YO..FLUTE + {0x1FA90, 0x1FABD, prW}, // So [46] RINGED PLANET..WING + {0x1FABF, 0x1FAC5, prW}, // So [7] GOOSE..PERSON WITH CROWN + {0x1FACE, 0x1FADB, prW}, // So [14] MOOSE..PEA POD + {0x1FAE0, 0x1FAE8, prW}, // So [9] MELTING FACE..SHAKING FACE + {0x1FAF0, 0x1FAF8, prW}, // So [9] HAND WITH INDEX FINGER AND THUMB CROSSED..RIGHTWARDS PUSHING HAND {0x1FB00, 0x1FB92, prN}, // So [147] BLOCK SEXTANT-1..UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK {0x1FB94, 0x1FBCA, prN}, // So [55] LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK..WHITE UP-POINTING CHEVRON {0x1FBF0, 0x1FBF9, prN}, // Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE {0x20000, 0x2A6DF, prW}, // Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF {0x2A6E0, 0x2A6FF, prW}, // Cn [32] .. - {0x2A700, 0x2B738, prW}, // Lo [4153] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B738 - {0x2B739, 0x2B73F, prW}, // Cn [7] .. + {0x2A700, 0x2B739, prW}, // Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 + {0x2B73A, 0x2B73F, prW}, // Cn [6] .. {0x2B740, 0x2B81D, prW}, // Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D {0x2B81E, 0x2B81F, prW}, // Cn [2] .. {0x2B820, 0x2CEA1, prW}, // Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 @@ -2547,7 +2577,9 @@ var eastAsianWidth = [][3]int{ {0x2FA1E, 0x2FA1F, prW}, // Cn [2] .. {0x2FA20, 0x2FFFD, prW}, // Cn [1502] .. {0x30000, 0x3134A, prW}, // Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A - {0x3134B, 0x3FFFD, prW}, // Cn [60595] .. + {0x3134B, 0x3134F, prW}, // Cn [5] .. + {0x31350, 0x323AF, prW}, // Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF + {0x323B0, 0x3FFFD, prW}, // Cn [56398] .. {0xE0001, 0xE0001, prN}, // Cf LANGUAGE TAG {0xE0020, 0xE007F, prN}, // Cf [96] TAG SPACE..CANCEL TAG {0xE0100, 0xE01EF, prA}, // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 diff --git a/vendor/github.com/rivo/uniseg/emojipresentation.go b/vendor/github.com/rivo/uniseg/emojipresentation.go index fd0f7451af..9b5f499c4a 100644 --- a/vendor/github.com/rivo/uniseg/emojipresentation.go +++ b/vendor/github.com/rivo/uniseg/emojipresentation.go @@ -1,13 +1,13 @@ -package uniseg - // Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg + // emojiPresentation are taken from // // and -// https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt +// https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt // ("Extended_Pictographic" only) -// on September 10, 2022. See https://www.unicode.org/license.html for the Unicode +// on September 5, 2023. See https://www.unicode.org/license.html for the Unicode // license agreement. var emojiPresentation = [][3]int{ {0x231A, 0x231B, prEmojiPresentation}, // E0.6 [2] (⌚..⌛) watch..hourglass done @@ -211,6 +211,7 @@ var emojiPresentation = [][3]int{ {0x1F6D1, 0x1F6D2, prEmojiPresentation}, // E3.0 [2] (🛑..🛒) stop sign..shopping cart {0x1F6D5, 0x1F6D5, prEmojiPresentation}, // E12.0 [1] (🛕) hindu temple {0x1F6D6, 0x1F6D7, prEmojiPresentation}, // E13.0 [2] (🛖..🛗) hut..elevator + {0x1F6DC, 0x1F6DC, prEmojiPresentation}, // E15.0 [1] (🛜) wireless {0x1F6DD, 0x1F6DF, prEmojiPresentation}, // E14.0 [3] (ðŸ›..🛟) playground slide..ring buoy {0x1F6EB, 0x1F6EC, prEmojiPresentation}, // E1.0 [2] (🛫..🛬) airplane departure..airplane arrival {0x1F6F4, 0x1F6F6, prEmojiPresentation}, // E3.0 [3] (🛴..🛶) kick scooter..canoe @@ -267,19 +268,28 @@ var emojiPresentation = [][3]int{ {0x1F9E7, 0x1F9FF, prEmojiPresentation}, // E11.0 [25] (🧧..🧿) red envelope..nazar amulet {0x1FA70, 0x1FA73, prEmojiPresentation}, // E12.0 [4] (🩰..🩳) ballet shoes..shorts {0x1FA74, 0x1FA74, prEmojiPresentation}, // E13.0 [1] (🩴) thong sandal + {0x1FA75, 0x1FA77, prEmojiPresentation}, // E15.0 [3] (🩵..🩷) light blue heart..pink heart {0x1FA78, 0x1FA7A, prEmojiPresentation}, // E12.0 [3] (🩸..🩺) drop of blood..stethoscope {0x1FA7B, 0x1FA7C, prEmojiPresentation}, // E14.0 [2] (🩻..🩼) x-ray..crutch {0x1FA80, 0x1FA82, prEmojiPresentation}, // E12.0 [3] (🪀..🪂) yo-yo..parachute {0x1FA83, 0x1FA86, prEmojiPresentation}, // E13.0 [4] (🪃..🪆) boomerang..nesting dolls + {0x1FA87, 0x1FA88, prEmojiPresentation}, // E15.0 [2] (🪇..🪈) maracas..flute {0x1FA90, 0x1FA95, prEmojiPresentation}, // E12.0 [6] (ðŸª..🪕) ringed planet..banjo {0x1FA96, 0x1FAA8, prEmojiPresentation}, // E13.0 [19] (🪖..🪨) military helmet..rock {0x1FAA9, 0x1FAAC, prEmojiPresentation}, // E14.0 [4] (🪩..🪬) mirror ball..hamsa + {0x1FAAD, 0x1FAAF, prEmojiPresentation}, // E15.0 [3] (🪭..🪯) folding hand fan..khanda {0x1FAB0, 0x1FAB6, prEmojiPresentation}, // E13.0 [7] (🪰..🪶) fly..feather {0x1FAB7, 0x1FABA, prEmojiPresentation}, // E14.0 [4] (🪷..🪺) lotus..nest with eggs + {0x1FABB, 0x1FABD, prEmojiPresentation}, // E15.0 [3] (🪻..🪽) hyacinth..wing + {0x1FABF, 0x1FABF, prEmojiPresentation}, // E15.0 [1] (🪿) goose {0x1FAC0, 0x1FAC2, prEmojiPresentation}, // E13.0 [3] (🫀..🫂) anatomical heart..people hugging {0x1FAC3, 0x1FAC5, prEmojiPresentation}, // E14.0 [3] (🫃..🫅) pregnant man..person with crown + {0x1FACE, 0x1FACF, prEmojiPresentation}, // E15.0 [2] (🫎..ðŸ«) moose..donkey {0x1FAD0, 0x1FAD6, prEmojiPresentation}, // E13.0 [7] (ðŸ«..🫖) blueberries..teapot {0x1FAD7, 0x1FAD9, prEmojiPresentation}, // E14.0 [3] (🫗..🫙) pouring liquid..jar + {0x1FADA, 0x1FADB, prEmojiPresentation}, // E15.0 [2] (🫚..🫛) ginger root..pea pod {0x1FAE0, 0x1FAE7, prEmojiPresentation}, // E14.0 [8] (🫠..🫧) melting face..bubbles + {0x1FAE8, 0x1FAE8, prEmojiPresentation}, // E15.0 [1] (🫨) shaking face {0x1FAF0, 0x1FAF6, prEmojiPresentation}, // E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands + {0x1FAF7, 0x1FAF8, prEmojiPresentation}, // E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand } diff --git a/vendor/github.com/rivo/uniseg/gen_breaktest.go b/vendor/github.com/rivo/uniseg/gen_breaktest.go index e613c4cd00..6bfbeb5e7f 100644 --- a/vendor/github.com/rivo/uniseg/gen_breaktest.go +++ b/vendor/github.com/rivo/uniseg/gen_breaktest.go @@ -32,7 +32,7 @@ import ( // We want to test against a specific version rather than the latest. When the // package is upgraded to a new version, change these to generate new tests. const ( - testCaseURL = `https://www.unicode.org/Public/14.0.0/ucd/auxiliary/%s.txt` + testCaseURL = `https://www.unicode.org/Public/15.0.0/ucd/auxiliary/%s.txt` ) func main() { @@ -76,9 +76,9 @@ func parse(url string) ([]byte, error) { buf := new(bytes.Buffer) buf.Grow(120 << 10) - buf.WriteString(`package uniseg + buf.WriteString(`// Code generated via go generate from gen_breaktest.go. DO NOT EDIT. -// Code generated via go generate from gen_breaktest.go. DO NOT EDIT. +package uniseg // ` + os.Args[3] + ` are Grapheme testcases taken from // ` + url + ` @@ -136,7 +136,9 @@ var ( // // E.g. for the input b="÷ 0020 × 0308 ÷ 1F1E6 ÷" // it will append -// "\u0020\u0308\U0001F1E6" +// +// "\u0020\u0308\U0001F1E6" +// // and "[][]rune{{0x0020,0x0308},{0x1F1E6},}" // to orig and exp respectively. // diff --git a/vendor/github.com/rivo/uniseg/gen_properties.go b/vendor/github.com/rivo/uniseg/gen_properties.go index 999d5efddf..8992d2c5f8 100644 --- a/vendor/github.com/rivo/uniseg/gen_properties.go +++ b/vendor/github.com/rivo/uniseg/gen_properties.go @@ -41,8 +41,8 @@ import ( // We want to test against a specific version rather than the latest. When the // package is upgraded to a new version, change these to generate new tests. const ( - propertyURL = `https://www.unicode.org/Public/14.0.0/ucd/%s.txt` - emojiURL = `https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt` + propertyURL = `https://www.unicode.org/Public/15.0.0/ucd/%s.txt` + emojiURL = `https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt` ) // The regular expression for a line containing a code point range property. @@ -178,6 +178,11 @@ func parse(propertyURL, emojiProperty string, includeGeneralCategory bool) (stri } } + // Avoid overflow during binary search. + if len(properties) >= 1<<31 { + return "", errors.New("too many properties") + } + // Sort properties. sort.Slice(properties, func(i, j int) bool { left, _ := strconv.ParseUint(properties[i][0], 16, 64) @@ -200,9 +205,9 @@ func parse(propertyURL, emojiProperty string, includeGeneralCategory bool) (stri // ` + emojiURL + ` // ("Extended_Pictographic" only)` } - buf.WriteString(`package uniseg + buf.WriteString(`// Code generated via go generate from gen_properties.go. DO NOT EDIT. -// Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg // ` + os.Args[3] + ` are taken from // ` + propertyURL + emojiComment + ` diff --git a/vendor/github.com/rivo/uniseg/grapheme.go b/vendor/github.com/rivo/uniseg/grapheme.go index 0086fc1b20..b12403d43c 100644 --- a/vendor/github.com/rivo/uniseg/grapheme.go +++ b/vendor/github.com/rivo/uniseg/grapheme.go @@ -13,9 +13,10 @@ import "unicode/utf8" // well as boundary information and character width is available via the various // methods (see examples below). // -// Using this class to iterate over a string is convenient but it is much slower -// than using this package's [Step] or [StepString] functions or any of the -// other specialized functions starting with "First". +// This class basically wraps the [StepString] parser and provides a convenient +// interface to it. If you are only interested in some parts of this package's +// functionality, using the specialized functions starting with "First" is +// almost always faster. type Graphemes struct { // The original string. original string @@ -222,7 +223,7 @@ func FirstGraphemeCluster(b []byte, state int) (cluster, rest []byte, width, new if len(b) <= length { // If we're already past the end, there is nothing else to parse. var prop int if state < 0 { - prop = property(graphemeCodePoints, r) + prop = propertyGraphemes(r) } else { prop = state >> shiftGraphemePropState } @@ -252,16 +253,14 @@ func FirstGraphemeCluster(b []byte, state int) (cluster, rest []byte, width, new return b[:length], b[length:], width, state | (prop << shiftGraphemePropState) } - if r == vs16 { - width = 2 - } else if firstProp != prExtendedPictographic && firstProp != prRegionalIndicator && firstProp != prL { - width += runeWidth(r, prop) - } else if firstProp == prExtendedPictographic { + if firstProp == prExtendedPictographic { if r == vs15 { width = 1 - } else { + } else if r == vs16 { width = 2 } + } else if firstProp != prRegionalIndicator && firstProp != prL { + width += runeWidth(r, prop) } length += l @@ -284,7 +283,7 @@ func FirstGraphemeClusterInString(str string, state int) (cluster, rest string, if len(str) <= length { // If we're already past the end, there is nothing else to parse. var prop int if state < 0 { - prop = property(graphemeCodePoints, r) + prop = propertyGraphemes(r) } else { prop = state >> shiftGraphemePropState } @@ -314,16 +313,14 @@ func FirstGraphemeClusterInString(str string, state int) (cluster, rest string, return str[:length], str[length:], width, state | (prop << shiftGraphemePropState) } - if r == vs16 { - width = 2 - } else if firstProp != prExtendedPictographic && firstProp != prRegionalIndicator && firstProp != prL { - width += runeWidth(r, prop) - } else if firstProp == prExtendedPictographic { + if firstProp == prExtendedPictographic { if r == vs15 { width = 1 - } else { + } else if r == vs16 { width = 2 } + } else if firstProp != prRegionalIndicator && firstProp != prL { + width += runeWidth(r, prop) } length += l diff --git a/vendor/github.com/rivo/uniseg/graphemeproperties.go b/vendor/github.com/rivo/uniseg/graphemeproperties.go index a87d140bf2..0aff4a619a 100644 --- a/vendor/github.com/rivo/uniseg/graphemeproperties.go +++ b/vendor/github.com/rivo/uniseg/graphemeproperties.go @@ -1,13 +1,13 @@ -package uniseg - // Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg + // graphemeCodePoints are taken from -// https://www.unicode.org/Public/14.0.0/ucd/auxiliary/GraphemeBreakProperty.txt +// https://www.unicode.org/Public/15.0.0/ucd/auxiliary/GraphemeBreakProperty.txt // and -// https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt +// https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt // ("Extended_Pictographic" only) -// on September 10, 2022. See https://www.unicode.org/license.html for the Unicode +// on September 5, 2023. See https://www.unicode.org/license.html for the Unicode // license agreement. var graphemeCodePoints = [][3]int{ {0x0000, 0x0009, prControl}, // Cc [10] .. @@ -143,6 +143,7 @@ var graphemeCodePoints = [][3]int{ {0x0CCC, 0x0CCD, prExtend}, // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA {0x0CD5, 0x0CD6, prExtend}, // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK {0x0CE2, 0x0CE3, prExtend}, // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + {0x0CF3, 0x0CF3, prSpacingMark}, // Mc KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT {0x0D00, 0x0D01, prExtend}, // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU {0x0D02, 0x0D03, prSpacingMark}, // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA {0x0D3B, 0x0D3C, prExtend}, // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA @@ -172,7 +173,7 @@ var graphemeCodePoints = [][3]int{ {0x0EB1, 0x0EB1, prExtend}, // Mn LAO VOWEL SIGN MAI KAN {0x0EB3, 0x0EB3, prSpacingMark}, // Lo LAO VOWEL SIGN AM {0x0EB4, 0x0EBC, prExtend}, // Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO - {0x0EC8, 0x0ECD, prExtend}, // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + {0x0EC8, 0x0ECE, prExtend}, // Mn [7] LAO TONE MAI EK..LAO YAMAKKAN {0x0F18, 0x0F19, prExtend}, // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS {0x0F35, 0x0F35, prExtend}, // Mn TIBETAN MARK NGAS BZUNG NYI ZLA {0x0F37, 0x0F37, prExtend}, // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS @@ -1336,6 +1337,7 @@ var graphemeCodePoints = [][3]int{ {0x10AE5, 0x10AE6, prExtend}, // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW {0x10D24, 0x10D27, prExtend}, // Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI {0x10EAB, 0x10EAC, prExtend}, // Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK + {0x10EFD, 0x10EFF, prExtend}, // Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA {0x10F46, 0x10F50, prExtend}, // Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW {0x10F82, 0x10F85, prExtend}, // Mn [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW {0x11000, 0x11000, prSpacingMark}, // Mc BRAHMI SIGN CANDRABINDU @@ -1375,6 +1377,7 @@ var graphemeCodePoints = [][3]int{ {0x11235, 0x11235, prSpacingMark}, // Mc KHOJKI SIGN VIRAMA {0x11236, 0x11237, prExtend}, // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA {0x1123E, 0x1123E, prExtend}, // Mn KHOJKI SIGN SUKUN + {0x11241, 0x11241, prExtend}, // Mn KHOJKI VOWEL SIGN VOCALIC R {0x112DF, 0x112DF, prExtend}, // Mn KHUDAWADI SIGN ANUSVARA {0x112E0, 0x112E2, prSpacingMark}, // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II {0x112E3, 0x112EA, prExtend}, // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA @@ -1494,7 +1497,18 @@ var graphemeCodePoints = [][3]int{ {0x11D97, 0x11D97, prExtend}, // Mn GUNJALA GONDI VIRAMA {0x11EF3, 0x11EF4, prExtend}, // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U {0x11EF5, 0x11EF6, prSpacingMark}, // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O - {0x13430, 0x13438, prControl}, // Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT + {0x11F00, 0x11F01, prExtend}, // Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA + {0x11F02, 0x11F02, prPrepend}, // Lo KAWI SIGN REPHA + {0x11F03, 0x11F03, prSpacingMark}, // Mc KAWI SIGN VISARGA + {0x11F34, 0x11F35, prSpacingMark}, // Mc [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA + {0x11F36, 0x11F3A, prExtend}, // Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R + {0x11F3E, 0x11F3F, prSpacingMark}, // Mc [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI + {0x11F40, 0x11F40, prExtend}, // Mn KAWI VOWEL SIGN EU + {0x11F41, 0x11F41, prSpacingMark}, // Mc KAWI SIGN KILLER + {0x11F42, 0x11F42, prExtend}, // Mn KAWI CONJOINER + {0x13430, 0x1343F, prControl}, // Cf [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE + {0x13440, 0x13440, prExtend}, // Mn EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY + {0x13447, 0x13455, prExtend}, // Mn [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED {0x16AF0, 0x16AF4, prExtend}, // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE {0x16B30, 0x16B36, prExtend}, // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM {0x16F4F, 0x16F4F, prExtend}, // Mn MIAO SIGN CONSONANT MODIFIER BAR @@ -1527,9 +1541,11 @@ var graphemeCodePoints = [][3]int{ {0x1E01B, 0x1E021, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI {0x1E023, 0x1E024, prExtend}, // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS {0x1E026, 0x1E02A, prExtend}, // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + {0x1E08F, 0x1E08F, prExtend}, // Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I {0x1E130, 0x1E136, prExtend}, // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D {0x1E2AE, 0x1E2AE, prExtend}, // Mn TOTO SIGN RISING TONE {0x1E2EC, 0x1E2EF, prExtend}, // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI + {0x1E4EC, 0x1E4EF, prExtend}, // Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH {0x1E8D0, 0x1E8D6, prExtend}, // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS {0x1E944, 0x1E94A, prExtend}, // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA {0x1F000, 0x1F003, prExtendedPictographic}, // E0.0 [4] (🀀..🀃) MAHJONG TILE EAST WIND..MAHJONG TILE NORTH WIND @@ -1780,7 +1796,8 @@ var graphemeCodePoints = [][3]int{ {0x1F6D3, 0x1F6D4, prExtendedPictographic}, // E0.0 [2] (🛓..🛔) STUPA..PAGODA {0x1F6D5, 0x1F6D5, prExtendedPictographic}, // E12.0 [1] (🛕) hindu temple {0x1F6D6, 0x1F6D7, prExtendedPictographic}, // E13.0 [2] (🛖..🛗) hut..elevator - {0x1F6D8, 0x1F6DC, prExtendedPictographic}, // E0.0 [5] (🛘..🛜) .. + {0x1F6D8, 0x1F6DB, prExtendedPictographic}, // E0.0 [4] (🛘..🛛) .. + {0x1F6DC, 0x1F6DC, prExtendedPictographic}, // E15.0 [1] (🛜) wireless {0x1F6DD, 0x1F6DF, prExtendedPictographic}, // E14.0 [3] (ðŸ›..🛟) playground slide..ring buoy {0x1F6E0, 0x1F6E5, prExtendedPictographic}, // E0.7 [6] (🛠ï¸..🛥ï¸) hammer and wrench..motor boat {0x1F6E6, 0x1F6E8, prExtendedPictographic}, // E0.0 [3] (🛦..🛨) UP-POINTING MILITARY AIRPLANE..UP-POINTING SMALL AIRPLANE @@ -1797,7 +1814,7 @@ var graphemeCodePoints = [][3]int{ {0x1F6FA, 0x1F6FA, prExtendedPictographic}, // E12.0 [1] (🛺) auto rickshaw {0x1F6FB, 0x1F6FC, prExtendedPictographic}, // E13.0 [2] (🛻..🛼) pickup truck..roller skate {0x1F6FD, 0x1F6FF, prExtendedPictographic}, // E0.0 [3] (🛽..🛿) .. - {0x1F774, 0x1F77F, prExtendedPictographic}, // E0.0 [12] (ðŸ´..ðŸ¿) .. + {0x1F774, 0x1F77F, prExtendedPictographic}, // E0.0 [12] (ðŸ´..ðŸ¿) LOT OF FORTUNE..ORCUS {0x1F7D5, 0x1F7DF, prExtendedPictographic}, // E0.0 [11] (🟕..🟟) CIRCLED TRIANGLE.. {0x1F7E0, 0x1F7EB, prExtendedPictographic}, // E12.0 [12] (🟠..🟫) orange circle..brown square {0x1F7EC, 0x1F7EF, prExtendedPictographic}, // E0.0 [4] (🟬..🟯) .. @@ -1856,30 +1873,37 @@ var graphemeCodePoints = [][3]int{ {0x1FA00, 0x1FA6F, prExtendedPictographic}, // E0.0 [112] (🨀..🩯) NEUTRAL CHESS KING.. {0x1FA70, 0x1FA73, prExtendedPictographic}, // E12.0 [4] (🩰..🩳) ballet shoes..shorts {0x1FA74, 0x1FA74, prExtendedPictographic}, // E13.0 [1] (🩴) thong sandal - {0x1FA75, 0x1FA77, prExtendedPictographic}, // E0.0 [3] (🩵..🩷) .. + {0x1FA75, 0x1FA77, prExtendedPictographic}, // E15.0 [3] (🩵..🩷) light blue heart..pink heart {0x1FA78, 0x1FA7A, prExtendedPictographic}, // E12.0 [3] (🩸..🩺) drop of blood..stethoscope {0x1FA7B, 0x1FA7C, prExtendedPictographic}, // E14.0 [2] (🩻..🩼) x-ray..crutch {0x1FA7D, 0x1FA7F, prExtendedPictographic}, // E0.0 [3] (🩽..🩿) .. {0x1FA80, 0x1FA82, prExtendedPictographic}, // E12.0 [3] (🪀..🪂) yo-yo..parachute {0x1FA83, 0x1FA86, prExtendedPictographic}, // E13.0 [4] (🪃..🪆) boomerang..nesting dolls - {0x1FA87, 0x1FA8F, prExtendedPictographic}, // E0.0 [9] (🪇..ðŸª) .. + {0x1FA87, 0x1FA88, prExtendedPictographic}, // E15.0 [2] (🪇..🪈) maracas..flute + {0x1FA89, 0x1FA8F, prExtendedPictographic}, // E0.0 [7] (🪉..ðŸª) .. {0x1FA90, 0x1FA95, prExtendedPictographic}, // E12.0 [6] (ðŸª..🪕) ringed planet..banjo {0x1FA96, 0x1FAA8, prExtendedPictographic}, // E13.0 [19] (🪖..🪨) military helmet..rock {0x1FAA9, 0x1FAAC, prExtendedPictographic}, // E14.0 [4] (🪩..🪬) mirror ball..hamsa - {0x1FAAD, 0x1FAAF, prExtendedPictographic}, // E0.0 [3] (🪭..🪯) .. + {0x1FAAD, 0x1FAAF, prExtendedPictographic}, // E15.0 [3] (🪭..🪯) folding hand fan..khanda {0x1FAB0, 0x1FAB6, prExtendedPictographic}, // E13.0 [7] (🪰..🪶) fly..feather {0x1FAB7, 0x1FABA, prExtendedPictographic}, // E14.0 [4] (🪷..🪺) lotus..nest with eggs - {0x1FABB, 0x1FABF, prExtendedPictographic}, // E0.0 [5] (🪻..🪿) .. + {0x1FABB, 0x1FABD, prExtendedPictographic}, // E15.0 [3] (🪻..🪽) hyacinth..wing + {0x1FABE, 0x1FABE, prExtendedPictographic}, // E0.0 [1] (🪾) + {0x1FABF, 0x1FABF, prExtendedPictographic}, // E15.0 [1] (🪿) goose {0x1FAC0, 0x1FAC2, prExtendedPictographic}, // E13.0 [3] (🫀..🫂) anatomical heart..people hugging {0x1FAC3, 0x1FAC5, prExtendedPictographic}, // E14.0 [3] (🫃..🫅) pregnant man..person with crown - {0x1FAC6, 0x1FACF, prExtendedPictographic}, // E0.0 [10] (🫆..ðŸ«) .. + {0x1FAC6, 0x1FACD, prExtendedPictographic}, // E0.0 [8] (🫆..ðŸ«) .. + {0x1FACE, 0x1FACF, prExtendedPictographic}, // E15.0 [2] (🫎..ðŸ«) moose..donkey {0x1FAD0, 0x1FAD6, prExtendedPictographic}, // E13.0 [7] (ðŸ«..🫖) blueberries..teapot {0x1FAD7, 0x1FAD9, prExtendedPictographic}, // E14.0 [3] (🫗..🫙) pouring liquid..jar - {0x1FADA, 0x1FADF, prExtendedPictographic}, // E0.0 [6] (🫚..🫟) .. + {0x1FADA, 0x1FADB, prExtendedPictographic}, // E15.0 [2] (🫚..🫛) ginger root..pea pod + {0x1FADC, 0x1FADF, prExtendedPictographic}, // E0.0 [4] (🫜..🫟) .. {0x1FAE0, 0x1FAE7, prExtendedPictographic}, // E14.0 [8] (🫠..🫧) melting face..bubbles - {0x1FAE8, 0x1FAEF, prExtendedPictographic}, // E0.0 [8] (🫨..🫯) .. + {0x1FAE8, 0x1FAE8, prExtendedPictographic}, // E15.0 [1] (🫨) shaking face + {0x1FAE9, 0x1FAEF, prExtendedPictographic}, // E0.0 [7] (🫩..🫯) .. {0x1FAF0, 0x1FAF6, prExtendedPictographic}, // E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands - {0x1FAF7, 0x1FAFF, prExtendedPictographic}, // E0.0 [9] (🫷..🫿) .. + {0x1FAF7, 0x1FAF8, prExtendedPictographic}, // E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand + {0x1FAF9, 0x1FAFF, prExtendedPictographic}, // E0.0 [7] (🫹..🫿) .. {0x1FC00, 0x1FFFD, prExtendedPictographic}, // E0.0[1022] (🰀..🿽) .. {0xE0000, 0xE0000, prControl}, // Cn {0xE0001, 0xE0001, prControl}, // Cf LANGUAGE TAG diff --git a/vendor/github.com/rivo/uniseg/graphemerules.go b/vendor/github.com/rivo/uniseg/graphemerules.go index 9f46b575bb..5d399d29c8 100644 --- a/vendor/github.com/rivo/uniseg/graphemerules.go +++ b/vendor/github.com/rivo/uniseg/graphemerules.go @@ -21,11 +21,12 @@ const ( grBoundary ) -// The grapheme cluster parser's state transitions. Maps (state, property) to -// (new state, breaking instruction, rule number). The breaking instruction -// always refers to the boundary between the last and next code point. +// grTransitions implements the grapheme cluster parser's state transitions. +// Maps state and property to a new state, a breaking instruction, and rule +// number. The breaking instruction always refers to the boundary between the +// last and next code point. Returns negative values if no transition is found. // -// This map is queried as follows: +// This function is used as follows: // // 1. Find specific state + specific property. Stop if found. // 2. Find specific state + any property. @@ -36,59 +37,96 @@ const ( // are equal. Stop. // 6. Assume grAny and grBoundary. // -// Unicode version 14.0.0. -var grTransitions = map[[2]int][3]int{ +// Unicode version 15.0.0. +func grTransitions(state, prop int) (newState int, newProp int, boundary int) { + // It turns out that using a big switch statement is much faster than using + // a map. + + switch uint64(state) | uint64(prop)<<32 { // GB5 - {grAny, prCR}: {grCR, grBoundary, 50}, - {grAny, prLF}: {grControlLF, grBoundary, 50}, - {grAny, prControl}: {grControlLF, grBoundary, 50}, + case grAny | prCR<<32: + return grCR, grBoundary, 50 + case grAny | prLF<<32: + return grControlLF, grBoundary, 50 + case grAny | prControl<<32: + return grControlLF, grBoundary, 50 // GB4 - {grCR, prAny}: {grAny, grBoundary, 40}, - {grControlLF, prAny}: {grAny, grBoundary, 40}, - - // GB3. - {grCR, prLF}: {grControlLF, grNoBoundary, 30}, - - // GB6. - {grAny, prL}: {grL, grBoundary, 9990}, - {grL, prL}: {grL, grNoBoundary, 60}, - {grL, prV}: {grLVV, grNoBoundary, 60}, - {grL, prLV}: {grLVV, grNoBoundary, 60}, - {grL, prLVT}: {grLVTT, grNoBoundary, 60}, - - // GB7. - {grAny, prLV}: {grLVV, grBoundary, 9990}, - {grAny, prV}: {grLVV, grBoundary, 9990}, - {grLVV, prV}: {grLVV, grNoBoundary, 70}, - {grLVV, prT}: {grLVTT, grNoBoundary, 70}, - - // GB8. - {grAny, prLVT}: {grLVTT, grBoundary, 9990}, - {grAny, prT}: {grLVTT, grBoundary, 9990}, - {grLVTT, prT}: {grLVTT, grNoBoundary, 80}, - - // GB9. - {grAny, prExtend}: {grAny, grNoBoundary, 90}, - {grAny, prZWJ}: {grAny, grNoBoundary, 90}, - - // GB9a. - {grAny, prSpacingMark}: {grAny, grNoBoundary, 91}, - - // GB9b. - {grAny, prPrepend}: {grPrepend, grBoundary, 9990}, - {grPrepend, prAny}: {grAny, grNoBoundary, 92}, - - // GB11. - {grAny, prExtendedPictographic}: {grExtendedPictographic, grBoundary, 9990}, - {grExtendedPictographic, prExtend}: {grExtendedPictographic, grNoBoundary, 110}, - {grExtendedPictographic, prZWJ}: {grExtendedPictographicZWJ, grNoBoundary, 110}, - {grExtendedPictographicZWJ, prExtendedPictographic}: {grExtendedPictographic, grNoBoundary, 110}, - - // GB12 / GB13. - {grAny, prRegionalIndicator}: {grRIOdd, grBoundary, 9990}, - {grRIOdd, prRegionalIndicator}: {grRIEven, grNoBoundary, 120}, - {grRIEven, prRegionalIndicator}: {grRIOdd, grBoundary, 120}, + case grCR | prAny<<32: + return grAny, grBoundary, 40 + case grControlLF | prAny<<32: + return grAny, grBoundary, 40 + + // GB3 + case grCR | prLF<<32: + return grControlLF, grNoBoundary, 30 + + // GB6 + case grAny | prL<<32: + return grL, grBoundary, 9990 + case grL | prL<<32: + return grL, grNoBoundary, 60 + case grL | prV<<32: + return grLVV, grNoBoundary, 60 + case grL | prLV<<32: + return grLVV, grNoBoundary, 60 + case grL | prLVT<<32: + return grLVTT, grNoBoundary, 60 + + // GB7 + case grAny | prLV<<32: + return grLVV, grBoundary, 9990 + case grAny | prV<<32: + return grLVV, grBoundary, 9990 + case grLVV | prV<<32: + return grLVV, grNoBoundary, 70 + case grLVV | prT<<32: + return grLVTT, grNoBoundary, 70 + + // GB8 + case grAny | prLVT<<32: + return grLVTT, grBoundary, 9990 + case grAny | prT<<32: + return grLVTT, grBoundary, 9990 + case grLVTT | prT<<32: + return grLVTT, grNoBoundary, 80 + + // GB9 + case grAny | prExtend<<32: + return grAny, grNoBoundary, 90 + case grAny | prZWJ<<32: + return grAny, grNoBoundary, 90 + + // GB9a + case grAny | prSpacingMark<<32: + return grAny, grNoBoundary, 91 + + // GB9b + case grAny | prPrepend<<32: + return grPrepend, grBoundary, 9990 + case grPrepend | prAny<<32: + return grAny, grNoBoundary, 92 + + // GB11 + case grAny | prExtendedPictographic<<32: + return grExtendedPictographic, grBoundary, 9990 + case grExtendedPictographic | prExtend<<32: + return grExtendedPictographic, grNoBoundary, 110 + case grExtendedPictographic | prZWJ<<32: + return grExtendedPictographicZWJ, grNoBoundary, 110 + case grExtendedPictographicZWJ | prExtendedPictographic<<32: + return grExtendedPictographic, grNoBoundary, 110 + + // GB12 / GB13 + case grAny | prRegionalIndicator<<32: + return grRIOdd, grBoundary, 9990 + case grRIOdd | prRegionalIndicator<<32: + return grRIEven, grNoBoundary, 120 + case grRIEven | prRegionalIndicator<<32: + return grRIOdd, grBoundary, 120 + default: + return -1, -1, -1 + } } // transitionGraphemeState determines the new state of the grapheme cluster @@ -97,40 +135,40 @@ var grTransitions = map[[2]int][3]int{ // table) and whether a cluster boundary was detected. func transitionGraphemeState(state int, r rune) (newState, prop int, boundary bool) { // Determine the property of the next character. - prop = property(graphemeCodePoints, r) + prop = propertyGraphemes(r) // Find the applicable transition. - transition, ok := grTransitions[[2]int{state, prop}] - if ok { + nextState, nextProp, _ := grTransitions(state, prop) + if nextState >= 0 { // We have a specific transition. We'll use it. - return transition[0], prop, transition[1] == grBoundary + return nextState, prop, nextProp == grBoundary } // No specific transition found. Try the less specific ones. - transAnyProp, okAnyProp := grTransitions[[2]int{state, prAny}] - transAnyState, okAnyState := grTransitions[[2]int{grAny, prop}] - if okAnyProp && okAnyState { + anyPropState, anyPropProp, anyPropRule := grTransitions(state, prAny) + anyStateState, anyStateProp, anyStateRule := grTransitions(grAny, prop) + if anyPropState >= 0 && anyStateState >= 0 { // Both apply. We'll use a mix (see comments for grTransitions). - newState = transAnyState[0] - boundary = transAnyState[1] == grBoundary - if transAnyProp[2] < transAnyState[2] { - boundary = transAnyProp[1] == grBoundary + newState = anyStateState + boundary = anyStateProp == grBoundary + if anyPropRule < anyStateRule { + boundary = anyPropProp == grBoundary } return } - if okAnyProp { + if anyPropState >= 0 { // We only have a specific state. - return transAnyProp[0], prop, transAnyProp[1] == grBoundary + return anyPropState, prop, anyPropProp == grBoundary // This branch will probably never be reached because okAnyState will // always be true given the current transition map. But we keep it here // for future modifications to the transition map where this may not be // true anymore. } - if okAnyState { + if anyStateState >= 0 { // We only have a specific property. - return transAnyState[0], prop, transAnyState[1] == grBoundary + return anyStateState, prop, anyStateProp == grBoundary } // No known transition. GB999: Any ÷ Any. diff --git a/vendor/github.com/rivo/uniseg/line.go b/vendor/github.com/rivo/uniseg/line.go index 87f28503f4..7a46318d93 100644 --- a/vendor/github.com/rivo/uniseg/line.go +++ b/vendor/github.com/rivo/uniseg/line.go @@ -80,7 +80,7 @@ func FirstLineSegment(b []byte, state int) (segment, rest []byte, mustBreak bool } } -// FirstLineSegmentInString is like FirstLineSegment() but its input and outputs +// FirstLineSegmentInString is like [FirstLineSegment] but its input and outputs // are strings. func FirstLineSegmentInString(str string, state int) (segment, rest string, mustBreak bool, newState int) { // An empty byte slice returns nothing. @@ -122,13 +122,13 @@ func FirstLineSegmentInString(str string, state int) (segment, rest string, must // [UAX #14]: https://www.unicode.org/reports/tr14/#Algorithm func HasTrailingLineBreak(b []byte) bool { r, _ := utf8.DecodeLastRune(b) - property, _ := propertyWithGenCat(lineBreakCodePoints, r) - return property == lbBK || property == lbCR || property == lbLF || property == lbNL + property, _ := propertyLineBreak(r) + return property == prBK || property == prCR || property == prLF || property == prNL } // HasTrailingLineBreakInString is like [HasTrailingLineBreak] but for a string. func HasTrailingLineBreakInString(str string) bool { r, _ := utf8.DecodeLastRuneInString(str) - property, _ := propertyWithGenCat(lineBreakCodePoints, r) - return property == lbBK || property == lbCR || property == lbLF || property == lbNL + property, _ := propertyLineBreak(r) + return property == prBK || property == prCR || property == prLF || property == prNL } diff --git a/vendor/github.com/rivo/uniseg/lineproperties.go b/vendor/github.com/rivo/uniseg/lineproperties.go index 32169306e8..ac7fac4c05 100644 --- a/vendor/github.com/rivo/uniseg/lineproperties.go +++ b/vendor/github.com/rivo/uniseg/lineproperties.go @@ -1,13 +1,13 @@ -package uniseg - // Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg + // lineBreakCodePoints are taken from -// https://www.unicode.org/Public/14.0.0/ucd/LineBreak.txt +// https://www.unicode.org/Public/15.0.0/ucd/LineBreak.txt // and -// https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt +// https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt // ("Extended_Pictographic" only) -// on September 10, 2022. See https://www.unicode.org/license.html for the Unicode +// on September 5, 2023. See https://www.unicode.org/license.html for the Unicode // license agreement. var lineBreakCodePoints = [][4]int{ {0x0000, 0x0008, prCM, gcCc}, // [9] .. @@ -439,6 +439,7 @@ var lineBreakCodePoints = [][4]int{ {0x0CE2, 0x0CE3, prCM, gcMn}, // [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL {0x0CE6, 0x0CEF, prNU, gcNd}, // [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE {0x0CF1, 0x0CF2, prAL, gcLo}, // [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA + {0x0CF3, 0x0CF3, prCM, gcMc}, // KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT {0x0D00, 0x0D01, prCM, gcMn}, // [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU {0x0D02, 0x0D03, prCM, gcMc}, // [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA {0x0D04, 0x0D0C, prAL, gcLo}, // [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -500,7 +501,7 @@ var lineBreakCodePoints = [][4]int{ {0x0EBD, 0x0EBD, prSA, gcLo}, // LAO SEMIVOWEL SIGN NYO {0x0EC0, 0x0EC4, prSA, gcLo}, // [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI {0x0EC6, 0x0EC6, prSA, gcLm}, // LAO KO LA - {0x0EC8, 0x0ECD, prSA, gcMn}, // [6] LAO TONE MAI EK..LAO NIGGAHITA + {0x0EC8, 0x0ECE, prSA, gcMn}, // [7] LAO TONE MAI EK..LAO YAMAKKAN {0x0ED0, 0x0ED9, prNU, gcNd}, // [10] LAO DIGIT ZERO..LAO DIGIT NINE {0x0EDC, 0x0EDF, prSA, gcLo}, // [4] LAO HO NO..LAO LETTER KHMU NYO {0x0F00, 0x0F00, prAL, gcLo}, // TIBETAN SYLLABLE OM @@ -813,7 +814,11 @@ var lineBreakCodePoints = [][4]int{ {0x1D79, 0x1D7F, prAL, gcLl}, // [7] LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER UPSILON WITH STROKE {0x1D80, 0x1D9A, prAL, gcLl}, // [27] LATIN SMALL LETTER B WITH PALATAL HOOK..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK {0x1D9B, 0x1DBF, prAL, gcLm}, // [37] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL THETA - {0x1DC0, 0x1DFF, prCM, gcMn}, // [64] COMBINING DOTTED GRAVE ACCENT..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + {0x1DC0, 0x1DCC, prCM, gcMn}, // [13] COMBINING DOTTED GRAVE ACCENT..COMBINING MACRON-BREVE + {0x1DCD, 0x1DCD, prGL, gcMn}, // COMBINING DOUBLE CIRCUMFLEX ABOVE + {0x1DCE, 0x1DFB, prCM, gcMn}, // [46] COMBINING OGONEK ABOVE..COMBINING DELETION MARK + {0x1DFC, 0x1DFC, prGL, gcMn}, // COMBINING DOUBLE INVERTED BREVE BELOW + {0x1DFD, 0x1DFF, prCM, gcMn}, // [3] COMBINING ALMOST EQUAL TO BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW {0x1E00, 0x1EFF, prAL, gcLC}, // [256] LATIN CAPITAL LETTER A WITH RING BELOW..LATIN SMALL LETTER Y WITH LOOP {0x1F00, 0x1F15, prAL, gcLC}, // [22] GREEK SMALL LETTER ALPHA WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA {0x1F18, 0x1F1D, prAL, gcLu}, // [6] GREEK CAPITAL LETTER EPSILON WITH PSILI..GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA @@ -889,7 +894,7 @@ var lineBreakCodePoints = [][4]int{ {0x2054, 0x2054, prAL, gcPc}, // INVERTED UNDERTIE {0x2055, 0x2055, prAL, gcPo}, // FLOWER PUNCTUATION MARK {0x2056, 0x2056, prBA, gcPo}, // THREE DOT PUNCTUATION - {0x2057, 0x2057, prAL, gcPo}, // QUADRUPLE PRIME + {0x2057, 0x2057, prPO, gcPo}, // QUADRUPLE PRIME {0x2058, 0x205B, prBA, gcPo}, // [4] FOUR DOT PUNCTUATION..FOUR DOT MARK {0x205C, 0x205C, prAL, gcPo}, // DOTTED CROSS {0x205D, 0x205E, prBA, gcPo}, // [2] TRICOLON..VERTICAL FOUR DOTS @@ -2751,6 +2756,7 @@ var lineBreakCodePoints = [][4]int{ {0x10EAB, 0x10EAC, prCM, gcMn}, // [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK {0x10EAD, 0x10EAD, prBA, gcPd}, // YEZIDI HYPHENATION MARK {0x10EB0, 0x10EB1, prAL, gcLo}, // [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE + {0x10EFD, 0x10EFF, prCM, gcMn}, // [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA {0x10F00, 0x10F1C, prAL, gcLo}, // [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL {0x10F1D, 0x10F26, prAL, gcNo}, // [10] OLD SOGDIAN NUMBER ONE..OLD SOGDIAN FRACTION ONE HALF {0x10F27, 0x10F27, prAL, gcLo}, // OLD SOGDIAN LIGATURE AYIN-DALETH @@ -2840,6 +2846,8 @@ var lineBreakCodePoints = [][4]int{ {0x1123B, 0x1123C, prBA, gcPo}, // [2] KHOJKI SECTION MARK..KHOJKI DOUBLE SECTION MARK {0x1123D, 0x1123D, prAL, gcPo}, // KHOJKI ABBREVIATION SIGN {0x1123E, 0x1123E, prCM, gcMn}, // KHOJKI SIGN SUKUN + {0x1123F, 0x11240, prAL, gcLo}, // [2] KHOJKI LETTER QA..KHOJKI LETTER SHORT I + {0x11241, 0x11241, prCM, gcMn}, // KHOJKI VOWEL SIGN VOCALIC R {0x11280, 0x11286, prAL, gcLo}, // [7] MULTANI LETTER A..MULTANI LETTER GA {0x11288, 0x11288, prAL, gcLo}, // MULTANI LETTER GHA {0x1128A, 0x1128D, prAL, gcLo}, // [4] MULTANI LETTER CA..MULTANI LETTER JJA @@ -3013,6 +3021,7 @@ var lineBreakCodePoints = [][4]int{ {0x11AA1, 0x11AA2, prBA, gcPo}, // [2] SOYOMBO TERMINAL MARK-1..SOYOMBO TERMINAL MARK-2 {0x11AB0, 0x11ABF, prAL, gcLo}, // [16] CANADIAN SYLLABICS NATTILIK HI..CANADIAN SYLLABICS SPA {0x11AC0, 0x11AF8, prAL, gcLo}, // [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL + {0x11B00, 0x11B09, prBB, gcPo}, // [10] DEVANAGARI HEAD MARK..DEVANAGARI SIGN MINDU {0x11C00, 0x11C08, prAL, gcLo}, // [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L {0x11C0A, 0x11C2E, prAL, gcLo}, // [37] BHAIKSUKI LETTER E..BHAIKSUKI LETTER HA {0x11C2F, 0x11C2F, prCM, gcMc}, // BHAIKSUKI VOWEL SIGN AA @@ -3059,6 +3068,20 @@ var lineBreakCodePoints = [][4]int{ {0x11EF3, 0x11EF4, prCM, gcMn}, // [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U {0x11EF5, 0x11EF6, prCM, gcMc}, // [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O {0x11EF7, 0x11EF8, prAL, gcPo}, // [2] MAKASAR PASSIMBANG..MAKASAR END OF SECTION + {0x11F00, 0x11F01, prCM, gcMn}, // [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA + {0x11F02, 0x11F02, prAL, gcLo}, // KAWI SIGN REPHA + {0x11F03, 0x11F03, prCM, gcMc}, // KAWI SIGN VISARGA + {0x11F04, 0x11F10, prAL, gcLo}, // [13] KAWI LETTER A..KAWI LETTER O + {0x11F12, 0x11F33, prAL, gcLo}, // [34] KAWI LETTER KA..KAWI LETTER JNYA + {0x11F34, 0x11F35, prCM, gcMc}, // [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA + {0x11F36, 0x11F3A, prCM, gcMn}, // [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R + {0x11F3E, 0x11F3F, prCM, gcMc}, // [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI + {0x11F40, 0x11F40, prCM, gcMn}, // KAWI VOWEL SIGN EU + {0x11F41, 0x11F41, prCM, gcMc}, // KAWI SIGN KILLER + {0x11F42, 0x11F42, prCM, gcMn}, // KAWI CONJOINER + {0x11F43, 0x11F44, prBA, gcPo}, // [2] KAWI DANDA..KAWI DOUBLE DANDA + {0x11F45, 0x11F4F, prID, gcPo}, // [11] KAWI PUNCTUATION SECTION MARKER..KAWI PUNCTUATION CLOSING SPIRAL + {0x11F50, 0x11F59, prNU, gcNd}, // [10] KAWI DIGIT ZERO..KAWI DIGIT NINE {0x11FB0, 0x11FB0, prAL, gcLo}, // LISU LETTER YHA {0x11FC0, 0x11FD4, prAL, gcNo}, // [21] TAMIL FRACTION ONE THREE-HUNDRED-AND-TWENTIETH..TAMIL FRACTION DOWNSCALING FACTOR KIIZH {0x11FD5, 0x11FDC, prAL, gcSo}, // [8] TAMIL SIGN NEL..TAMIL SIGN MUKKURUNI @@ -3084,10 +3107,18 @@ var lineBreakCodePoints = [][4]int{ {0x1328A, 0x13378, prAL, gcLo}, // [239] EGYPTIAN HIEROGLYPH O037..EGYPTIAN HIEROGLYPH V011 {0x13379, 0x13379, prOP, gcLo}, // EGYPTIAN HIEROGLYPH V011A {0x1337A, 0x1337B, prCL, gcLo}, // [2] EGYPTIAN HIEROGLYPH V011B..EGYPTIAN HIEROGLYPH V011C - {0x1337C, 0x1342E, prAL, gcLo}, // [179] EGYPTIAN HIEROGLYPH V012..EGYPTIAN HIEROGLYPH AA032 + {0x1337C, 0x1342F, prAL, gcLo}, // [180] EGYPTIAN HIEROGLYPH V012..EGYPTIAN HIEROGLYPH V011D {0x13430, 0x13436, prGL, gcCf}, // [7] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH OVERLAY MIDDLE {0x13437, 0x13437, prOP, gcCf}, // EGYPTIAN HIEROGLYPH BEGIN SEGMENT {0x13438, 0x13438, prCL, gcCf}, // EGYPTIAN HIEROGLYPH END SEGMENT + {0x13439, 0x1343B, prGL, gcCf}, // [3] EGYPTIAN HIEROGLYPH INSERT AT MIDDLE..EGYPTIAN HIEROGLYPH INSERT AT BOTTOM + {0x1343C, 0x1343C, prOP, gcCf}, // EGYPTIAN HIEROGLYPH BEGIN ENCLOSURE + {0x1343D, 0x1343D, prCL, gcCf}, // EGYPTIAN HIEROGLYPH END ENCLOSURE + {0x1343E, 0x1343E, prOP, gcCf}, // EGYPTIAN HIEROGLYPH BEGIN WALLED ENCLOSURE + {0x1343F, 0x1343F, prCL, gcCf}, // EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE + {0x13440, 0x13440, prCM, gcMn}, // EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY + {0x13441, 0x13446, prAL, gcLo}, // [6] EGYPTIAN HIEROGLYPH FULL BLANK..EGYPTIAN HIEROGLYPH WIDE LOST SIGN + {0x13447, 0x13455, prCM, gcMn}, // [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED {0x14400, 0x145CD, prAL, gcLo}, // [462] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A409 {0x145CE, 0x145CE, prOP, gcLo}, // ANATOLIAN HIEROGLYPH A410 BEGIN LOGOGRAM MARK {0x145CF, 0x145CF, prCL, gcLo}, // ANATOLIAN HIEROGLYPH A410A END LOGOGRAM MARK @@ -3137,7 +3168,9 @@ var lineBreakCodePoints = [][4]int{ {0x1AFFD, 0x1AFFE, prAL, gcLm}, // [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 {0x1B000, 0x1B0FF, prID, gcLo}, // [256] KATAKANA LETTER ARCHAIC E..HENTAIGANA LETTER RE-2 {0x1B100, 0x1B122, prID, gcLo}, // [35] HENTAIGANA LETTER RE-3..KATAKANA LETTER ARCHAIC WU + {0x1B132, 0x1B132, prCJ, gcLo}, // HIRAGANA LETTER SMALL KO {0x1B150, 0x1B152, prCJ, gcLo}, // [3] HIRAGANA LETTER SMALL WI..HIRAGANA LETTER SMALL WO + {0x1B155, 0x1B155, prCJ, gcLo}, // KATAKANA LETTER SMALL KO {0x1B164, 0x1B167, prCJ, gcLo}, // [4] KATAKANA LETTER SMALL WI..KATAKANA LETTER SMALL N {0x1B170, 0x1B2FB, prID, gcLo}, // [396] NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB {0x1BC00, 0x1BC6A, prAL, gcLo}, // [107] DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M @@ -3168,6 +3201,7 @@ var lineBreakCodePoints = [][4]int{ {0x1D200, 0x1D241, prAL, gcSo}, // [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54 {0x1D242, 0x1D244, prCM, gcMn}, // [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME {0x1D245, 0x1D245, prAL, gcSo}, // GREEK MUSICAL LEIMMA + {0x1D2C0, 0x1D2D3, prAL, gcNo}, // [20] KAKTOVIK NUMERAL ZERO..KAKTOVIK NUMERAL NINETEEN {0x1D2E0, 0x1D2F3, prAL, gcNo}, // [20] MAYAN NUMERAL ZERO..MAYAN NUMERAL NINETEEN {0x1D300, 0x1D356, prAL, gcSo}, // [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING {0x1D360, 0x1D378, prAL, gcNo}, // [25] COUNTING ROD UNIT DIGIT ONE..TALLY MARK FIVE @@ -3228,11 +3262,14 @@ var lineBreakCodePoints = [][4]int{ {0x1DF00, 0x1DF09, prAL, gcLl}, // [10] LATIN SMALL LETTER FENG DIGRAPH WITH TRILL..LATIN SMALL LETTER T WITH HOOK AND RETROFLEX HOOK {0x1DF0A, 0x1DF0A, prAL, gcLo}, // LATIN LETTER RETROFLEX CLICK WITH RETROFLEX HOOK {0x1DF0B, 0x1DF1E, prAL, gcLl}, // [20] LATIN SMALL LETTER ESH WITH DOUBLE BAR..LATIN SMALL LETTER S WITH CURL + {0x1DF25, 0x1DF2A, prAL, gcLl}, // [6] LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK {0x1E000, 0x1E006, prCM, gcMn}, // [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE {0x1E008, 0x1E018, prCM, gcMn}, // [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU {0x1E01B, 0x1E021, prCM, gcMn}, // [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI {0x1E023, 0x1E024, prCM, gcMn}, // [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS {0x1E026, 0x1E02A, prCM, gcMn}, // [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + {0x1E030, 0x1E06D, prAL, gcLm}, // [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE + {0x1E08F, 0x1E08F, prCM, gcMn}, // COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I {0x1E100, 0x1E12C, prAL, gcLo}, // [45] NYIAKENG PUACHUE HMONG LETTER MA..NYIAKENG PUACHUE HMONG LETTER W {0x1E130, 0x1E136, prCM, gcMn}, // [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D {0x1E137, 0x1E13D, prAL, gcLm}, // [7] NYIAKENG PUACHUE HMONG SIGN FOR PERSON..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER @@ -3245,6 +3282,10 @@ var lineBreakCodePoints = [][4]int{ {0x1E2EC, 0x1E2EF, prCM, gcMn}, // [4] WANCHO TONE TUP..WANCHO TONE KOINI {0x1E2F0, 0x1E2F9, prNU, gcNd}, // [10] WANCHO DIGIT ZERO..WANCHO DIGIT NINE {0x1E2FF, 0x1E2FF, prPR, gcSc}, // WANCHO NGUN SIGN + {0x1E4D0, 0x1E4EA, prAL, gcLo}, // [27] NAG MUNDARI LETTER O..NAG MUNDARI LETTER ELL + {0x1E4EB, 0x1E4EB, prAL, gcLm}, // NAG MUNDARI SIGN OJOD + {0x1E4EC, 0x1E4EF, prCM, gcMn}, // [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH + {0x1E4F0, 0x1E4F9, prNU, gcNd}, // [10] NAG MUNDARI DIGIT ZERO..NAG MUNDARI DIGIT NINE {0x1E7E0, 0x1E7E6, prAL, gcLo}, // [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO {0x1E7E8, 0x1E7EB, prAL, gcLo}, // [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE {0x1E7ED, 0x1E7EE, prAL, gcLo}, // [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -3412,16 +3453,18 @@ var lineBreakCodePoints = [][4]int{ {0x1F6C1, 0x1F6CB, prID, gcSo}, // [11] BATHTUB..COUCH AND LAMP {0x1F6CC, 0x1F6CC, prEB, gcSo}, // SLEEPING ACCOMMODATION {0x1F6CD, 0x1F6D7, prID, gcSo}, // [11] SHOPPING BAGS..ELEVATOR - {0x1F6D8, 0x1F6DC, prID, gcCn}, // [5] .. - {0x1F6DD, 0x1F6EC, prID, gcSo}, // [16] PLAYGROUND SLIDE..AIRPLANE ARRIVING + {0x1F6D8, 0x1F6DB, prID, gcCn}, // [4] .. + {0x1F6DC, 0x1F6EC, prID, gcSo}, // [17] WIRELESS..AIRPLANE ARRIVING {0x1F6ED, 0x1F6EF, prID, gcCn}, // [3] .. {0x1F6F0, 0x1F6FC, prID, gcSo}, // [13] SATELLITE..ROLLER SKATE {0x1F6FD, 0x1F6FF, prID, gcCn}, // [3] .. {0x1F700, 0x1F773, prAL, gcSo}, // [116] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE - {0x1F774, 0x1F77F, prID, gcCn}, // [12] .. + {0x1F774, 0x1F776, prID, gcSo}, // [3] LOT OF FORTUNE..LUNAR ECLIPSE + {0x1F777, 0x1F77A, prID, gcCn}, // [4] .. + {0x1F77B, 0x1F77F, prID, gcSo}, // [5] HAUMEA..ORCUS {0x1F780, 0x1F7D4, prAL, gcSo}, // [85] BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE..HEAVY TWELVE POINTED PINWHEEL STAR - {0x1F7D5, 0x1F7D8, prID, gcSo}, // [4] CIRCLED TRIANGLE..NEGATIVE CIRCLED SQUARE - {0x1F7D9, 0x1F7DF, prID, gcCn}, // [7] .. + {0x1F7D5, 0x1F7D9, prID, gcSo}, // [5] CIRCLED TRIANGLE..NINE POINTED WHITE STAR + {0x1F7DA, 0x1F7DF, prID, gcCn}, // [6] .. {0x1F7E0, 0x1F7EB, prID, gcSo}, // [12] LARGE ORANGE CIRCLE..LARGE BROWN SQUARE {0x1F7EC, 0x1F7EF, prID, gcCn}, // [4] .. {0x1F7F0, 0x1F7F0, prID, gcSo}, // HEAVY EQUALS SIGN @@ -3467,33 +3510,29 @@ var lineBreakCodePoints = [][4]int{ {0x1FA54, 0x1FA5F, prID, gcCn}, // [12] .. {0x1FA60, 0x1FA6D, prID, gcSo}, // [14] XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER {0x1FA6E, 0x1FA6F, prID, gcCn}, // [2] .. - {0x1FA70, 0x1FA74, prID, gcSo}, // [5] BALLET SHOES..THONG SANDAL - {0x1FA75, 0x1FA77, prID, gcCn}, // [3] .. - {0x1FA78, 0x1FA7C, prID, gcSo}, // [5] DROP OF BLOOD..CRUTCH + {0x1FA70, 0x1FA7C, prID, gcSo}, // [13] BALLET SHOES..CRUTCH {0x1FA7D, 0x1FA7F, prID, gcCn}, // [3] .. - {0x1FA80, 0x1FA86, prID, gcSo}, // [7] YO-YO..NESTING DOLLS - {0x1FA87, 0x1FA8F, prID, gcCn}, // [9] .. - {0x1FA90, 0x1FAAC, prID, gcSo}, // [29] RINGED PLANET..HAMSA - {0x1FAAD, 0x1FAAF, prID, gcCn}, // [3] .. - {0x1FAB0, 0x1FABA, prID, gcSo}, // [11] FLY..NEST WITH EGGS - {0x1FABB, 0x1FABF, prID, gcCn}, // [5] .. - {0x1FAC0, 0x1FAC2, prID, gcSo}, // [3] ANATOMICAL HEART..PEOPLE HUGGING + {0x1FA80, 0x1FA88, prID, gcSo}, // [9] YO-YO..FLUTE + {0x1FA89, 0x1FA8F, prID, gcCn}, // [7] .. + {0x1FA90, 0x1FABD, prID, gcSo}, // [46] RINGED PLANET..WING + {0x1FABE, 0x1FABE, prID, gcCn}, // + {0x1FABF, 0x1FAC2, prID, gcSo}, // [4] GOOSE..PEOPLE HUGGING {0x1FAC3, 0x1FAC5, prEB, gcSo}, // [3] PREGNANT MAN..PERSON WITH CROWN - {0x1FAC6, 0x1FACF, prID, gcCn}, // [10] .. - {0x1FAD0, 0x1FAD9, prID, gcSo}, // [10] BLUEBERRIES..JAR - {0x1FADA, 0x1FADF, prID, gcCn}, // [6] .. - {0x1FAE0, 0x1FAE7, prID, gcSo}, // [8] MELTING FACE..BUBBLES - {0x1FAE8, 0x1FAEF, prID, gcCn}, // [8] .. - {0x1FAF0, 0x1FAF6, prEB, gcSo}, // [7] HAND WITH INDEX FINGER AND THUMB CROSSED..HEART HANDS - {0x1FAF7, 0x1FAFF, prID, gcCn}, // [9] .. + {0x1FAC6, 0x1FACD, prID, gcCn}, // [8] .. + {0x1FACE, 0x1FADB, prID, gcSo}, // [14] MOOSE..PEA POD + {0x1FADC, 0x1FADF, prID, gcCn}, // [4] .. + {0x1FAE0, 0x1FAE8, prID, gcSo}, // [9] MELTING FACE..SHAKING FACE + {0x1FAE9, 0x1FAEF, prID, gcCn}, // [7] .. + {0x1FAF0, 0x1FAF8, prEB, gcSo}, // [9] HAND WITH INDEX FINGER AND THUMB CROSSED..RIGHTWARDS PUSHING HAND + {0x1FAF9, 0x1FAFF, prID, gcCn}, // [7] .. {0x1FB00, 0x1FB92, prAL, gcSo}, // [147] BLOCK SEXTANT-1..UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK {0x1FB94, 0x1FBCA, prAL, gcSo}, // [55] LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK..WHITE UP-POINTING CHEVRON {0x1FBF0, 0x1FBF9, prNU, gcNd}, // [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE {0x1FC00, 0x1FFFD, prID, gcCn}, // [1022] .. {0x20000, 0x2A6DF, prID, gcLo}, // [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF {0x2A6E0, 0x2A6FF, prID, gcCn}, // [32] .. - {0x2A700, 0x2B738, prID, gcLo}, // [4153] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B738 - {0x2B739, 0x2B73F, prID, gcCn}, // [7] .. + {0x2A700, 0x2B739, prID, gcLo}, // [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 + {0x2B73A, 0x2B73F, prID, gcCn}, // [6] .. {0x2B740, 0x2B81D, prID, gcLo}, // [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D {0x2B81E, 0x2B81F, prID, gcCn}, // [2] .. {0x2B820, 0x2CEA1, prID, gcLo}, // [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 @@ -3504,7 +3543,9 @@ var lineBreakCodePoints = [][4]int{ {0x2FA1E, 0x2FA1F, prID, gcCn}, // [2] .. {0x2FA20, 0x2FFFD, prID, gcCn}, // [1502] .. {0x30000, 0x3134A, prID, gcLo}, // [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A - {0x3134B, 0x3FFFD, prID, gcCn}, // [60595] .. + {0x3134B, 0x3134F, prID, gcCn}, // [5] .. + {0x31350, 0x323AF, prID, gcLo}, // [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF + {0x323B0, 0x3FFFD, prID, gcCn}, // [56398] .. {0xE0001, 0xE0001, prCM, gcCf}, // LANGUAGE TAG {0xE0020, 0xE007F, prCM, gcCf}, // [96] TAG SPACE..CANCEL TAG {0xE0100, 0xE01EF, prCM, gcMn}, // [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 diff --git a/vendor/github.com/rivo/uniseg/linerules.go b/vendor/github.com/rivo/uniseg/linerules.go index d2ad51680e..7708ae0fbe 100644 --- a/vendor/github.com/rivo/uniseg/linerules.go +++ b/vendor/github.com/rivo/uniseg/linerules.go @@ -64,222 +64,381 @@ const ( LineMustBreak // You must break the line here. ) -// The line break parser's state transitions. It's anologous to grTransitions, -// see comments there for details. Unicode version 14.0.0. -var lbTransitions = map[[2]int][3]int{ +// lbTransitions implements the line break parser's state transitions. It's +// anologous to [grTransitions], see comments there for details. +// +// Unicode version 15.0.0. +func lbTransitions(state, prop int) (newState, lineBreak, rule int) { + switch uint64(state) | uint64(prop)<<32 { // LB4. - {lbAny, prBK}: {lbBK, LineCanBreak, 310}, - {lbBK, prAny}: {lbAny, LineMustBreak, 40}, + case lbBK | prAny<<32: + return lbAny, LineMustBreak, 40 // LB5. - {lbAny, prCR}: {lbCR, LineCanBreak, 310}, - {lbAny, prLF}: {lbLF, LineCanBreak, 310}, - {lbAny, prNL}: {lbNL, LineCanBreak, 310}, - {lbCR, prLF}: {lbLF, LineDontBreak, 50}, - {lbCR, prAny}: {lbAny, LineMustBreak, 50}, - {lbLF, prAny}: {lbAny, LineMustBreak, 50}, - {lbNL, prAny}: {lbAny, LineMustBreak, 50}, + case lbCR | prLF<<32: + return lbLF, LineDontBreak, 50 + case lbCR | prAny<<32: + return lbAny, LineMustBreak, 50 + case lbLF | prAny<<32: + return lbAny, LineMustBreak, 50 + case lbNL | prAny<<32: + return lbAny, LineMustBreak, 50 // LB6. - {lbAny, prBK}: {lbBK, LineDontBreak, 60}, - {lbAny, prCR}: {lbCR, LineDontBreak, 60}, - {lbAny, prLF}: {lbLF, LineDontBreak, 60}, - {lbAny, prNL}: {lbNL, LineDontBreak, 60}, + case lbAny | prBK<<32: + return lbBK, LineDontBreak, 60 + case lbAny | prCR<<32: + return lbCR, LineDontBreak, 60 + case lbAny | prLF<<32: + return lbLF, LineDontBreak, 60 + case lbAny | prNL<<32: + return lbNL, LineDontBreak, 60 // LB7. - {lbAny, prSP}: {lbSP, LineDontBreak, 70}, - {lbAny, prZW}: {lbZW, LineDontBreak, 70}, + case lbAny | prSP<<32: + return lbSP, LineDontBreak, 70 + case lbAny | prZW<<32: + return lbZW, LineDontBreak, 70 // LB8. - {lbZW, prSP}: {lbZW, LineDontBreak, 70}, - {lbZW, prAny}: {lbAny, LineCanBreak, 80}, + case lbZW | prSP<<32: + return lbZW, LineDontBreak, 70 + case lbZW | prAny<<32: + return lbAny, LineCanBreak, 80 // LB11. - {lbAny, prWJ}: {lbWJ, LineDontBreak, 110}, - {lbWJ, prAny}: {lbAny, LineDontBreak, 110}, + case lbAny | prWJ<<32: + return lbWJ, LineDontBreak, 110 + case lbWJ | prAny<<32: + return lbAny, LineDontBreak, 110 // LB12. - {lbAny, prGL}: {lbGL, LineCanBreak, 310}, - {lbGL, prAny}: {lbAny, LineDontBreak, 120}, + case lbAny | prGL<<32: + return lbGL, LineCanBreak, 310 + case lbGL | prAny<<32: + return lbAny, LineDontBreak, 120 // LB13 (simple transitions). - {lbAny, prCL}: {lbCL, LineCanBreak, 310}, - {lbAny, prCP}: {lbCP, LineCanBreak, 310}, - {lbAny, prEX}: {lbEX, LineDontBreak, 130}, - {lbAny, prIS}: {lbIS, LineCanBreak, 310}, - {lbAny, prSY}: {lbSY, LineCanBreak, 310}, + case lbAny | prCL<<32: + return lbCL, LineCanBreak, 310 + case lbAny | prCP<<32: + return lbCP, LineCanBreak, 310 + case lbAny | prEX<<32: + return lbEX, LineDontBreak, 130 + case lbAny | prIS<<32: + return lbIS, LineCanBreak, 310 + case lbAny | prSY<<32: + return lbSY, LineCanBreak, 310 // LB14. - {lbAny, prOP}: {lbOP, LineCanBreak, 310}, - {lbOP, prSP}: {lbOP, LineDontBreak, 70}, - {lbOP, prAny}: {lbAny, LineDontBreak, 140}, + case lbAny | prOP<<32: + return lbOP, LineCanBreak, 310 + case lbOP | prSP<<32: + return lbOP, LineDontBreak, 70 + case lbOP | prAny<<32: + return lbAny, LineDontBreak, 140 // LB15. - {lbQU, prSP}: {lbQUSP, LineDontBreak, 70}, - {lbQU, prOP}: {lbOP, LineDontBreak, 150}, - {lbQUSP, prOP}: {lbOP, LineDontBreak, 150}, + case lbQU | prSP<<32: + return lbQUSP, LineDontBreak, 70 + case lbQU | prOP<<32: + return lbOP, LineDontBreak, 150 + case lbQUSP | prOP<<32: + return lbOP, LineDontBreak, 150 // LB16. - {lbCL, prSP}: {lbCLCPSP, LineDontBreak, 70}, - {lbNUCL, prSP}: {lbCLCPSP, LineDontBreak, 70}, - {lbCP, prSP}: {lbCLCPSP, LineDontBreak, 70}, - {lbNUCP, prSP}: {lbCLCPSP, LineDontBreak, 70}, - {lbCL, prNS}: {lbNS, LineDontBreak, 160}, - {lbNUCL, prNS}: {lbNS, LineDontBreak, 160}, - {lbCP, prNS}: {lbNS, LineDontBreak, 160}, - {lbNUCP, prNS}: {lbNS, LineDontBreak, 160}, - {lbCLCPSP, prNS}: {lbNS, LineDontBreak, 160}, + case lbCL | prSP<<32: + return lbCLCPSP, LineDontBreak, 70 + case lbNUCL | prSP<<32: + return lbCLCPSP, LineDontBreak, 70 + case lbCP | prSP<<32: + return lbCLCPSP, LineDontBreak, 70 + case lbNUCP | prSP<<32: + return lbCLCPSP, LineDontBreak, 70 + case lbCL | prNS<<32: + return lbNS, LineDontBreak, 160 + case lbNUCL | prNS<<32: + return lbNS, LineDontBreak, 160 + case lbCP | prNS<<32: + return lbNS, LineDontBreak, 160 + case lbNUCP | prNS<<32: + return lbNS, LineDontBreak, 160 + case lbCLCPSP | prNS<<32: + return lbNS, LineDontBreak, 160 // LB17. - {lbAny, prB2}: {lbB2, LineCanBreak, 310}, - {lbB2, prSP}: {lbB2SP, LineDontBreak, 70}, - {lbB2, prB2}: {lbB2, LineDontBreak, 170}, - {lbB2SP, prB2}: {lbB2, LineDontBreak, 170}, + case lbAny | prB2<<32: + return lbB2, LineCanBreak, 310 + case lbB2 | prSP<<32: + return lbB2SP, LineDontBreak, 70 + case lbB2 | prB2<<32: + return lbB2, LineDontBreak, 170 + case lbB2SP | prB2<<32: + return lbB2, LineDontBreak, 170 // LB18. - {lbSP, prAny}: {lbAny, LineCanBreak, 180}, - {lbQUSP, prAny}: {lbAny, LineCanBreak, 180}, - {lbCLCPSP, prAny}: {lbAny, LineCanBreak, 180}, - {lbB2SP, prAny}: {lbAny, LineCanBreak, 180}, + case lbSP | prAny<<32: + return lbAny, LineCanBreak, 180 + case lbQUSP | prAny<<32: + return lbAny, LineCanBreak, 180 + case lbCLCPSP | prAny<<32: + return lbAny, LineCanBreak, 180 + case lbB2SP | prAny<<32: + return lbAny, LineCanBreak, 180 // LB19. - {lbAny, prQU}: {lbQU, LineDontBreak, 190}, - {lbQU, prAny}: {lbAny, LineDontBreak, 190}, + case lbAny | prQU<<32: + return lbQU, LineDontBreak, 190 + case lbQU | prAny<<32: + return lbAny, LineDontBreak, 190 // LB20. - {lbAny, prCB}: {lbCB, LineCanBreak, 200}, - {lbCB, prAny}: {lbAny, LineCanBreak, 200}, + case lbAny | prCB<<32: + return lbCB, LineCanBreak, 200 + case lbCB | prAny<<32: + return lbAny, LineCanBreak, 200 // LB21. - {lbAny, prBA}: {lbBA, LineDontBreak, 210}, - {lbAny, prHY}: {lbHY, LineDontBreak, 210}, - {lbAny, prNS}: {lbNS, LineDontBreak, 210}, - {lbAny, prBB}: {lbBB, LineCanBreak, 310}, - {lbBB, prAny}: {lbAny, LineDontBreak, 210}, + case lbAny | prBA<<32: + return lbBA, LineDontBreak, 210 + case lbAny | prHY<<32: + return lbHY, LineDontBreak, 210 + case lbAny | prNS<<32: + return lbNS, LineDontBreak, 210 + case lbAny | prBB<<32: + return lbBB, LineCanBreak, 310 + case lbBB | prAny<<32: + return lbAny, LineDontBreak, 210 // LB21a. - {lbAny, prHL}: {lbHL, LineCanBreak, 310}, - {lbHL, prHY}: {lbLB21a, LineDontBreak, 210}, - {lbHL, prBA}: {lbLB21a, LineDontBreak, 210}, - {lbLB21a, prAny}: {lbAny, LineDontBreak, 211}, + case lbAny | prHL<<32: + return lbHL, LineCanBreak, 310 + case lbHL | prHY<<32: + return lbLB21a, LineDontBreak, 210 + case lbHL | prBA<<32: + return lbLB21a, LineDontBreak, 210 + case lbLB21a | prAny<<32: + return lbAny, LineDontBreak, 211 // LB21b. - {lbSY, prHL}: {lbHL, LineDontBreak, 212}, - {lbNUSY, prHL}: {lbHL, LineDontBreak, 212}, + case lbSY | prHL<<32: + return lbHL, LineDontBreak, 212 + case lbNUSY | prHL<<32: + return lbHL, LineDontBreak, 212 // LB22. - {lbAny, prIN}: {lbAny, LineDontBreak, 220}, + case lbAny | prIN<<32: + return lbAny, LineDontBreak, 220 // LB23. - {lbAny, prAL}: {lbAL, LineCanBreak, 310}, - {lbAny, prNU}: {lbNU, LineCanBreak, 310}, - {lbAL, prNU}: {lbNU, LineDontBreak, 230}, - {lbHL, prNU}: {lbNU, LineDontBreak, 230}, - {lbNU, prAL}: {lbAL, LineDontBreak, 230}, - {lbNU, prHL}: {lbHL, LineDontBreak, 230}, - {lbNUNU, prAL}: {lbAL, LineDontBreak, 230}, - {lbNUNU, prHL}: {lbHL, LineDontBreak, 230}, + case lbAny | prAL<<32: + return lbAL, LineCanBreak, 310 + case lbAny | prNU<<32: + return lbNU, LineCanBreak, 310 + case lbAL | prNU<<32: + return lbNU, LineDontBreak, 230 + case lbHL | prNU<<32: + return lbNU, LineDontBreak, 230 + case lbNU | prAL<<32: + return lbAL, LineDontBreak, 230 + case lbNU | prHL<<32: + return lbHL, LineDontBreak, 230 + case lbNUNU | prAL<<32: + return lbAL, LineDontBreak, 230 + case lbNUNU | prHL<<32: + return lbHL, LineDontBreak, 230 // LB23a. - {lbAny, prPR}: {lbPR, LineCanBreak, 310}, - {lbAny, prID}: {lbIDEM, LineCanBreak, 310}, - {lbAny, prEB}: {lbEB, LineCanBreak, 310}, - {lbAny, prEM}: {lbIDEM, LineCanBreak, 310}, - {lbPR, prID}: {lbIDEM, LineDontBreak, 231}, - {lbPR, prEB}: {lbEB, LineDontBreak, 231}, - {lbPR, prEM}: {lbIDEM, LineDontBreak, 231}, - {lbIDEM, prPO}: {lbPO, LineDontBreak, 231}, - {lbEB, prPO}: {lbPO, LineDontBreak, 231}, + case lbAny | prPR<<32: + return lbPR, LineCanBreak, 310 + case lbAny | prID<<32: + return lbIDEM, LineCanBreak, 310 + case lbAny | prEB<<32: + return lbEB, LineCanBreak, 310 + case lbAny | prEM<<32: + return lbIDEM, LineCanBreak, 310 + case lbPR | prID<<32: + return lbIDEM, LineDontBreak, 231 + case lbPR | prEB<<32: + return lbEB, LineDontBreak, 231 + case lbPR | prEM<<32: + return lbIDEM, LineDontBreak, 231 + case lbIDEM | prPO<<32: + return lbPO, LineDontBreak, 231 + case lbEB | prPO<<32: + return lbPO, LineDontBreak, 231 // LB24. - {lbAny, prPO}: {lbPO, LineCanBreak, 310}, - {lbPR, prAL}: {lbAL, LineDontBreak, 240}, - {lbPR, prHL}: {lbHL, LineDontBreak, 240}, - {lbPO, prAL}: {lbAL, LineDontBreak, 240}, - {lbPO, prHL}: {lbHL, LineDontBreak, 240}, - {lbAL, prPR}: {lbPR, LineDontBreak, 240}, - {lbAL, prPO}: {lbPO, LineDontBreak, 240}, - {lbHL, prPR}: {lbPR, LineDontBreak, 240}, - {lbHL, prPO}: {lbPO, LineDontBreak, 240}, + case lbAny | prPO<<32: + return lbPO, LineCanBreak, 310 + case lbPR | prAL<<32: + return lbAL, LineDontBreak, 240 + case lbPR | prHL<<32: + return lbHL, LineDontBreak, 240 + case lbPO | prAL<<32: + return lbAL, LineDontBreak, 240 + case lbPO | prHL<<32: + return lbHL, LineDontBreak, 240 + case lbAL | prPR<<32: + return lbPR, LineDontBreak, 240 + case lbAL | prPO<<32: + return lbPO, LineDontBreak, 240 + case lbHL | prPR<<32: + return lbPR, LineDontBreak, 240 + case lbHL | prPO<<32: + return lbPO, LineDontBreak, 240 // LB25 (simple transitions). - {lbPR, prNU}: {lbNU, LineDontBreak, 250}, - {lbPO, prNU}: {lbNU, LineDontBreak, 250}, - {lbOP, prNU}: {lbNU, LineDontBreak, 250}, - {lbHY, prNU}: {lbNU, LineDontBreak, 250}, - {lbNU, prNU}: {lbNUNU, LineDontBreak, 250}, - {lbNU, prSY}: {lbNUSY, LineDontBreak, 250}, - {lbNU, prIS}: {lbNUIS, LineDontBreak, 250}, - {lbNUNU, prNU}: {lbNUNU, LineDontBreak, 250}, - {lbNUNU, prSY}: {lbNUSY, LineDontBreak, 250}, - {lbNUNU, prIS}: {lbNUIS, LineDontBreak, 250}, - {lbNUSY, prNU}: {lbNUNU, LineDontBreak, 250}, - {lbNUSY, prSY}: {lbNUSY, LineDontBreak, 250}, - {lbNUSY, prIS}: {lbNUIS, LineDontBreak, 250}, - {lbNUIS, prNU}: {lbNUNU, LineDontBreak, 250}, - {lbNUIS, prSY}: {lbNUSY, LineDontBreak, 250}, - {lbNUIS, prIS}: {lbNUIS, LineDontBreak, 250}, - {lbNU, prCL}: {lbNUCL, LineDontBreak, 250}, - {lbNU, prCP}: {lbNUCP, LineDontBreak, 250}, - {lbNUNU, prCL}: {lbNUCL, LineDontBreak, 250}, - {lbNUNU, prCP}: {lbNUCP, LineDontBreak, 250}, - {lbNUSY, prCL}: {lbNUCL, LineDontBreak, 250}, - {lbNUSY, prCP}: {lbNUCP, LineDontBreak, 250}, - {lbNUIS, prCL}: {lbNUCL, LineDontBreak, 250}, - {lbNUIS, prCP}: {lbNUCP, LineDontBreak, 250}, - {lbNU, prPO}: {lbPO, LineDontBreak, 250}, - {lbNUNU, prPO}: {lbPO, LineDontBreak, 250}, - {lbNUSY, prPO}: {lbPO, LineDontBreak, 250}, - {lbNUIS, prPO}: {lbPO, LineDontBreak, 250}, - {lbNUCL, prPO}: {lbPO, LineDontBreak, 250}, - {lbNUCP, prPO}: {lbPO, LineDontBreak, 250}, - {lbNU, prPR}: {lbPR, LineDontBreak, 250}, - {lbNUNU, prPR}: {lbPR, LineDontBreak, 250}, - {lbNUSY, prPR}: {lbPR, LineDontBreak, 250}, - {lbNUIS, prPR}: {lbPR, LineDontBreak, 250}, - {lbNUCL, prPR}: {lbPR, LineDontBreak, 250}, - {lbNUCP, prPR}: {lbPR, LineDontBreak, 250}, + case lbPR | prNU<<32: + return lbNU, LineDontBreak, 250 + case lbPO | prNU<<32: + return lbNU, LineDontBreak, 250 + case lbOP | prNU<<32: + return lbNU, LineDontBreak, 250 + case lbHY | prNU<<32: + return lbNU, LineDontBreak, 250 + case lbNU | prNU<<32: + return lbNUNU, LineDontBreak, 250 + case lbNU | prSY<<32: + return lbNUSY, LineDontBreak, 250 + case lbNU | prIS<<32: + return lbNUIS, LineDontBreak, 250 + case lbNUNU | prNU<<32: + return lbNUNU, LineDontBreak, 250 + case lbNUNU | prSY<<32: + return lbNUSY, LineDontBreak, 250 + case lbNUNU | prIS<<32: + return lbNUIS, LineDontBreak, 250 + case lbNUSY | prNU<<32: + return lbNUNU, LineDontBreak, 250 + case lbNUSY | prSY<<32: + return lbNUSY, LineDontBreak, 250 + case lbNUSY | prIS<<32: + return lbNUIS, LineDontBreak, 250 + case lbNUIS | prNU<<32: + return lbNUNU, LineDontBreak, 250 + case lbNUIS | prSY<<32: + return lbNUSY, LineDontBreak, 250 + case lbNUIS | prIS<<32: + return lbNUIS, LineDontBreak, 250 + case lbNU | prCL<<32: + return lbNUCL, LineDontBreak, 250 + case lbNU | prCP<<32: + return lbNUCP, LineDontBreak, 250 + case lbNUNU | prCL<<32: + return lbNUCL, LineDontBreak, 250 + case lbNUNU | prCP<<32: + return lbNUCP, LineDontBreak, 250 + case lbNUSY | prCL<<32: + return lbNUCL, LineDontBreak, 250 + case lbNUSY | prCP<<32: + return lbNUCP, LineDontBreak, 250 + case lbNUIS | prCL<<32: + return lbNUCL, LineDontBreak, 250 + case lbNUIS | prCP<<32: + return lbNUCP, LineDontBreak, 250 + case lbNU | prPO<<32: + return lbPO, LineDontBreak, 250 + case lbNUNU | prPO<<32: + return lbPO, LineDontBreak, 250 + case lbNUSY | prPO<<32: + return lbPO, LineDontBreak, 250 + case lbNUIS | prPO<<32: + return lbPO, LineDontBreak, 250 + case lbNUCL | prPO<<32: + return lbPO, LineDontBreak, 250 + case lbNUCP | prPO<<32: + return lbPO, LineDontBreak, 250 + case lbNU | prPR<<32: + return lbPR, LineDontBreak, 250 + case lbNUNU | prPR<<32: + return lbPR, LineDontBreak, 250 + case lbNUSY | prPR<<32: + return lbPR, LineDontBreak, 250 + case lbNUIS | prPR<<32: + return lbPR, LineDontBreak, 250 + case lbNUCL | prPR<<32: + return lbPR, LineDontBreak, 250 + case lbNUCP | prPR<<32: + return lbPR, LineDontBreak, 250 // LB26. - {lbAny, prJL}: {lbJL, LineCanBreak, 310}, - {lbAny, prJV}: {lbJV, LineCanBreak, 310}, - {lbAny, prJT}: {lbJT, LineCanBreak, 310}, - {lbAny, prH2}: {lbH2, LineCanBreak, 310}, - {lbAny, prH3}: {lbH3, LineCanBreak, 310}, - {lbJL, prJL}: {lbJL, LineDontBreak, 260}, - {lbJL, prJV}: {lbJV, LineDontBreak, 260}, - {lbJL, prH2}: {lbH2, LineDontBreak, 260}, - {lbJL, prH3}: {lbH3, LineDontBreak, 260}, - {lbJV, prJV}: {lbJV, LineDontBreak, 260}, - {lbJV, prJT}: {lbJT, LineDontBreak, 260}, - {lbH2, prJV}: {lbJV, LineDontBreak, 260}, - {lbH2, prJT}: {lbJT, LineDontBreak, 260}, - {lbJT, prJT}: {lbJT, LineDontBreak, 260}, - {lbH3, prJT}: {lbJT, LineDontBreak, 260}, + case lbAny | prJL<<32: + return lbJL, LineCanBreak, 310 + case lbAny | prJV<<32: + return lbJV, LineCanBreak, 310 + case lbAny | prJT<<32: + return lbJT, LineCanBreak, 310 + case lbAny | prH2<<32: + return lbH2, LineCanBreak, 310 + case lbAny | prH3<<32: + return lbH3, LineCanBreak, 310 + case lbJL | prJL<<32: + return lbJL, LineDontBreak, 260 + case lbJL | prJV<<32: + return lbJV, LineDontBreak, 260 + case lbJL | prH2<<32: + return lbH2, LineDontBreak, 260 + case lbJL | prH3<<32: + return lbH3, LineDontBreak, 260 + case lbJV | prJV<<32: + return lbJV, LineDontBreak, 260 + case lbJV | prJT<<32: + return lbJT, LineDontBreak, 260 + case lbH2 | prJV<<32: + return lbJV, LineDontBreak, 260 + case lbH2 | prJT<<32: + return lbJT, LineDontBreak, 260 + case lbJT | prJT<<32: + return lbJT, LineDontBreak, 260 + case lbH3 | prJT<<32: + return lbJT, LineDontBreak, 260 // LB27. - {lbJL, prPO}: {lbPO, LineDontBreak, 270}, - {lbJV, prPO}: {lbPO, LineDontBreak, 270}, - {lbJT, prPO}: {lbPO, LineDontBreak, 270}, - {lbH2, prPO}: {lbPO, LineDontBreak, 270}, - {lbH3, prPO}: {lbPO, LineDontBreak, 270}, - {lbPR, prJL}: {lbJL, LineDontBreak, 270}, - {lbPR, prJV}: {lbJV, LineDontBreak, 270}, - {lbPR, prJT}: {lbJT, LineDontBreak, 270}, - {lbPR, prH2}: {lbH2, LineDontBreak, 270}, - {lbPR, prH3}: {lbH3, LineDontBreak, 270}, + case lbJL | prPO<<32: + return lbPO, LineDontBreak, 270 + case lbJV | prPO<<32: + return lbPO, LineDontBreak, 270 + case lbJT | prPO<<32: + return lbPO, LineDontBreak, 270 + case lbH2 | prPO<<32: + return lbPO, LineDontBreak, 270 + case lbH3 | prPO<<32: + return lbPO, LineDontBreak, 270 + case lbPR | prJL<<32: + return lbJL, LineDontBreak, 270 + case lbPR | prJV<<32: + return lbJV, LineDontBreak, 270 + case lbPR | prJT<<32: + return lbJT, LineDontBreak, 270 + case lbPR | prH2<<32: + return lbH2, LineDontBreak, 270 + case lbPR | prH3<<32: + return lbH3, LineDontBreak, 270 // LB28. - {lbAL, prAL}: {lbAL, LineDontBreak, 280}, - {lbAL, prHL}: {lbHL, LineDontBreak, 280}, - {lbHL, prAL}: {lbAL, LineDontBreak, 280}, - {lbHL, prHL}: {lbHL, LineDontBreak, 280}, + case lbAL | prAL<<32: + return lbAL, LineDontBreak, 280 + case lbAL | prHL<<32: + return lbHL, LineDontBreak, 280 + case lbHL | prAL<<32: + return lbAL, LineDontBreak, 280 + case lbHL | prHL<<32: + return lbHL, LineDontBreak, 280 // LB29. - {lbIS, prAL}: {lbAL, LineDontBreak, 290}, - {lbIS, prHL}: {lbHL, LineDontBreak, 290}, - {lbNUIS, prAL}: {lbAL, LineDontBreak, 290}, - {lbNUIS, prHL}: {lbHL, LineDontBreak, 290}, + case lbIS | prAL<<32: + return lbAL, LineDontBreak, 290 + case lbIS | prHL<<32: + return lbHL, LineDontBreak, 290 + case lbNUIS | prAL<<32: + return lbAL, LineDontBreak, 290 + case lbNUIS | prHL<<32: + return lbHL, LineDontBreak, 290 + + default: + return -1, -1, -1 + } } // transitionLineBreakState determines the new state of the line break parser @@ -290,7 +449,7 @@ var lbTransitions = map[[2]int][3]int{ // further lookups. func transitionLineBreakState(state int, r rune, b []byte, str string) (newState int, lineBreak int) { // Determine the property of the next character. - nextProperty, generalCategory := propertyWithGenCat(lineBreakCodePoints, r) + nextProperty, generalCategory := propertyLineBreak(r) // Prepare. var forceNoBreak, isCPeaFWH bool @@ -306,7 +465,7 @@ func transitionLineBreakState(state int, r rune, b []byte, str string) (newState defer func() { // Transition into LB30. if newState == lbCP || newState == lbNUCP { - ea := property(eastAsianWidth, r) + ea := propertyEastAsianWidth(r) if ea != prF && ea != prW && ea != prH { newState |= lbCPeaFWHBit } @@ -352,30 +511,27 @@ func transitionLineBreakState(state int, r rune, b []byte, str string) (newState // Find the applicable transition in the table. var rule int - transition, ok := lbTransitions[[2]int{state, nextProperty}] - if ok { - // We have a specific transition. We'll use it. - newState, lineBreak, rule = transition[0], transition[1], transition[2] - } else { + newState, lineBreak, rule = lbTransitions(state, nextProperty) + if newState < 0 { // No specific transition found. Try the less specific ones. - transAnyProp, okAnyProp := lbTransitions[[2]int{state, prAny}] - transAnyState, okAnyState := lbTransitions[[2]int{lbAny, nextProperty}] - if okAnyProp && okAnyState { + anyPropProp, anyPropLineBreak, anyPropRule := lbTransitions(state, prAny) + anyStateProp, anyStateLineBreak, anyStateRule := lbTransitions(lbAny, nextProperty) + if anyPropProp >= 0 && anyStateProp >= 0 { // Both apply. We'll use a mix (see comments for grTransitions). - newState, lineBreak, rule = transAnyState[0], transAnyState[1], transAnyState[2] - if transAnyProp[2] < transAnyState[2] { - lineBreak, rule = transAnyProp[1], transAnyProp[2] + newState, lineBreak, rule = anyStateProp, anyStateLineBreak, anyStateRule + if anyPropRule < anyStateRule { + lineBreak, rule = anyPropLineBreak, anyPropRule } - } else if okAnyProp { + } else if anyPropProp >= 0 { // We only have a specific state. - newState, lineBreak, rule = transAnyProp[0], transAnyProp[1], transAnyProp[2] + newState, lineBreak, rule = anyPropProp, anyPropLineBreak, anyPropRule // This branch will probably never be reached because okAnyState will // always be true given the current transition map. But we keep it here // for future modifications to the transition map where this may not be // true anymore. - } else if okAnyState { + } else if anyStateProp >= 0 { // We only have a specific property. - newState, lineBreak, rule = transAnyState[0], transAnyState[1], transAnyState[2] + newState, lineBreak, rule = anyStateProp, anyStateLineBreak, anyStateRule } else { // No known transition. LB31: ALL ÷ ALL. newState, lineBreak, rule = lbAny, LineCanBreak, 310 @@ -414,7 +570,7 @@ func transitionLineBreakState(state int, r rune, b []byte, str string) (newState r, _ = utf8.DecodeRuneInString(str) } if r != utf8.RuneError { - pr, _ := propertyWithGenCat(lineBreakCodePoints, r) + pr, _ := propertyLineBreak(r) if pr == prNU { return lbNU, LineDontBreak } @@ -424,7 +580,7 @@ func transitionLineBreakState(state int, r rune, b []byte, str string) (newState // LB30 (part one). if rule > 300 { if (state == lbAL || state == lbHL || state == lbNU || state == lbNUNU) && nextProperty == prOP { - ea := property(eastAsianWidth, r) + ea := propertyEastAsianWidth(r) if ea != prF && ea != prW && ea != prH { return lbOP, LineDontBreak } @@ -460,7 +616,7 @@ func transitionLineBreakState(state int, r rune, b []byte, str string) (newState return prAny, LineDontBreak } } - graphemeProperty := property(graphemeCodePoints, r) + graphemeProperty := propertyGraphemes(r) if graphemeProperty == prExtendedPictographic && generalCategory == gcCn { return lbExtPicCn, LineCanBreak } diff --git a/vendor/github.com/rivo/uniseg/properties.go b/vendor/github.com/rivo/uniseg/properties.go index bc3c7bcf34..6290e6810f 100644 --- a/vendor/github.com/rivo/uniseg/properties.go +++ b/vendor/github.com/rivo/uniseg/properties.go @@ -160,9 +160,49 @@ func property(dictionary [][3]int, r rune) int { return propertySearch(dictionary, r)[2] } -// propertyWithGenCat returns the Unicode property value and General Category -// (see constants above) of the given code point. -func propertyWithGenCat(dictionary [][4]int, r rune) (property, generalCategory int) { - entry := propertySearch(dictionary, r) +// propertyLineBreak returns the Unicode property value and General Category +// (see constants above) of the given code point, as listed in the line break +// code points table, while fast tracking ASCII digits and letters. +func propertyLineBreak(r rune) (property, generalCategory int) { + if r >= 'a' && r <= 'z' { + return prAL, gcLl + } + if r >= 'A' && r <= 'Z' { + return prAL, gcLu + } + if r >= '0' && r <= '9' { + return prNU, gcNd + } + entry := propertySearch(lineBreakCodePoints, r) return entry[2], entry[3] } + +// propertyGraphemes returns the Unicode grapheme cluster property value of the +// given code point while fast tracking ASCII characters. +func propertyGraphemes(r rune) int { + if r >= 0x20 && r <= 0x7e { + return prAny + } + if r == 0x0a { + return prLF + } + if r == 0x0d { + return prCR + } + if r >= 0 && r <= 0x1f || r == 0x7f { + return prControl + } + return property(graphemeCodePoints, r) +} + +// propertyEastAsianWidth returns the Unicode East Asian Width property value of +// the given code point while fast tracking ASCII characters. +func propertyEastAsianWidth(r rune) int { + if r >= 0x20 && r <= 0x7e { + return prNa + } + if r >= 0 && r <= 0x1f || r == 0x7f { + return prN + } + return property(eastAsianWidth, r) +} diff --git a/vendor/github.com/rivo/uniseg/sentenceproperties.go b/vendor/github.com/rivo/uniseg/sentenceproperties.go index ba0cf2de11..67717ec1f3 100644 --- a/vendor/github.com/rivo/uniseg/sentenceproperties.go +++ b/vendor/github.com/rivo/uniseg/sentenceproperties.go @@ -1,13 +1,13 @@ -package uniseg - // Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg + // sentenceBreakCodePoints are taken from -// https://www.unicode.org/Public/14.0.0/ucd/auxiliary/SentenceBreakProperty.txt +// https://www.unicode.org/Public/15.0.0/ucd/auxiliary/SentenceBreakProperty.txt // and -// https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt +// https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt // ("Extended_Pictographic" only) -// on September 10, 2022. See https://www.unicode.org/license.html for the Unicode +// on September 5, 2023. See https://www.unicode.org/license.html for the Unicode // license agreement. var sentenceBreakCodePoints = [][3]int{ {0x0009, 0x0009, prSp}, // Cc @@ -843,6 +843,7 @@ var sentenceBreakCodePoints = [][3]int{ {0x0CE2, 0x0CE3, prExtend}, // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL {0x0CE6, 0x0CEF, prNumeric}, // Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE {0x0CF1, 0x0CF2, prOLetter}, // Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA + {0x0CF3, 0x0CF3, prExtend}, // Mc KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT {0x0D00, 0x0D01, prExtend}, // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU {0x0D02, 0x0D03, prExtend}, // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA {0x0D04, 0x0D0C, prOLetter}, // Lo [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -896,7 +897,7 @@ var sentenceBreakCodePoints = [][3]int{ {0x0EBD, 0x0EBD, prOLetter}, // Lo LAO SEMIVOWEL SIGN NYO {0x0EC0, 0x0EC4, prOLetter}, // Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI {0x0EC6, 0x0EC6, prOLetter}, // Lm LAO KO LA - {0x0EC8, 0x0ECD, prExtend}, // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + {0x0EC8, 0x0ECE, prExtend}, // Mn [7] LAO TONE MAI EK..LAO YAMAKKAN {0x0ED0, 0x0ED9, prNumeric}, // Nd [10] LAO DIGIT ZERO..LAO DIGIT NINE {0x0EDC, 0x0EDF, prOLetter}, // Lo [4] LAO HO NO..LAO LETTER KHMU NYO {0x0F00, 0x0F00, prOLetter}, // Lo TIBETAN SYLLABLE OM @@ -958,7 +959,7 @@ var sentenceBreakCodePoints = [][3]int{ {0x10C7, 0x10C7, prUpper}, // L& GEORGIAN CAPITAL LETTER YN {0x10CD, 0x10CD, prUpper}, // L& GEORGIAN CAPITAL LETTER AEN {0x10D0, 0x10FA, prOLetter}, // L& [43] GEORGIAN LETTER AN..GEORGIAN LETTER AIN - {0x10FC, 0x10FC, prOLetter}, // Lm MODIFIER LETTER GEORGIAN NAR + {0x10FC, 0x10FC, prLower}, // Lm MODIFIER LETTER GEORGIAN NAR {0x10FD, 0x10FF, prOLetter}, // L& [3] GEORGIAN LETTER AEN..GEORGIAN LETTER LABIAL SIGN {0x1100, 0x1248, prOLetter}, // Lo [329] HANGUL CHOSEONG KIYEOK..ETHIOPIC SYLLABLE QWA {0x124A, 0x124D, prOLetter}, // Lo [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE @@ -2034,7 +2035,7 @@ var sentenceBreakCodePoints = [][3]int{ {0xA7D7, 0xA7D7, prLower}, // L& LATIN SMALL LETTER MIDDLE SCOTS S {0xA7D8, 0xA7D8, prUpper}, // L& LATIN CAPITAL LETTER SIGMOID S {0xA7D9, 0xA7D9, prLower}, // L& LATIN SMALL LETTER SIGMOID S - {0xA7F2, 0xA7F4, prOLetter}, // Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q + {0xA7F2, 0xA7F4, prLower}, // Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q {0xA7F5, 0xA7F5, prUpper}, // L& LATIN CAPITAL LETTER REVERSED HALF H {0xA7F6, 0xA7F6, prLower}, // L& LATIN SMALL LETTER REVERSED HALF H {0xA7F7, 0xA7F7, prOLetter}, // Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I @@ -2140,7 +2141,7 @@ var sentenceBreakCodePoints = [][3]int{ {0xAB30, 0xAB5A, prLower}, // L& [43] LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG {0xAB5C, 0xAB5F, prLower}, // Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK {0xAB60, 0xAB68, prLower}, // L& [9] LATIN SMALL LETTER SAKHA YAT..LATIN SMALL LETTER TURNED R WITH MIDDLE TILDE - {0xAB69, 0xAB69, prOLetter}, // Lm MODIFIER LETTER SMALL TURNED W + {0xAB69, 0xAB69, prLower}, // Lm MODIFIER LETTER SMALL TURNED W {0xAB70, 0xABBF, prLower}, // L& [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA {0xABC0, 0xABE2, prOLetter}, // Lo [35] MEETEI MAYEK LETTER KOK..MEETEI MAYEK LETTER I LONSUM {0xABE3, 0xABE4, prExtend}, // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP @@ -2334,6 +2335,7 @@ var sentenceBreakCodePoints = [][3]int{ {0x10E80, 0x10EA9, prOLetter}, // Lo [42] YEZIDI LETTER ELIF..YEZIDI LETTER ET {0x10EAB, 0x10EAC, prExtend}, // Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK {0x10EB0, 0x10EB1, prOLetter}, // Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE + {0x10EFD, 0x10EFF, prExtend}, // Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA {0x10F00, 0x10F1C, prOLetter}, // Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL {0x10F27, 0x10F27, prOLetter}, // Lo OLD SOGDIAN LIGATURE AYIN-DALETH {0x10F30, 0x10F45, prOLetter}, // Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -2408,6 +2410,8 @@ var sentenceBreakCodePoints = [][3]int{ {0x11238, 0x11239, prSTerm}, // Po [2] KHOJKI DANDA..KHOJKI DOUBLE DANDA {0x1123B, 0x1123C, prSTerm}, // Po [2] KHOJKI SECTION MARK..KHOJKI DOUBLE SECTION MARK {0x1123E, 0x1123E, prExtend}, // Mn KHOJKI SIGN SUKUN + {0x1123F, 0x11240, prOLetter}, // Lo [2] KHOJKI LETTER QA..KHOJKI LETTER SHORT I + {0x11241, 0x11241, prExtend}, // Mn KHOJKI VOWEL SIGN VOCALIC R {0x11280, 0x11286, prOLetter}, // Lo [7] MULTANI LETTER A..MULTANI LETTER GA {0x11288, 0x11288, prOLetter}, // Lo MULTANI LETTER GHA {0x1128A, 0x1128D, prOLetter}, // Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA @@ -2603,13 +2607,29 @@ var sentenceBreakCodePoints = [][3]int{ {0x11EF3, 0x11EF4, prExtend}, // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U {0x11EF5, 0x11EF6, prExtend}, // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O {0x11EF7, 0x11EF8, prSTerm}, // Po [2] MAKASAR PASSIMBANG..MAKASAR END OF SECTION + {0x11F00, 0x11F01, prExtend}, // Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA + {0x11F02, 0x11F02, prOLetter}, // Lo KAWI SIGN REPHA + {0x11F03, 0x11F03, prExtend}, // Mc KAWI SIGN VISARGA + {0x11F04, 0x11F10, prOLetter}, // Lo [13] KAWI LETTER A..KAWI LETTER O + {0x11F12, 0x11F33, prOLetter}, // Lo [34] KAWI LETTER KA..KAWI LETTER JNYA + {0x11F34, 0x11F35, prExtend}, // Mc [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA + {0x11F36, 0x11F3A, prExtend}, // Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R + {0x11F3E, 0x11F3F, prExtend}, // Mc [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI + {0x11F40, 0x11F40, prExtend}, // Mn KAWI VOWEL SIGN EU + {0x11F41, 0x11F41, prExtend}, // Mc KAWI SIGN KILLER + {0x11F42, 0x11F42, prExtend}, // Mn KAWI CONJOINER + {0x11F43, 0x11F44, prSTerm}, // Po [2] KAWI DANDA..KAWI DOUBLE DANDA + {0x11F50, 0x11F59, prNumeric}, // Nd [10] KAWI DIGIT ZERO..KAWI DIGIT NINE {0x11FB0, 0x11FB0, prOLetter}, // Lo LISU LETTER YHA {0x12000, 0x12399, prOLetter}, // Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U {0x12400, 0x1246E, prOLetter}, // Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM {0x12480, 0x12543, prOLetter}, // Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU {0x12F90, 0x12FF0, prOLetter}, // Lo [97] CYPRO-MINOAN SIGN CM001..CYPRO-MINOAN SIGN CM114 - {0x13000, 0x1342E, prOLetter}, // Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032 - {0x13430, 0x13438, prFormat}, // Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT + {0x13000, 0x1342F, prOLetter}, // Lo [1072] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH V011D + {0x13430, 0x1343F, prFormat}, // Cf [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE + {0x13440, 0x13440, prExtend}, // Mn EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY + {0x13441, 0x13446, prOLetter}, // Lo [6] EGYPTIAN HIEROGLYPH FULL BLANK..EGYPTIAN HIEROGLYPH WIDE LOST SIGN + {0x13447, 0x13455, prExtend}, // Mn [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED {0x14400, 0x14646, prOLetter}, // Lo [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530 {0x16800, 0x16A38, prOLetter}, // Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ {0x16A40, 0x16A5E, prOLetter}, // Lo [31] MRO LETTER TA..MRO LETTER TEK @@ -2648,7 +2668,9 @@ var sentenceBreakCodePoints = [][3]int{ {0x1AFF5, 0x1AFFB, prOLetter}, // Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 {0x1AFFD, 0x1AFFE, prOLetter}, // Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 {0x1B000, 0x1B122, prOLetter}, // Lo [291] KATAKANA LETTER ARCHAIC E..KATAKANA LETTER ARCHAIC WU + {0x1B132, 0x1B132, prOLetter}, // Lo HIRAGANA LETTER SMALL KO {0x1B150, 0x1B152, prOLetter}, // Lo [3] HIRAGANA LETTER SMALL WI..HIRAGANA LETTER SMALL WO + {0x1B155, 0x1B155, prOLetter}, // Lo KATAKANA LETTER SMALL KO {0x1B164, 0x1B167, prOLetter}, // Lo [4] KATAKANA LETTER SMALL WI..KATAKANA LETTER SMALL N {0x1B170, 0x1B2FB, prOLetter}, // Lo [396] NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB {0x1BC00, 0x1BC6A, prOLetter}, // Lo [107] DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M @@ -2738,11 +2760,14 @@ var sentenceBreakCodePoints = [][3]int{ {0x1DF00, 0x1DF09, prLower}, // L& [10] LATIN SMALL LETTER FENG DIGRAPH WITH TRILL..LATIN SMALL LETTER T WITH HOOK AND RETROFLEX HOOK {0x1DF0A, 0x1DF0A, prOLetter}, // Lo LATIN LETTER RETROFLEX CLICK WITH RETROFLEX HOOK {0x1DF0B, 0x1DF1E, prLower}, // L& [20] LATIN SMALL LETTER ESH WITH DOUBLE BAR..LATIN SMALL LETTER S WITH CURL + {0x1DF25, 0x1DF2A, prLower}, // L& [6] LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK {0x1E000, 0x1E006, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE {0x1E008, 0x1E018, prExtend}, // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU {0x1E01B, 0x1E021, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI {0x1E023, 0x1E024, prExtend}, // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS {0x1E026, 0x1E02A, prExtend}, // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + {0x1E030, 0x1E06D, prLower}, // Lm [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE + {0x1E08F, 0x1E08F, prExtend}, // Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I {0x1E100, 0x1E12C, prOLetter}, // Lo [45] NYIAKENG PUACHUE HMONG LETTER MA..NYIAKENG PUACHUE HMONG LETTER W {0x1E130, 0x1E136, prExtend}, // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D {0x1E137, 0x1E13D, prOLetter}, // Lm [7] NYIAKENG PUACHUE HMONG SIGN FOR PERSON..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER @@ -2753,6 +2778,10 @@ var sentenceBreakCodePoints = [][3]int{ {0x1E2C0, 0x1E2EB, prOLetter}, // Lo [44] WANCHO LETTER AA..WANCHO LETTER YIH {0x1E2EC, 0x1E2EF, prExtend}, // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI {0x1E2F0, 0x1E2F9, prNumeric}, // Nd [10] WANCHO DIGIT ZERO..WANCHO DIGIT NINE + {0x1E4D0, 0x1E4EA, prOLetter}, // Lo [27] NAG MUNDARI LETTER O..NAG MUNDARI LETTER ELL + {0x1E4EB, 0x1E4EB, prOLetter}, // Lm NAG MUNDARI SIGN OJOD + {0x1E4EC, 0x1E4EF, prExtend}, // Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH + {0x1E4F0, 0x1E4F9, prNumeric}, // Nd [10] NAG MUNDARI DIGIT ZERO..NAG MUNDARI DIGIT NINE {0x1E7E0, 0x1E7E6, prOLetter}, // Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO {0x1E7E8, 0x1E7EB, prOLetter}, // Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE {0x1E7ED, 0x1E7EE, prOLetter}, // Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -2803,12 +2832,13 @@ var sentenceBreakCodePoints = [][3]int{ {0x1F676, 0x1F678, prClose}, // So [3] SANS-SERIF HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT..SANS-SERIF HEAVY LOW DOUBLE COMMA QUOTATION MARK ORNAMENT {0x1FBF0, 0x1FBF9, prNumeric}, // Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE {0x20000, 0x2A6DF, prOLetter}, // Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF - {0x2A700, 0x2B738, prOLetter}, // Lo [4153] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B738 + {0x2A700, 0x2B739, prOLetter}, // Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 {0x2B740, 0x2B81D, prOLetter}, // Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D {0x2B820, 0x2CEA1, prOLetter}, // Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 {0x2CEB0, 0x2EBE0, prOLetter}, // Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 {0x2F800, 0x2FA1D, prOLetter}, // Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D {0x30000, 0x3134A, prOLetter}, // Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A + {0x31350, 0x323AF, prOLetter}, // Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF {0xE0001, 0xE0001, prFormat}, // Cf LANGUAGE TAG {0xE0020, 0xE007F, prExtend}, // Cf [96] TAG SPACE..CANCEL TAG {0xE0100, 0xE01EF, prExtend}, // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 diff --git a/vendor/github.com/rivo/uniseg/sentencerules.go b/vendor/github.com/rivo/uniseg/sentencerules.go index 58c04794e8..0b29c7bdb8 100644 --- a/vendor/github.com/rivo/uniseg/sentencerules.go +++ b/vendor/github.com/rivo/uniseg/sentencerules.go @@ -18,104 +18,178 @@ const ( sbSB8aSp ) -// The sentence break parser's breaking instructions. -const ( - sbDontBreak = iota - sbBreak -) - -// The sentence break parser's state transitions. It's anologous to -// grTransitions, see comments there for details. Unicode version 14.0.0. -var sbTransitions = map[[2]int][3]int{ +// sbTransitions implements the sentence break parser's state transitions. It's +// anologous to [grTransitions], see comments there for details. +// +// Unicode version 15.0.0. +func sbTransitions(state, prop int) (newState int, sentenceBreak bool, rule int) { + switch uint64(state) | uint64(prop)<<32 { // SB3. - {sbAny, prCR}: {sbCR, sbDontBreak, 9990}, - {sbCR, prLF}: {sbParaSep, sbDontBreak, 30}, + case sbAny | prCR<<32: + return sbCR, false, 9990 + case sbCR | prLF<<32: + return sbParaSep, false, 30 // SB4. - {sbAny, prSep}: {sbParaSep, sbDontBreak, 9990}, - {sbAny, prLF}: {sbParaSep, sbDontBreak, 9990}, - {sbParaSep, prAny}: {sbAny, sbBreak, 40}, - {sbCR, prAny}: {sbAny, sbBreak, 40}, + case sbAny | prSep<<32: + return sbParaSep, false, 9990 + case sbAny | prLF<<32: + return sbParaSep, false, 9990 + case sbParaSep | prAny<<32: + return sbAny, true, 40 + case sbCR | prAny<<32: + return sbAny, true, 40 // SB6. - {sbAny, prATerm}: {sbATerm, sbDontBreak, 9990}, - {sbATerm, prNumeric}: {sbAny, sbDontBreak, 60}, - {sbSB7, prNumeric}: {sbAny, sbDontBreak, 60}, // Because ATerm also appears in SB7. + case sbAny | prATerm<<32: + return sbATerm, false, 9990 + case sbATerm | prNumeric<<32: + return sbAny, false, 60 + case sbSB7 | prNumeric<<32: + return sbAny, false, 60 // Because ATerm also appears in SB7. // SB7. - {sbAny, prUpper}: {sbUpper, sbDontBreak, 9990}, - {sbAny, prLower}: {sbLower, sbDontBreak, 9990}, - {sbUpper, prATerm}: {sbSB7, sbDontBreak, 70}, - {sbLower, prATerm}: {sbSB7, sbDontBreak, 70}, - {sbSB7, prUpper}: {sbUpper, sbDontBreak, 70}, + case sbAny | prUpper<<32: + return sbUpper, false, 9990 + case sbAny | prLower<<32: + return sbLower, false, 9990 + case sbUpper | prATerm<<32: + return sbSB7, false, 70 + case sbLower | prATerm<<32: + return sbSB7, false, 70 + case sbSB7 | prUpper<<32: + return sbUpper, false, 70 // SB8a. - {sbAny, prSTerm}: {sbSTerm, sbDontBreak, 9990}, - {sbATerm, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbATerm, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbATerm, prSTerm}: {sbSTerm, sbDontBreak, 81}, - {sbSB7, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbSB7, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbSB7, prSTerm}: {sbSTerm, sbDontBreak, 81}, - {sbSB8Close, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbSB8Close, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbSB8Close, prSTerm}: {sbSTerm, sbDontBreak, 81}, - {sbSB8Sp, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbSB8Sp, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbSB8Sp, prSTerm}: {sbSTerm, sbDontBreak, 81}, - {sbSTerm, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbSTerm, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbSTerm, prSTerm}: {sbSTerm, sbDontBreak, 81}, - {sbSB8aClose, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbSB8aClose, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbSB8aClose, prSTerm}: {sbSTerm, sbDontBreak, 81}, - {sbSB8aSp, prSContinue}: {sbAny, sbDontBreak, 81}, - {sbSB8aSp, prATerm}: {sbATerm, sbDontBreak, 81}, - {sbSB8aSp, prSTerm}: {sbSTerm, sbDontBreak, 81}, + case sbAny | prSTerm<<32: + return sbSTerm, false, 9990 + case sbATerm | prSContinue<<32: + return sbAny, false, 81 + case sbATerm | prATerm<<32: + return sbATerm, false, 81 + case sbATerm | prSTerm<<32: + return sbSTerm, false, 81 + case sbSB7 | prSContinue<<32: + return sbAny, false, 81 + case sbSB7 | prATerm<<32: + return sbATerm, false, 81 + case sbSB7 | prSTerm<<32: + return sbSTerm, false, 81 + case sbSB8Close | prSContinue<<32: + return sbAny, false, 81 + case sbSB8Close | prATerm<<32: + return sbATerm, false, 81 + case sbSB8Close | prSTerm<<32: + return sbSTerm, false, 81 + case sbSB8Sp | prSContinue<<32: + return sbAny, false, 81 + case sbSB8Sp | prATerm<<32: + return sbATerm, false, 81 + case sbSB8Sp | prSTerm<<32: + return sbSTerm, false, 81 + case sbSTerm | prSContinue<<32: + return sbAny, false, 81 + case sbSTerm | prATerm<<32: + return sbATerm, false, 81 + case sbSTerm | prSTerm<<32: + return sbSTerm, false, 81 + case sbSB8aClose | prSContinue<<32: + return sbAny, false, 81 + case sbSB8aClose | prATerm<<32: + return sbATerm, false, 81 + case sbSB8aClose | prSTerm<<32: + return sbSTerm, false, 81 + case sbSB8aSp | prSContinue<<32: + return sbAny, false, 81 + case sbSB8aSp | prATerm<<32: + return sbATerm, false, 81 + case sbSB8aSp | prSTerm<<32: + return sbSTerm, false, 81 // SB9. - {sbATerm, prClose}: {sbSB8Close, sbDontBreak, 90}, - {sbSB7, prClose}: {sbSB8Close, sbDontBreak, 90}, - {sbSB8Close, prClose}: {sbSB8Close, sbDontBreak, 90}, - {sbATerm, prSp}: {sbSB8Sp, sbDontBreak, 90}, - {sbSB7, prSp}: {sbSB8Sp, sbDontBreak, 90}, - {sbSB8Close, prSp}: {sbSB8Sp, sbDontBreak, 90}, - {sbSTerm, prClose}: {sbSB8aClose, sbDontBreak, 90}, - {sbSB8aClose, prClose}: {sbSB8aClose, sbDontBreak, 90}, - {sbSTerm, prSp}: {sbSB8aSp, sbDontBreak, 90}, - {sbSB8aClose, prSp}: {sbSB8aSp, sbDontBreak, 90}, - {sbATerm, prSep}: {sbParaSep, sbDontBreak, 90}, - {sbATerm, prCR}: {sbParaSep, sbDontBreak, 90}, - {sbATerm, prLF}: {sbParaSep, sbDontBreak, 90}, - {sbSB7, prSep}: {sbParaSep, sbDontBreak, 90}, - {sbSB7, prCR}: {sbParaSep, sbDontBreak, 90}, - {sbSB7, prLF}: {sbParaSep, sbDontBreak, 90}, - {sbSB8Close, prSep}: {sbParaSep, sbDontBreak, 90}, - {sbSB8Close, prCR}: {sbParaSep, sbDontBreak, 90}, - {sbSB8Close, prLF}: {sbParaSep, sbDontBreak, 90}, - {sbSTerm, prSep}: {sbParaSep, sbDontBreak, 90}, - {sbSTerm, prCR}: {sbParaSep, sbDontBreak, 90}, - {sbSTerm, prLF}: {sbParaSep, sbDontBreak, 90}, - {sbSB8aClose, prSep}: {sbParaSep, sbDontBreak, 90}, - {sbSB8aClose, prCR}: {sbParaSep, sbDontBreak, 90}, - {sbSB8aClose, prLF}: {sbParaSep, sbDontBreak, 90}, + case sbATerm | prClose<<32: + return sbSB8Close, false, 90 + case sbSB7 | prClose<<32: + return sbSB8Close, false, 90 + case sbSB8Close | prClose<<32: + return sbSB8Close, false, 90 + case sbATerm | prSp<<32: + return sbSB8Sp, false, 90 + case sbSB7 | prSp<<32: + return sbSB8Sp, false, 90 + case sbSB8Close | prSp<<32: + return sbSB8Sp, false, 90 + case sbSTerm | prClose<<32: + return sbSB8aClose, false, 90 + case sbSB8aClose | prClose<<32: + return sbSB8aClose, false, 90 + case sbSTerm | prSp<<32: + return sbSB8aSp, false, 90 + case sbSB8aClose | prSp<<32: + return sbSB8aSp, false, 90 + case sbATerm | prSep<<32: + return sbParaSep, false, 90 + case sbATerm | prCR<<32: + return sbParaSep, false, 90 + case sbATerm | prLF<<32: + return sbParaSep, false, 90 + case sbSB7 | prSep<<32: + return sbParaSep, false, 90 + case sbSB7 | prCR<<32: + return sbParaSep, false, 90 + case sbSB7 | prLF<<32: + return sbParaSep, false, 90 + case sbSB8Close | prSep<<32: + return sbParaSep, false, 90 + case sbSB8Close | prCR<<32: + return sbParaSep, false, 90 + case sbSB8Close | prLF<<32: + return sbParaSep, false, 90 + case sbSTerm | prSep<<32: + return sbParaSep, false, 90 + case sbSTerm | prCR<<32: + return sbParaSep, false, 90 + case sbSTerm | prLF<<32: + return sbParaSep, false, 90 + case sbSB8aClose | prSep<<32: + return sbParaSep, false, 90 + case sbSB8aClose | prCR<<32: + return sbParaSep, false, 90 + case sbSB8aClose | prLF<<32: + return sbParaSep, false, 90 // SB10. - {sbSB8Sp, prSp}: {sbSB8Sp, sbDontBreak, 100}, - {sbSB8aSp, prSp}: {sbSB8aSp, sbDontBreak, 100}, - {sbSB8Sp, prSep}: {sbParaSep, sbDontBreak, 100}, - {sbSB8Sp, prCR}: {sbParaSep, sbDontBreak, 100}, - {sbSB8Sp, prLF}: {sbParaSep, sbDontBreak, 100}, + case sbSB8Sp | prSp<<32: + return sbSB8Sp, false, 100 + case sbSB8aSp | prSp<<32: + return sbSB8aSp, false, 100 + case sbSB8Sp | prSep<<32: + return sbParaSep, false, 100 + case sbSB8Sp | prCR<<32: + return sbParaSep, false, 100 + case sbSB8Sp | prLF<<32: + return sbParaSep, false, 100 // SB11. - {sbATerm, prAny}: {sbAny, sbBreak, 110}, - {sbSB7, prAny}: {sbAny, sbBreak, 110}, - {sbSB8Close, prAny}: {sbAny, sbBreak, 110}, - {sbSB8Sp, prAny}: {sbAny, sbBreak, 110}, - {sbSTerm, prAny}: {sbAny, sbBreak, 110}, - {sbSB8aClose, prAny}: {sbAny, sbBreak, 110}, - {sbSB8aSp, prAny}: {sbAny, sbBreak, 110}, + case sbATerm | prAny<<32: + return sbAny, true, 110 + case sbSB7 | prAny<<32: + return sbAny, true, 110 + case sbSB8Close | prAny<<32: + return sbAny, true, 110 + case sbSB8Sp | prAny<<32: + return sbAny, true, 110 + case sbSTerm | prAny<<32: + return sbAny, true, 110 + case sbSB8aClose | prAny<<32: + return sbAny, true, 110 + case sbSB8aSp | prAny<<32: + return sbAny, true, 110 // We'll always break after ParaSep due to SB4. + + default: + return -1, false, -1 + } } // transitionSentenceBreakState determines the new state of the sentence break @@ -141,30 +215,27 @@ func transitionSentenceBreakState(state int, r rune, b []byte, str string) (newS // Find the applicable transition in the table. var rule int - transition, ok := sbTransitions[[2]int{state, nextProperty}] - if ok { - // We have a specific transition. We'll use it. - newState, sentenceBreak, rule = transition[0], transition[1] == sbBreak, transition[2] - } else { + newState, sentenceBreak, rule = sbTransitions(state, nextProperty) + if newState < 0 { // No specific transition found. Try the less specific ones. - transAnyProp, okAnyProp := sbTransitions[[2]int{state, prAny}] - transAnyState, okAnyState := sbTransitions[[2]int{sbAny, nextProperty}] - if okAnyProp && okAnyState { + anyPropState, anyPropProp, anyPropRule := sbTransitions(state, prAny) + anyStateState, anyStateProp, anyStateRule := sbTransitions(sbAny, nextProperty) + if anyPropState >= 0 && anyStateState >= 0 { // Both apply. We'll use a mix (see comments for grTransitions). - newState, sentenceBreak, rule = transAnyState[0], transAnyState[1] == sbBreak, transAnyState[2] - if transAnyProp[2] < transAnyState[2] { - sentenceBreak, rule = transAnyProp[1] == sbBreak, transAnyProp[2] + newState, sentenceBreak, rule = anyStateState, anyStateProp, anyStateRule + if anyPropRule < anyStateRule { + sentenceBreak, rule = anyPropProp, anyPropRule } - } else if okAnyProp { + } else if anyPropState >= 0 { // We only have a specific state. - newState, sentenceBreak, rule = transAnyProp[0], transAnyProp[1] == sbBreak, transAnyProp[2] + newState, sentenceBreak, rule = anyPropState, anyPropProp, anyPropRule // This branch will probably never be reached because okAnyState will // always be true given the current transition map. But we keep it here // for future modifications to the transition map where this may not be // true anymore. - } else if okAnyState { + } else if anyStateState >= 0 { // We only have a specific property. - newState, sentenceBreak, rule = transAnyState[0], transAnyState[1] == sbBreak, transAnyState[2] + newState, sentenceBreak, rule = anyStateState, anyStateProp, anyStateRule } else { // No known transition. SB999: Any × Any. newState, sentenceBreak, rule = sbAny, false, 9990 diff --git a/vendor/github.com/rivo/uniseg/step.go b/vendor/github.com/rivo/uniseg/step.go index 6eca4b5dc7..9b72c5e596 100644 --- a/vendor/github.com/rivo/uniseg/step.go +++ b/vendor/github.com/rivo/uniseg/step.go @@ -100,7 +100,7 @@ func Step(b []byte, state int) (cluster, rest []byte, boundaries int, newState i if len(b) <= length { // If we're already past the end, there is nothing else to parse. var prop int if state < 0 { - prop = property(graphemeCodePoints, r) + prop = propertyGraphemes(r) } else { prop = state >> shiftPropState } @@ -150,16 +150,14 @@ func Step(b []byte, state int) (cluster, rest []byte, boundaries int, newState i return b[:length], b[length:], boundary, graphemeState | (wordState << shiftWordState) | (sentenceState << shiftSentenceState) | (lineState << shiftLineState) | (prop << shiftPropState) } - if r == vs16 { - width = 2 - } else if firstProp != prExtendedPictographic && firstProp != prRegionalIndicator && firstProp != prL { - width += runeWidth(r, prop) - } else if firstProp == prExtendedPictographic { + if firstProp == prExtendedPictographic { if r == vs15 { width = 1 - } else { + } else if r == vs16 { width = 2 } + } else if firstProp != prRegionalIndicator && firstProp != prL { + width += runeWidth(r, prop) } length += l @@ -179,7 +177,7 @@ func StepString(str string, state int) (cluster, rest string, boundaries int, ne // Extract the first rune. r, length := utf8.DecodeRuneInString(str) if len(str) <= length { // If we're already past the end, there is nothing else to parse. - prop := property(graphemeCodePoints, r) + prop := propertyGraphemes(r) return str, "", LineMustBreak | (1 << shiftWord) | (1 << shiftSentence) | (runeWidth(r, prop) << ShiftWidth), grAny | (wbAny << shiftWordState) | (sbAny << shiftSentenceState) | (lbAny << shiftLineState) } @@ -226,16 +224,14 @@ func StepString(str string, state int) (cluster, rest string, boundaries int, ne return str[:length], str[length:], boundary, graphemeState | (wordState << shiftWordState) | (sentenceState << shiftSentenceState) | (lineState << shiftLineState) | (prop << shiftPropState) } - if r == vs16 { - width = 2 - } else if firstProp != prExtendedPictographic && firstProp != prRegionalIndicator && firstProp != prL { - width += runeWidth(r, prop) - } else if firstProp == prExtendedPictographic { + if firstProp == prExtendedPictographic { if r == vs15 { width = 1 - } else { + } else if r == vs16 { width = 2 } + } else if firstProp != prRegionalIndicator && firstProp != prL { + width += runeWidth(r, prop) } length += l diff --git a/vendor/github.com/rivo/uniseg/width.go b/vendor/github.com/rivo/uniseg/width.go index 12a57cc2e3..975a9f1343 100644 --- a/vendor/github.com/rivo/uniseg/width.go +++ b/vendor/github.com/rivo/uniseg/width.go @@ -1,5 +1,10 @@ package uniseg +// EastAsianAmbiguousWidth specifies the monospace width for East Asian +// characters classified as Ambiguous. The default is 1 but some rare fonts +// render them with a width of 2. +var EastAsianAmbiguousWidth = 1 + // runeWidth returns the monospace width for the given rune. The provided // grapheme property is a value mapped by the [graphemeCodePoints] table. // @@ -33,9 +38,11 @@ func runeWidth(r rune, graphemeProperty int) int { return 4 } - switch property(eastAsianWidth, r) { + switch propertyEastAsianWidth(r) { case prW, prF: return 2 + case prA: + return EastAsianAmbiguousWidth } return 1 diff --git a/vendor/github.com/rivo/uniseg/wordproperties.go b/vendor/github.com/rivo/uniseg/wordproperties.go index 805cc536cb..277ca10068 100644 --- a/vendor/github.com/rivo/uniseg/wordproperties.go +++ b/vendor/github.com/rivo/uniseg/wordproperties.go @@ -1,13 +1,13 @@ -package uniseg - // Code generated via go generate from gen_properties.go. DO NOT EDIT. +package uniseg + // workBreakCodePoints are taken from -// https://www.unicode.org/Public/14.0.0/ucd/auxiliary/WordBreakProperty.txt +// https://www.unicode.org/Public/15.0.0/ucd/auxiliary/WordBreakProperty.txt // and -// https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt +// https://unicode.org/Public/15.0.0/ucd/emoji/emoji-data.txt // ("Extended_Pictographic" only) -// on September 10, 2022. See https://www.unicode.org/license.html for the Unicode +// on September 5, 2023. See https://www.unicode.org/license.html for the Unicode // license agreement. var workBreakCodePoints = [][3]int{ {0x000A, 0x000A, prLF}, // Cc @@ -318,6 +318,7 @@ var workBreakCodePoints = [][3]int{ {0x0CE2, 0x0CE3, prExtend}, // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL {0x0CE6, 0x0CEF, prNumeric}, // Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE {0x0CF1, 0x0CF2, prALetter}, // Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA + {0x0CF3, 0x0CF3, prExtend}, // Mc KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT {0x0D00, 0x0D01, prExtend}, // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU {0x0D02, 0x0D03, prExtend}, // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA {0x0D04, 0x0D0C, prALetter}, // Lo [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -357,7 +358,7 @@ var workBreakCodePoints = [][3]int{ {0x0E50, 0x0E59, prNumeric}, // Nd [10] THAI DIGIT ZERO..THAI DIGIT NINE {0x0EB1, 0x0EB1, prExtend}, // Mn LAO VOWEL SIGN MAI KAN {0x0EB4, 0x0EBC, prExtend}, // Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO - {0x0EC8, 0x0ECD, prExtend}, // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + {0x0EC8, 0x0ECE, prExtend}, // Mn [7] LAO TONE MAI EK..LAO YAMAKKAN {0x0ED0, 0x0ED9, prNumeric}, // Nd [10] LAO DIGIT ZERO..LAO DIGIT NINE {0x0F00, 0x0F00, prALetter}, // Lo TIBETAN SYLLABLE OM {0x0F18, 0x0F19, prExtend}, // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS @@ -1093,6 +1094,7 @@ var workBreakCodePoints = [][3]int{ {0x10E80, 0x10EA9, prALetter}, // Lo [42] YEZIDI LETTER ELIF..YEZIDI LETTER ET {0x10EAB, 0x10EAC, prExtend}, // Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK {0x10EB0, 0x10EB1, prALetter}, // Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE + {0x10EFD, 0x10EFF, prExtend}, // Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA {0x10F00, 0x10F1C, prALetter}, // Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL {0x10F27, 0x10F27, prALetter}, // Lo OLD SOGDIAN LIGATURE AYIN-DALETH {0x10F30, 0x10F45, prALetter}, // Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -1157,6 +1159,8 @@ var workBreakCodePoints = [][3]int{ {0x11235, 0x11235, prExtend}, // Mc KHOJKI SIGN VIRAMA {0x11236, 0x11237, prExtend}, // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA {0x1123E, 0x1123E, prExtend}, // Mn KHOJKI SIGN SUKUN + {0x1123F, 0x11240, prALetter}, // Lo [2] KHOJKI LETTER QA..KHOJKI LETTER SHORT I + {0x11241, 0x11241, prExtend}, // Mn KHOJKI VOWEL SIGN VOCALIC R {0x11280, 0x11286, prALetter}, // Lo [7] MULTANI LETTER A..MULTANI LETTER GA {0x11288, 0x11288, prALetter}, // Lo MULTANI LETTER GHA {0x1128A, 0x1128D, prALetter}, // Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA @@ -1337,13 +1341,28 @@ var workBreakCodePoints = [][3]int{ {0x11EE0, 0x11EF2, prALetter}, // Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA {0x11EF3, 0x11EF4, prExtend}, // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U {0x11EF5, 0x11EF6, prExtend}, // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O + {0x11F00, 0x11F01, prExtend}, // Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA + {0x11F02, 0x11F02, prALetter}, // Lo KAWI SIGN REPHA + {0x11F03, 0x11F03, prExtend}, // Mc KAWI SIGN VISARGA + {0x11F04, 0x11F10, prALetter}, // Lo [13] KAWI LETTER A..KAWI LETTER O + {0x11F12, 0x11F33, prALetter}, // Lo [34] KAWI LETTER KA..KAWI LETTER JNYA + {0x11F34, 0x11F35, prExtend}, // Mc [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA + {0x11F36, 0x11F3A, prExtend}, // Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R + {0x11F3E, 0x11F3F, prExtend}, // Mc [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI + {0x11F40, 0x11F40, prExtend}, // Mn KAWI VOWEL SIGN EU + {0x11F41, 0x11F41, prExtend}, // Mc KAWI SIGN KILLER + {0x11F42, 0x11F42, prExtend}, // Mn KAWI CONJOINER + {0x11F50, 0x11F59, prNumeric}, // Nd [10] KAWI DIGIT ZERO..KAWI DIGIT NINE {0x11FB0, 0x11FB0, prALetter}, // Lo LISU LETTER YHA {0x12000, 0x12399, prALetter}, // Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U {0x12400, 0x1246E, prALetter}, // Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM {0x12480, 0x12543, prALetter}, // Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU {0x12F90, 0x12FF0, prALetter}, // Lo [97] CYPRO-MINOAN SIGN CM001..CYPRO-MINOAN SIGN CM114 - {0x13000, 0x1342E, prALetter}, // Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032 - {0x13430, 0x13438, prFormat}, // Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT + {0x13000, 0x1342F, prALetter}, // Lo [1072] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH V011D + {0x13430, 0x1343F, prFormat}, // Cf [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE + {0x13440, 0x13440, prExtend}, // Mn EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY + {0x13441, 0x13446, prALetter}, // Lo [6] EGYPTIAN HIEROGLYPH FULL BLANK..EGYPTIAN HIEROGLYPH WIDE LOST SIGN + {0x13447, 0x13455, prExtend}, // Mn [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED {0x14400, 0x14646, prALetter}, // Lo [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530 {0x16800, 0x16A38, prALetter}, // Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ {0x16A40, 0x16A5E, prALetter}, // Lo [31] MRO LETTER TA..MRO LETTER TEK @@ -1374,6 +1393,7 @@ var workBreakCodePoints = [][3]int{ {0x1AFFD, 0x1AFFE, prKatakana}, // Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 {0x1B000, 0x1B000, prKatakana}, // Lo KATAKANA LETTER ARCHAIC E {0x1B120, 0x1B122, prKatakana}, // Lo [3] KATAKANA LETTER ARCHAIC YI..KATAKANA LETTER ARCHAIC WU + {0x1B155, 0x1B155, prKatakana}, // Lo KATAKANA LETTER SMALL KO {0x1B164, 0x1B167, prKatakana}, // Lo [4] KATAKANA LETTER SMALL WI..KATAKANA LETTER SMALL N {0x1BC00, 0x1BC6A, prALetter}, // Lo [107] DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M {0x1BC70, 0x1BC7C, prALetter}, // Lo [13] DUPLOYAN AFFIX LEFT HORIZONTAL SECANT..DUPLOYAN AFFIX ATTACHED TANGENT HOOK @@ -1431,11 +1451,14 @@ var workBreakCodePoints = [][3]int{ {0x1DF00, 0x1DF09, prALetter}, // L& [10] LATIN SMALL LETTER FENG DIGRAPH WITH TRILL..LATIN SMALL LETTER T WITH HOOK AND RETROFLEX HOOK {0x1DF0A, 0x1DF0A, prALetter}, // Lo LATIN LETTER RETROFLEX CLICK WITH RETROFLEX HOOK {0x1DF0B, 0x1DF1E, prALetter}, // L& [20] LATIN SMALL LETTER ESH WITH DOUBLE BAR..LATIN SMALL LETTER S WITH CURL + {0x1DF25, 0x1DF2A, prALetter}, // L& [6] LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK {0x1E000, 0x1E006, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE {0x1E008, 0x1E018, prExtend}, // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU {0x1E01B, 0x1E021, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI {0x1E023, 0x1E024, prExtend}, // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS {0x1E026, 0x1E02A, prExtend}, // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + {0x1E030, 0x1E06D, prALetter}, // Lm [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE + {0x1E08F, 0x1E08F, prExtend}, // Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I {0x1E100, 0x1E12C, prALetter}, // Lo [45] NYIAKENG PUACHUE HMONG LETTER MA..NYIAKENG PUACHUE HMONG LETTER W {0x1E130, 0x1E136, prExtend}, // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D {0x1E137, 0x1E13D, prALetter}, // Lm [7] NYIAKENG PUACHUE HMONG SIGN FOR PERSON..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER @@ -1446,6 +1469,10 @@ var workBreakCodePoints = [][3]int{ {0x1E2C0, 0x1E2EB, prALetter}, // Lo [44] WANCHO LETTER AA..WANCHO LETTER YIH {0x1E2EC, 0x1E2EF, prExtend}, // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI {0x1E2F0, 0x1E2F9, prNumeric}, // Nd [10] WANCHO DIGIT ZERO..WANCHO DIGIT NINE + {0x1E4D0, 0x1E4EA, prALetter}, // Lo [27] NAG MUNDARI LETTER O..NAG MUNDARI LETTER ELL + {0x1E4EB, 0x1E4EB, prALetter}, // Lm NAG MUNDARI SIGN OJOD + {0x1E4EC, 0x1E4EF, prExtend}, // Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH + {0x1E4F0, 0x1E4F9, prNumeric}, // Nd [10] NAG MUNDARI DIGIT ZERO..NAG MUNDARI DIGIT NINE {0x1E7E0, 0x1E7E6, prALetter}, // Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO {0x1E7E8, 0x1E7EB, prALetter}, // Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE {0x1E7ED, 0x1E7EE, prALetter}, // Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -1740,7 +1767,8 @@ var workBreakCodePoints = [][3]int{ {0x1F6D3, 0x1F6D4, prExtendedPictographic}, // E0.0 [2] (🛓..🛔) STUPA..PAGODA {0x1F6D5, 0x1F6D5, prExtendedPictographic}, // E12.0 [1] (🛕) hindu temple {0x1F6D6, 0x1F6D7, prExtendedPictographic}, // E13.0 [2] (🛖..🛗) hut..elevator - {0x1F6D8, 0x1F6DC, prExtendedPictographic}, // E0.0 [5] (🛘..🛜) .. + {0x1F6D8, 0x1F6DB, prExtendedPictographic}, // E0.0 [4] (🛘..🛛) .. + {0x1F6DC, 0x1F6DC, prExtendedPictographic}, // E15.0 [1] (🛜) wireless {0x1F6DD, 0x1F6DF, prExtendedPictographic}, // E14.0 [3] (ðŸ›..🛟) playground slide..ring buoy {0x1F6E0, 0x1F6E5, prExtendedPictographic}, // E0.7 [6] (🛠ï¸..🛥ï¸) hammer and wrench..motor boat {0x1F6E6, 0x1F6E8, prExtendedPictographic}, // E0.0 [3] (🛦..🛨) UP-POINTING MILITARY AIRPLANE..UP-POINTING SMALL AIRPLANE @@ -1757,7 +1785,7 @@ var workBreakCodePoints = [][3]int{ {0x1F6FA, 0x1F6FA, prExtendedPictographic}, // E12.0 [1] (🛺) auto rickshaw {0x1F6FB, 0x1F6FC, prExtendedPictographic}, // E13.0 [2] (🛻..🛼) pickup truck..roller skate {0x1F6FD, 0x1F6FF, prExtendedPictographic}, // E0.0 [3] (🛽..🛿) .. - {0x1F774, 0x1F77F, prExtendedPictographic}, // E0.0 [12] (ðŸ´..ðŸ¿) .. + {0x1F774, 0x1F77F, prExtendedPictographic}, // E0.0 [12] (ðŸ´..ðŸ¿) LOT OF FORTUNE..ORCUS {0x1F7D5, 0x1F7DF, prExtendedPictographic}, // E0.0 [11] (🟕..🟟) CIRCLED TRIANGLE.. {0x1F7E0, 0x1F7EB, prExtendedPictographic}, // E12.0 [12] (🟠..🟫) orange circle..brown square {0x1F7EC, 0x1F7EF, prExtendedPictographic}, // E0.0 [4] (🟬..🟯) .. @@ -1816,30 +1844,37 @@ var workBreakCodePoints = [][3]int{ {0x1FA00, 0x1FA6F, prExtendedPictographic}, // E0.0 [112] (🨀..🩯) NEUTRAL CHESS KING.. {0x1FA70, 0x1FA73, prExtendedPictographic}, // E12.0 [4] (🩰..🩳) ballet shoes..shorts {0x1FA74, 0x1FA74, prExtendedPictographic}, // E13.0 [1] (🩴) thong sandal - {0x1FA75, 0x1FA77, prExtendedPictographic}, // E0.0 [3] (🩵..🩷) .. + {0x1FA75, 0x1FA77, prExtendedPictographic}, // E15.0 [3] (🩵..🩷) light blue heart..pink heart {0x1FA78, 0x1FA7A, prExtendedPictographic}, // E12.0 [3] (🩸..🩺) drop of blood..stethoscope {0x1FA7B, 0x1FA7C, prExtendedPictographic}, // E14.0 [2] (🩻..🩼) x-ray..crutch {0x1FA7D, 0x1FA7F, prExtendedPictographic}, // E0.0 [3] (🩽..🩿) .. {0x1FA80, 0x1FA82, prExtendedPictographic}, // E12.0 [3] (🪀..🪂) yo-yo..parachute {0x1FA83, 0x1FA86, prExtendedPictographic}, // E13.0 [4] (🪃..🪆) boomerang..nesting dolls - {0x1FA87, 0x1FA8F, prExtendedPictographic}, // E0.0 [9] (🪇..ðŸª) .. + {0x1FA87, 0x1FA88, prExtendedPictographic}, // E15.0 [2] (🪇..🪈) maracas..flute + {0x1FA89, 0x1FA8F, prExtendedPictographic}, // E0.0 [7] (🪉..ðŸª) .. {0x1FA90, 0x1FA95, prExtendedPictographic}, // E12.0 [6] (ðŸª..🪕) ringed planet..banjo {0x1FA96, 0x1FAA8, prExtendedPictographic}, // E13.0 [19] (🪖..🪨) military helmet..rock {0x1FAA9, 0x1FAAC, prExtendedPictographic}, // E14.0 [4] (🪩..🪬) mirror ball..hamsa - {0x1FAAD, 0x1FAAF, prExtendedPictographic}, // E0.0 [3] (🪭..🪯) .. + {0x1FAAD, 0x1FAAF, prExtendedPictographic}, // E15.0 [3] (🪭..🪯) folding hand fan..khanda {0x1FAB0, 0x1FAB6, prExtendedPictographic}, // E13.0 [7] (🪰..🪶) fly..feather {0x1FAB7, 0x1FABA, prExtendedPictographic}, // E14.0 [4] (🪷..🪺) lotus..nest with eggs - {0x1FABB, 0x1FABF, prExtendedPictographic}, // E0.0 [5] (🪻..🪿) .. + {0x1FABB, 0x1FABD, prExtendedPictographic}, // E15.0 [3] (🪻..🪽) hyacinth..wing + {0x1FABE, 0x1FABE, prExtendedPictographic}, // E0.0 [1] (🪾) + {0x1FABF, 0x1FABF, prExtendedPictographic}, // E15.0 [1] (🪿) goose {0x1FAC0, 0x1FAC2, prExtendedPictographic}, // E13.0 [3] (🫀..🫂) anatomical heart..people hugging {0x1FAC3, 0x1FAC5, prExtendedPictographic}, // E14.0 [3] (🫃..🫅) pregnant man..person with crown - {0x1FAC6, 0x1FACF, prExtendedPictographic}, // E0.0 [10] (🫆..ðŸ«) .. + {0x1FAC6, 0x1FACD, prExtendedPictographic}, // E0.0 [8] (🫆..ðŸ«) .. + {0x1FACE, 0x1FACF, prExtendedPictographic}, // E15.0 [2] (🫎..ðŸ«) moose..donkey {0x1FAD0, 0x1FAD6, prExtendedPictographic}, // E13.0 [7] (ðŸ«..🫖) blueberries..teapot {0x1FAD7, 0x1FAD9, prExtendedPictographic}, // E14.0 [3] (🫗..🫙) pouring liquid..jar - {0x1FADA, 0x1FADF, prExtendedPictographic}, // E0.0 [6] (🫚..🫟) .. + {0x1FADA, 0x1FADB, prExtendedPictographic}, // E15.0 [2] (🫚..🫛) ginger root..pea pod + {0x1FADC, 0x1FADF, prExtendedPictographic}, // E0.0 [4] (🫜..🫟) .. {0x1FAE0, 0x1FAE7, prExtendedPictographic}, // E14.0 [8] (🫠..🫧) melting face..bubbles - {0x1FAE8, 0x1FAEF, prExtendedPictographic}, // E0.0 [8] (🫨..🫯) .. + {0x1FAE8, 0x1FAE8, prExtendedPictographic}, // E15.0 [1] (🫨) shaking face + {0x1FAE9, 0x1FAEF, prExtendedPictographic}, // E0.0 [7] (🫩..🫯) .. {0x1FAF0, 0x1FAF6, prExtendedPictographic}, // E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands - {0x1FAF7, 0x1FAFF, prExtendedPictographic}, // E0.0 [9] (🫷..🫿) .. + {0x1FAF7, 0x1FAF8, prExtendedPictographic}, // E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand + {0x1FAF9, 0x1FAFF, prExtendedPictographic}, // E0.0 [7] (🫹..🫿) .. {0x1FBF0, 0x1FBF9, prNumeric}, // Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE {0x1FC00, 0x1FFFD, prExtendedPictographic}, // E0.0[1022] (🰀..🿽) .. {0xE0001, 0xE0001, prFormat}, // Cf LANGUAGE TAG diff --git a/vendor/github.com/rivo/uniseg/wordrules.go b/vendor/github.com/rivo/uniseg/wordrules.go index 325407e40b..57a8c68311 100644 --- a/vendor/github.com/rivo/uniseg/wordrules.go +++ b/vendor/github.com/rivo/uniseg/wordrules.go @@ -22,82 +22,121 @@ const ( wbZWJBit = 16 // This bit is set for any states followed by at least one zero-width joiner (see WB4 and WB3c). ) -// The word break parser's breaking instructions. -const ( - wbDontBreak = iota - wbBreak -) - -// The word break parser's state transitions. It's anologous to grTransitions, -// see comments there for details. Unicode version 14.0.0. -var wbTransitions = map[[2]int][3]int{ +// wbTransitions implements the word break parser's state transitions. It's +// anologous to [grTransitions], see comments there for details. +// +// Unicode version 15.0.0. +func wbTransitions(state, prop int) (newState int, wordBreak bool, rule int) { + switch uint64(state) | uint64(prop)<<32 { // WB3b. - {wbAny, prNewline}: {wbNewline, wbBreak, 32}, - {wbAny, prCR}: {wbCR, wbBreak, 32}, - {wbAny, prLF}: {wbLF, wbBreak, 32}, + case wbAny | prNewline<<32: + return wbNewline, true, 32 + case wbAny | prCR<<32: + return wbCR, true, 32 + case wbAny | prLF<<32: + return wbLF, true, 32 // WB3a. - {wbNewline, prAny}: {wbAny, wbBreak, 31}, - {wbCR, prAny}: {wbAny, wbBreak, 31}, - {wbLF, prAny}: {wbAny, wbBreak, 31}, + case wbNewline | prAny<<32: + return wbAny, true, 31 + case wbCR | prAny<<32: + return wbAny, true, 31 + case wbLF | prAny<<32: + return wbAny, true, 31 // WB3. - {wbCR, prLF}: {wbLF, wbDontBreak, 30}, + case wbCR | prLF<<32: + return wbLF, false, 30 // WB3d. - {wbAny, prWSegSpace}: {wbWSegSpace, wbBreak, 9990}, - {wbWSegSpace, prWSegSpace}: {wbWSegSpace, wbDontBreak, 34}, + case wbAny | prWSegSpace<<32: + return wbWSegSpace, true, 9990 + case wbWSegSpace | prWSegSpace<<32: + return wbWSegSpace, false, 34 // WB5. - {wbAny, prALetter}: {wbALetter, wbBreak, 9990}, - {wbAny, prHebrewLetter}: {wbHebrewLetter, wbBreak, 9990}, - {wbALetter, prALetter}: {wbALetter, wbDontBreak, 50}, - {wbALetter, prHebrewLetter}: {wbHebrewLetter, wbDontBreak, 50}, - {wbHebrewLetter, prALetter}: {wbALetter, wbDontBreak, 50}, - {wbHebrewLetter, prHebrewLetter}: {wbHebrewLetter, wbDontBreak, 50}, + case wbAny | prALetter<<32: + return wbALetter, true, 9990 + case wbAny | prHebrewLetter<<32: + return wbHebrewLetter, true, 9990 + case wbALetter | prALetter<<32: + return wbALetter, false, 50 + case wbALetter | prHebrewLetter<<32: + return wbHebrewLetter, false, 50 + case wbHebrewLetter | prALetter<<32: + return wbALetter, false, 50 + case wbHebrewLetter | prHebrewLetter<<32: + return wbHebrewLetter, false, 50 // WB7. Transitions to wbWB7 handled by transitionWordBreakState(). - {wbWB7, prALetter}: {wbALetter, wbDontBreak, 70}, - {wbWB7, prHebrewLetter}: {wbHebrewLetter, wbDontBreak, 70}, + case wbWB7 | prALetter<<32: + return wbALetter, false, 70 + case wbWB7 | prHebrewLetter<<32: + return wbHebrewLetter, false, 70 // WB7a. - {wbHebrewLetter, prSingleQuote}: {wbAny, wbDontBreak, 71}, + case wbHebrewLetter | prSingleQuote<<32: + return wbAny, false, 71 // WB7c. Transitions to wbWB7c handled by transitionWordBreakState(). - {wbWB7c, prHebrewLetter}: {wbHebrewLetter, wbDontBreak, 73}, + case wbWB7c | prHebrewLetter<<32: + return wbHebrewLetter, false, 73 // WB8. - {wbAny, prNumeric}: {wbNumeric, wbBreak, 9990}, - {wbNumeric, prNumeric}: {wbNumeric, wbDontBreak, 80}, + case wbAny | prNumeric<<32: + return wbNumeric, true, 9990 + case wbNumeric | prNumeric<<32: + return wbNumeric, false, 80 // WB9. - {wbALetter, prNumeric}: {wbNumeric, wbDontBreak, 90}, - {wbHebrewLetter, prNumeric}: {wbNumeric, wbDontBreak, 90}, + case wbALetter | prNumeric<<32: + return wbNumeric, false, 90 + case wbHebrewLetter | prNumeric<<32: + return wbNumeric, false, 90 // WB10. - {wbNumeric, prALetter}: {wbALetter, wbDontBreak, 100}, - {wbNumeric, prHebrewLetter}: {wbHebrewLetter, wbDontBreak, 100}, + case wbNumeric | prALetter<<32: + return wbALetter, false, 100 + case wbNumeric | prHebrewLetter<<32: + return wbHebrewLetter, false, 100 // WB11. Transitions to wbWB11 handled by transitionWordBreakState(). - {wbWB11, prNumeric}: {wbNumeric, wbDontBreak, 110}, + case wbWB11 | prNumeric<<32: + return wbNumeric, false, 110 // WB13. - {wbAny, prKatakana}: {wbKatakana, wbBreak, 9990}, - {wbKatakana, prKatakana}: {wbKatakana, wbDontBreak, 130}, + case wbAny | prKatakana<<32: + return wbKatakana, true, 9990 + case wbKatakana | prKatakana<<32: + return wbKatakana, false, 130 // WB13a. - {wbAny, prExtendNumLet}: {wbExtendNumLet, wbBreak, 9990}, - {wbALetter, prExtendNumLet}: {wbExtendNumLet, wbDontBreak, 131}, - {wbHebrewLetter, prExtendNumLet}: {wbExtendNumLet, wbDontBreak, 131}, - {wbNumeric, prExtendNumLet}: {wbExtendNumLet, wbDontBreak, 131}, - {wbKatakana, prExtendNumLet}: {wbExtendNumLet, wbDontBreak, 131}, - {wbExtendNumLet, prExtendNumLet}: {wbExtendNumLet, wbDontBreak, 131}, + case wbAny | prExtendNumLet<<32: + return wbExtendNumLet, true, 9990 + case wbALetter | prExtendNumLet<<32: + return wbExtendNumLet, false, 131 + case wbHebrewLetter | prExtendNumLet<<32: + return wbExtendNumLet, false, 131 + case wbNumeric | prExtendNumLet<<32: + return wbExtendNumLet, false, 131 + case wbKatakana | prExtendNumLet<<32: + return wbExtendNumLet, false, 131 + case wbExtendNumLet | prExtendNumLet<<32: + return wbExtendNumLet, false, 131 // WB13b. - {wbExtendNumLet, prALetter}: {wbALetter, wbDontBreak, 132}, - {wbExtendNumLet, prHebrewLetter}: {wbHebrewLetter, wbDontBreak, 132}, - {wbExtendNumLet, prNumeric}: {wbNumeric, wbDontBreak, 132}, - {wbExtendNumLet, prKatakana}: {prKatakana, wbDontBreak, 132}, + case wbExtendNumLet | prALetter<<32: + return wbALetter, false, 132 + case wbExtendNumLet | prHebrewLetter<<32: + return wbHebrewLetter, false, 132 + case wbExtendNumLet | prNumeric<<32: + return wbNumeric, false, 132 + case wbExtendNumLet | prKatakana<<32: + return wbKatakana, false, 132 + + default: + return -1, false, -1 + } } // transitionWordBreakState determines the new state of the word break parser @@ -141,30 +180,27 @@ func transitionWordBreakState(state int, r rune, b []byte, str string) (newState // Find the applicable transition in the table. var rule int - transition, ok := wbTransitions[[2]int{state, nextProperty}] - if ok { - // We have a specific transition. We'll use it. - newState, wordBreak, rule = transition[0], transition[1] == wbBreak, transition[2] - } else { + newState, wordBreak, rule = wbTransitions(state, nextProperty) + if newState < 0 { // No specific transition found. Try the less specific ones. - transAnyProp, okAnyProp := wbTransitions[[2]int{state, prAny}] - transAnyState, okAnyState := wbTransitions[[2]int{wbAny, nextProperty}] - if okAnyProp && okAnyState { + anyPropState, anyPropWordBreak, anyPropRule := wbTransitions(state, prAny) + anyStateState, anyStateWordBreak, anyStateRule := wbTransitions(wbAny, nextProperty) + if anyPropState >= 0 && anyStateState >= 0 { // Both apply. We'll use a mix (see comments for grTransitions). - newState, wordBreak, rule = transAnyState[0], transAnyState[1] == wbBreak, transAnyState[2] - if transAnyProp[2] < transAnyState[2] { - wordBreak, rule = transAnyProp[1] == wbBreak, transAnyProp[2] + newState, wordBreak, rule = anyStateState, anyStateWordBreak, anyStateRule + if anyPropRule < anyStateRule { + wordBreak, rule = anyPropWordBreak, anyPropRule } - } else if okAnyProp { + } else if anyPropState >= 0 { // We only have a specific state. - newState, wordBreak, rule = transAnyProp[0], transAnyProp[1] == wbBreak, transAnyProp[2] + newState, wordBreak, rule = anyPropState, anyPropWordBreak, anyPropRule // This branch will probably never be reached because okAnyState will // always be true given the current transition map. But we keep it here // for future modifications to the transition map where this may not be // true anymore. - } else if okAnyState { + } else if anyStateState >= 0 { // We only have a specific property. - newState, wordBreak, rule = transAnyState[0], transAnyState[1] == wbBreak, transAnyState[2] + newState, wordBreak, rule = anyStateState, anyStateWordBreak, anyStateRule } else { // No known transition. WB999: Any ÷ Any. newState, wordBreak, rule = wbAny, true, 9990 diff --git a/vendor/modules.txt b/vendor/modules.txt index 3093c1f535..ec81fd299e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -531,12 +531,12 @@ github.com/imdario/mergo # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap -# github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 -## explicit; go 1.14 -github.com/itchyny/astgen-go -# github.com/itchyny/gojq v0.11.0 -## explicit; go 1.14 +# github.com/itchyny/gojq v0.12.15 +## explicit; go 1.20 github.com/itchyny/gojq +# github.com/itchyny/timefmt-go v0.1.5 +## explicit; go 1.17 +github.com/itchyny/timefmt-go # github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 ## explicit github.com/jbenet/go-context/io @@ -579,9 +579,6 @@ github.com/lann/builder # github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 ## explicit github.com/lann/ps -# github.com/lestrrat-go/strftime v1.0.1 -## explicit; go 1.12 -github.com/lestrrat-go/strftime # github.com/lib/pq v1.10.9 ## explicit; go 1.13 github.com/lib/pq @@ -598,7 +595,7 @@ github.com/mailru/easyjson/jwriter # github.com/mattn/go-colorable v0.1.13 ## explicit; go 1.15 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.17 +# github.com/mattn/go-isatty v0.0.20 ## explicit; go 1.15 github.com/mattn/go-isatty # github.com/mattn/go-runewidth v0.0.15 @@ -624,8 +621,8 @@ github.com/mitchellh/copystructure # github.com/mitchellh/go-wordwrap v1.0.1 ## explicit; go 1.14 github.com/mitchellh/go-wordwrap -# github.com/mitchellh/hashstructure v1.0.0 -## explicit +# github.com/mitchellh/hashstructure v1.1.0 +## explicit; go 1.14 github.com/mitchellh/hashstructure # github.com/mitchellh/mapstructure v1.5.0 ## explicit; go 1.14 @@ -887,9 +884,6 @@ github.com/operator-framework/operator-registry/pkg/sqlite/migrations # github.com/otiai10/copy v1.14.0 ## explicit; go 1.18 github.com/otiai10/copy -# github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 -## explicit -github.com/pbnjay/strptime # github.com/peterbourgon/diskv v2.0.1+incompatible ## explicit github.com/peterbourgon/diskv @@ -921,7 +915,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/rivo/uniseg v0.4.4 +# github.com/rivo/uniseg v0.4.7 ## explicit; go 1.18 github.com/rivo/uniseg # github.com/rubenv/sql-migrate v1.5.2 From 89fbf4de4c20112c141c140227523640c7fc5707 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Wed, 29 May 2024 09:23:54 +0200 Subject: [PATCH 5/9] re-enable seed and skip options for e2e (#3296) Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Upstream-repository: operator-lifecycle-manager Upstream-commit: 71056b532cdea2baa41e78d83635b9980fc0a49b --- staging/operator-lifecycle-manager/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/staging/operator-lifecycle-manager/Makefile b/staging/operator-lifecycle-manager/Makefile index a29b2b6acd..f54fb286fe 100644 --- a/staging/operator-lifecycle-manager/Makefile +++ b/staging/operator-lifecycle-manager/Makefile @@ -248,7 +248,7 @@ E2E_TEST_NS ?= operators E2E_INSTALL_NS ?= operator-lifecycle-manager E2E_CATALOG_NS ?= $(E2E_INSTALL_NS) E2E_FLAKE_ATTEMPTS ?= 1 -GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events --flake-attempts=$(E2E_FLAKE_ATTEMPTS) $(if $(TEST),-focus '$(TEST)',) +GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events --flake-attempts=$(E2E_FLAKE_ATTEMPTS) $(if $(E2E_SEED),-seed '$(E2E_SEED)') $(if $(TEST),-focus '$(TEST)',) $(if $(SKIP), -skip '$(SKIP)') .PHONY: e2e e2e: #HELP Run e2e tests against a cluster running OLM (params: $E2E_TEST_NS (operator), $E2E_INSTALL_NS (operator-lifecycle-manager), $E2E_CATALOG_NS (operator-lifecycle-manager), $E2E_TIMEOUT (90m), $E2E_FLAKE_ATTEMPTS (1), $TEST(undefined)) @@ -311,7 +311,6 @@ pull-opm: package: $(YQ) $(HELM) #HELP Package OLM for release package: OLM_RELEASE_IMG_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(RELEASE_VERSION)) package: OPM_IMAGE_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE)) ->>>>>>> a83c71d70 (:seedling: cleanup/tools (#3285)) package: ifndef TARGET $(error TARGET is undefined) From 1a29743f6e2584ca36cd2e2e1d593ffbe6bbfa38 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Thu, 30 May 2024 17:54:00 +0200 Subject: [PATCH 6/9] :seedling: update skopeo openshift test (#3298) * update skopeo openshift test Signed-off-by: Per Goncalves da Silva * patch subscription e2e flake Signed-off-by: Per Goncalves da Silva --------- Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Upstream-repository: operator-lifecycle-manager Upstream-commit: 37dcff4328d76e7307225bffb4620f3f1282d7c3 --- .../test/e2e/catalog_e2e_test.go | 12 ++-- .../test/e2e/skopeo.go | 67 ++++++++++++++----- .../test/e2e/subscription_e2e_test.go | 40 ++++------- 3 files changed, 69 insertions(+), 50 deletions(-) diff --git a/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go index 8f7d30399e..9886545d42 100644 --- a/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go @@ -823,7 +823,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { By("Create an image based catalog source from public Quay image using a unique tag as identifier") var registryURL string - var registryAuth string + var registryAuthSecretName string if local { By("Creating a local registry to use") registryURL, err = createDockerRegistry(c, generatedNamespace.GetName()) @@ -839,7 +839,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { } else { registryURL = fmt.Sprintf("%s/%s", openshiftregistryFQDN, generatedNamespace.GetName()) By("Using the OpenShift registry at " + registryURL) - registryAuth, err = openshiftRegistryAuth(c, generatedNamespace.GetName()) + registryAuthSecretName, err = getRegistryAuthSecretName(c, generatedNamespace.GetName()) Expect(err).NotTo(HaveOccurred(), "error getting openshift registry authentication: %s", err) } @@ -856,8 +856,8 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { Expect(err).NotTo(HaveOccurred(), "error copying old registry file: %s", err) } else { By("creating a skopoeo Pod to do the copying") - skopeoArgs := skopeoCopyCmd(testImage, tag, catsrcImage, "old", registryAuth) - err = createSkopeoPod(c, skopeoArgs, generatedNamespace.GetName()) + skopeoArgs := skopeoCopyCmd(testImage, tag, catsrcImage, "old", registryAuthSecretName) + err = createSkopeoPod(c, skopeoArgs, generatedNamespace.GetName(), registryAuthSecretName) Expect(err).NotTo(HaveOccurred(), "error creating skopeo pod: %s", err) By("waiting for the skopeo pod to exit successfully") @@ -951,8 +951,8 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { Expect(err).NotTo(HaveOccurred(), "error copying new registry file: %s", err) } else { By("creating a skopoeo Pod to do the copying") - skopeoArgs := skopeoCopyCmd(testImage, tag, catsrcImage, "new", registryAuth) - err = createSkopeoPod(c, skopeoArgs, generatedNamespace.GetName()) + skopeoArgs := skopeoCopyCmd(testImage, tag, catsrcImage, "new", registryAuthSecretName) + err = createSkopeoPod(c, skopeoArgs, generatedNamespace.GetName(), registryAuthSecretName) Expect(err).NotTo(HaveOccurred(), "error creating skopeo pod: %s", err) By("waiting for the skopeo pod to exit successfully") diff --git a/staging/operator-lifecycle-manager/test/e2e/skopeo.go b/staging/operator-lifecycle-manager/test/e2e/skopeo.go index a19dfcfe2a..184f291ee0 100644 --- a/staging/operator-lifecycle-manager/test/e2e/skopeo.go +++ b/staging/operator-lifecycle-manager/test/e2e/skopeo.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os/exec" + "path" "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient" "k8s.io/utils/ptr" @@ -18,14 +19,15 @@ const ( debug = "--debug" skipTLS = "--dest-tls-verify=false" skipCreds = "--dest-no-creds=true" - destCreds = "--dest-creds=" + destCreds = "--dest-authfile=" v2format = "--format=v2s2" - skopeoImage = "quay.io/olmtest/skopeo:0.1.40" + skopeoImage = "quay.io/skopeo/stable:v1.15.0" BuilderServiceAccount = "builder" + authPath = "/mnt/registry-auth" + cachePath = ".local" ) -func openshiftRegistryAuth(client operatorclient.ClientInterface, namespace string) (string, error) { - +func getRegistryAuthSecretName(client operatorclient.ClientInterface, namespace string) (string, error) { var sa *corev1.ServiceAccount var err error @@ -47,15 +49,7 @@ func openshiftRegistryAuth(client operatorclient.ClientInterface, namespace stri if err != nil { return "", err } - annotations := secret.Annotations - if annotations == nil { - return "", fmt.Errorf("annotations not present on builder secret") - } - - user := annotations["openshift.io/token-secret.name"] - pass := annotations["openshift.io/token-secret.value"] - - return fmt.Sprint(user, ":", pass), nil + return secret.GetName(), nil } func skopeoCopyCmd(newImage, newTag, oldImage, oldTag, auth string) []string { @@ -66,7 +60,7 @@ func skopeoCopyCmd(newImage, newTag, oldImage, oldTag, auth string) []string { if auth == "" { creds = skipCreds } else { - creds = fmt.Sprint(destCreds, auth) + creds = fmt.Sprint(destCreds, path.Join(cachePath, "auth.json")) } cmd := []string{debug, insecure, "copy", skipTLS, v2format, creds, oldImageName, newImageName} @@ -74,7 +68,7 @@ func skopeoCopyCmd(newImage, newTag, oldImage, oldTag, auth string) []string { return cmd } -func createSkopeoPod(client operatorclient.ClientInterface, args []string, namespace string) error { +func createSkopeoPod(client operatorclient.ClientInterface, args []string, namespace string, registrySecret string) error { pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: skopeo, @@ -93,12 +87,12 @@ func createSkopeoPod(client operatorclient.ClientInterface, args []string, names Image: skopeoImage, Args: args, SecurityContext: &corev1.SecurityContext{ - ReadOnlyRootFilesystem: ptr.To(bool(false)), - AllowPrivilegeEscalation: ptr.To(bool(false)), + ReadOnlyRootFilesystem: ptr.To(false), + AllowPrivilegeEscalation: ptr.To(false), Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{"ALL"}, }, - RunAsNonRoot: ptr.To(bool(true)), + RunAsNonRoot: ptr.To(true), RunAsUser: ptr.To(int64(1001)), }, }, @@ -108,6 +102,43 @@ func createSkopeoPod(client operatorclient.ClientInterface, args []string, names }, } + if registrySecret != "" { + // update container command to first convert the dockercfg to an auth.json file that skopeo can use + authJsonPath := path.Join(cachePath, "auth.json") + authJson := "\"{\\\"auths\\\": $(cat /mnt/registry-auth/.dockercfg)}\"" + cmd := fmt.Sprintf("echo %s > %s && exec skopeo $@", authJson, authJsonPath) + + pod.Spec.Containers[0].Command = []string{"bash", "-c", cmd} + + pod.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{ + { + Name: "registry-auth", + MountPath: authPath, + ReadOnly: true, + }, { + Name: "cache", + MountPath: cachePath, + ReadOnly: false, + }, + } + pod.Spec.Volumes = []corev1.Volume{ + { + Name: "registry-auth", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: registrySecret, + }, + }, + }, + { + Name: "cache", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + } + } + _, err := client.KubernetesInterface().CoreV1().Pods(namespace).Create(context.TODO(), pod, metav1.CreateOptions{}) if err != nil { return err diff --git a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go index 602cd9185d..4e32aaf1cd 100644 --- a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go @@ -2597,19 +2597,24 @@ var _ = Describe("Subscription", func() { err = magicCatalog.UpdateCatalog(context.Background(), provider) Expect(err).To(BeNil()) - By("waiting for the subscription to have v0.3.0 installed") + By("waiting for the subscription to switch to v0.3.0") sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCurrentCSV("example-operator.v0.3.0")) Expect(err).Should(BeNil()) - By("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition") + By("waiting for the subscription to have be at latest known") + sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionStateAtLatestChecker()) + Expect(err).Should(BeNil()) + + By("waiting for the subscription to have v0.3.0 installed without a bundle deprecated condition") sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, subscriptionHasCondition( - operatorsv1alpha1.SubscriptionPackageDeprecated, - corev1.ConditionTrue, + operatorsv1alpha1.SubscriptionInstallPlanPending, + corev1.ConditionUnknown, + "", "", - "olm.package/test-package: test-package has been deprecated. Please switch to another-package.", ), ) + Expect(err).Should(BeNil()) By("checking for the deprecated conditions") By(`Operator is deprecated at only Package and Channel levels`) @@ -2705,7 +2710,7 @@ var _ = Describe("Subscription", func() { } } else { registryURL = fmt.Sprintf("%s/%s", openshiftregistryFQDN, generatedNamespace.GetName()) - registryAuth, err := openshiftRegistryAuth(c, generatedNamespace.GetName()) + registryAuthSecretName, err := getRegistryAuthSecretName(c, generatedNamespace.GetName()) Expect(err).NotTo(HaveOccurred(), "error getting openshift registry authentication: %s", err) copyImage = func(dst, dstTag, src, srcTag string) error { if !strings.HasPrefix(src, "docker://") { @@ -2714,14 +2719,15 @@ var _ = Describe("Subscription", func() { if !strings.HasPrefix(dst, "docker://") { dst = fmt.Sprintf("docker://%s", dst) } - skopeoArgs := skopeoCopyCmd(dst, dstTag, src, srcTag, registryAuth) - err = createSkopeoPod(c, skopeoArgs, generatedNamespace.GetName()) + skopeoArgs := skopeoCopyCmd(dst, dstTag, src, srcTag, registryAuthSecretName) + err = createSkopeoPod(c, skopeoArgs, generatedNamespace.GetName(), registryAuthSecretName) if err != nil { return fmt.Errorf("error creating skopeo pod: %v", err) } By(`wait for skopeo pod to exit successfully`) awaitPod(GinkgoT(), c, generatedNamespace.GetName(), skopeo, func(pod *corev1.Pod) bool { + ctx.Ctx().Logf("skopeo pod status: %s (waiting for: %s)", pod.Status.Phase, corev1.PodSucceeded) return pod.Status.Phase == corev1.PodSucceeded }) @@ -3609,12 +3615,6 @@ func updateInternalCatalog(t GinkgoTInterface, c operatorclient.ClientInterface, require.NoError(t, err) } -func updateCatSrcPriority(crClient versioned.Interface, namespace string, catsrc *operatorsv1alpha1.CatalogSource, priority int) { - catsrc.Spec.Priority = priority - _, err := crClient.OperatorsV1alpha1().CatalogSources(namespace).Update(context.Background(), catsrc, metav1.UpdateOptions{}) - Expect(err).Should(BeNil()) -} - func subscriptionCurrentCSVGetter(crclient versioned.Interface, namespace, subName string) func() string { return func() string { subscription, err := crclient.OperatorsV1alpha1().Subscriptions(namespace).Get(context.Background(), subName, metav1.GetOptions{}) @@ -3624,15 +3624,3 @@ func subscriptionCurrentCSVGetter(crclient versioned.Interface, namespace, subNa return subscription.Status.CurrentCSV } } - -func operatorGroupServiceAccountNameSetter(crclient versioned.Interface, namespace, name, saName string) func() error { - return func() error { - toUpdate, err := crclient.OperatorsV1().OperatorGroups(namespace).Get(context.Background(), name, metav1.GetOptions{}) - if err != nil { - return err - } - toUpdate.Spec.ServiceAccountName = saName - _, err = crclient.OperatorsV1().OperatorGroups(namespace).Update(context.Background(), toUpdate, metav1.UpdateOptions{}) - return err - } -} From 0eeb2f1b3e7832f5774326e240d24d3b65cc75c3 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Sat, 1 Jun 2024 14:34:00 +0200 Subject: [PATCH 7/9] patch subscription e2e flake (#3302) Signed-off-by: Per Goncalves da Silva Co-authored-by: Per Goncalves da Silva Upstream-repository: operator-lifecycle-manager Upstream-commit: 1404e916dec89d24c5ecfe52fec7f8f093fb917d --- .../test/e2e/subscription_e2e_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go index 4e32aaf1cd..961d896d59 100644 --- a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go @@ -2616,14 +2616,23 @@ var _ = Describe("Subscription", func() { ) Expect(err).Should(BeNil()) + By("waiting for the subscription to have v0.3.0 installed without a bundle deprecated condition") + sub, err = fetchSubscription(crc, generatedNamespace.GetName(), subName, + subscriptionHasCondition( + operatorsv1alpha1.SubscriptionBundleDeprecated, + corev1.ConditionUnknown, + "", + "", + ), + ) + Expect(err).Should(BeNil()) + By("checking for the deprecated conditions") By(`Operator is deprecated at only Package and Channel levels`) packageCondition := sub.Status.GetCondition(operatorsv1alpha1.SubscriptionPackageDeprecated) Expect(packageCondition.Status).To(Equal(corev1.ConditionTrue)) channelCondition := sub.Status.GetCondition(operatorsv1alpha1.SubscriptionChannelDeprecated) Expect(channelCondition.Status).To(Equal(corev1.ConditionTrue)) - bundleCondition = sub.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleDeprecated) - Expect(bundleCondition.Status).To(Equal(corev1.ConditionUnknown)) By("verifying that a roll-up condition is present not containing bundle deprecation condition") By(`Roll-up condition should be present and contain deprecation messages from Package and Channel levels`) From d57288aa9814c86dbea02fa6b444549b2cc810a8 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Mon, 3 Jun 2024 14:08:01 +0200 Subject: [PATCH 8/9] [CARRY] moves staged bingo tools to go1.21 Signed-off-by: Per Goncalves da Silva --- .../.bingo/Variables.mk | 12 ++--- .../.bingo/bingo.mod | 4 +- .../.bingo/golangci-lint.mod | 4 +- .../.bingo/helm.mod | 6 +-- .../.bingo/helm.sum | 46 +++++++++++++++++++ .../.bingo/kind.mod | 4 +- .../.bingo/setup-envtest.mod | 6 +-- .../.bingo/setup-envtest.sum | 44 ++++++++++++++++++ .../.bingo/variables.env | 4 +- .../operator-lifecycle-manager/.bingo/yq.mod | 4 +- 10 files changed, 107 insertions(+), 27 deletions(-) diff --git a/staging/operator-lifecycle-manager/.bingo/Variables.mk b/staging/operator-lifecycle-manager/.bingo/Variables.mk index bf290d0395..7d85d069cf 100644 --- a/staging/operator-lifecycle-manager/.bingo/Variables.mk +++ b/staging/operator-lifecycle-manager/.bingo/Variables.mk @@ -29,11 +29,11 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod @echo "(re)installing $(GOBIN)/golangci-lint-v1.59.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.59.0 "github.com/golangci/golangci-lint/cmd/golangci-lint" -HELM := $(GOBIN)/helm-v3.15.1 +HELM := $(GOBIN)/helm-v3.14.3 $(HELM): $(BINGO_DIR)/helm.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/helm-v3.15.1" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.15.1 "helm.sh/helm/v3/cmd/helm" + @echo "(re)installing $(GOBIN)/helm-v3.14.3" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.14.3 "helm.sh/helm/v3/cmd/helm" KIND := $(GOBIN)/kind-v0.23.0 $(KIND): $(BINGO_DIR)/kind.mod @@ -41,11 +41,11 @@ $(KIND): $(BINGO_DIR)/kind.mod @echo "(re)installing $(GOBIN)/kind-v0.23.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kind.mod -o=$(GOBIN)/kind-v0.23.0 "sigs.k8s.io/kind" -SETUP_ENVTEST := $(GOBIN)/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60 +SETUP_ENVTEST := $(GOBIN)/setup-envtest-v0.0.0-20230927023946-553bd00cfec5 $(SETUP_ENVTEST): $(BINGO_DIR)/setup-envtest.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=setup-envtest.mod -o=$(GOBIN)/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60 "sigs.k8s.io/controller-runtime/tools/setup-envtest" + @echo "(re)installing $(GOBIN)/setup-envtest-v0.0.0-20230927023946-553bd00cfec5" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=setup-envtest.mod -o=$(GOBIN)/setup-envtest-v0.0.0-20230927023946-553bd00cfec5 "sigs.k8s.io/controller-runtime/tools/setup-envtest" YQ := $(GOBIN)/yq-v3.0.0-20201202084205-8846255d1c37 $(YQ): $(BINGO_DIR)/yq.mod diff --git a/staging/operator-lifecycle-manager/.bingo/bingo.mod b/staging/operator-lifecycle-manager/.bingo/bingo.mod index 10786c05e5..25664f6464 100644 --- a/staging/operator-lifecycle-manager/.bingo/bingo.mod +++ b/staging/operator-lifecycle-manager/.bingo/bingo.mod @@ -1,7 +1,5 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.22.0 - -toolchain go1.22.3 +go 1.21.0 require github.com/bwplotka/bingo v0.9.0 diff --git a/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod b/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod index 0ea0215a3f..02cb1821ba 100644 --- a/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod +++ b/staging/operator-lifecycle-manager/.bingo/golangci-lint.mod @@ -1,7 +1,5 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.22.0 - -toolchain go1.22.3 +go 1.21.0 require github.com/golangci/golangci-lint v1.59.0 // cmd/golangci-lint diff --git a/staging/operator-lifecycle-manager/.bingo/helm.mod b/staging/operator-lifecycle-manager/.bingo/helm.mod index b5958009c4..41dc220278 100644 --- a/staging/operator-lifecycle-manager/.bingo/helm.mod +++ b/staging/operator-lifecycle-manager/.bingo/helm.mod @@ -1,7 +1,5 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.22.0 +go 1.21.0 -toolchain go1.22.3 - -require helm.sh/helm/v3 v3.15.1 // cmd/helm +require helm.sh/helm/v3 v3.14.3 // cmd/helm diff --git a/staging/operator-lifecycle-manager/.bingo/helm.sum b/staging/operator-lifecycle-manager/.bingo/helm.sum index 50672af6be..141c56c91b 100644 --- a/staging/operator-lifecycle-manager/.bingo/helm.sum +++ b/staging/operator-lifecycle-manager/.bingo/helm.sum @@ -54,6 +54,8 @@ github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWT github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= @@ -86,6 +88,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -116,6 +120,9 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= @@ -128,6 +135,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -320,6 +328,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -343,6 +353,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -355,6 +367,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -375,12 +389,16 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -427,6 +445,10 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -444,28 +466,50 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +helm.sh/helm/v3 v3.14.3 h1:HmvRJlwyyt9HjgmAuxHbHv3PhMz9ir/XNWHyXfmnOP4= +helm.sh/helm/v3 v3.14.3/go.mod h1:v6myVbyseSBJTzhmeE39UcPLNv6cQK6qss3dvgAySaE= helm.sh/helm/v3 v3.15.1 h1:22ztacHz4gMqhXNqCQ9NAg6BFWoRUryNLvnkz6OVyw0= helm.sh/helm/v3 v3.15.1/go.mod h1:fvfoRcB8UKRUV5jrIfOTaN/pG1TPhuqSb56fjYdTKXg= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= +k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= +k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0= +k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc= k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= +k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= +k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/apiserver v0.29.0 h1:Y1xEMjJkP+BIi0GSEv1BBrf1jLU9UPfAnnGGbbDdp7o= +k8s.io/apiserver v0.29.0/go.mod h1:31n78PsRKPmfpee7/l9NYEv67u6hOL6AfcE761HapDM= k8s.io/apiserver v0.30.0 h1:QCec+U72tMQ+9tR6A0sMBB5Vh6ImCEkoKkTDRABWq6M= k8s.io/apiserver v0.30.0/go.mod h1:smOIBq8t0MbKZi7O7SyIpjPsiKJ8qa+llcFCluKyqiY= +k8s.io/cli-runtime v0.29.0 h1:q2kC3cex4rOBLfPOnMSzV2BIrrQlx97gxHJs21KxKS4= +k8s.io/cli-runtime v0.29.0/go.mod h1:VKudXp3X7wR45L+nER85YUzOQIru28HQpXr0mTdeCrk= k8s.io/cli-runtime v0.30.0 h1:0vn6/XhOvn1RJ2KJOC6IRR2CGqrpT6QQF4+8pYpWQ48= k8s.io/cli-runtime v0.30.0/go.mod h1:vATpDMATVTMA79sZ0YUCzlMelf6rUjoBzlp+RnoM+cg= +k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= +k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ= k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY= +k8s.io/component-base v0.29.0 h1:T7rjd5wvLnPBV1vC4zWd/iWRbV8Mdxs+nGaoaFzGw3s= +k8s.io/component-base v0.29.0/go.mod h1:sADonFTQ9Zc9yFLghpDpmNXEdHyQmFIGbiuZbqAXQ1M= k8s.io/component-base v0.30.0 h1:cj6bp38g0ainlfYtaOQuRELh5KSYjhKxM+io7AUIk4o= k8s.io/component-base v0.30.0/go.mod h1:V9x/0ePFNaKeKYA3bOvIbrNoluTSG+fSJKjLdjOoeXQ= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI= +k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs= k8s.io/kubectl v0.30.0 h1:xbPvzagbJ6RNYVMVuiHArC1grrV5vSmmIcSZuCdzRyk= k8s.io/kubectl v0.30.0/go.mod h1:zgolRw2MQXLPwmic2l/+iHs239L49fhSeICuMhQQXTI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= @@ -480,5 +524,7 @@ sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/staging/operator-lifecycle-manager/.bingo/kind.mod b/staging/operator-lifecycle-manager/.bingo/kind.mod index 2027645f30..576f3ecce5 100644 --- a/staging/operator-lifecycle-manager/.bingo/kind.mod +++ b/staging/operator-lifecycle-manager/.bingo/kind.mod @@ -1,7 +1,5 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.22.0 - -toolchain go1.22.3 +go 1.21.0 require sigs.k8s.io/kind v0.23.0 diff --git a/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod b/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod index 1ed2ee39ee..c8e336d935 100644 --- a/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod +++ b/staging/operator-lifecycle-manager/.bingo/setup-envtest.mod @@ -1,7 +1,5 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.22.0 +go 1.21.0 -toolchain go1.22.3 - -require sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60 +require sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230927023946-553bd00cfec5 diff --git a/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum b/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum index bdb4c4df53..dfc4ae5271 100644 --- a/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum +++ b/staging/operator-lifecycle-manager/.bingo/setup-envtest.sum @@ -1,11 +1,20 @@ +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= @@ -13,25 +22,60 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230927023946-553bd00cfec5 h1:qKTfh80VJLOlq6bBtqGSQJmTwywSj9XSfBzAo/6vxtI= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230927023946-553bd00cfec5/go.mod h1:TF/lVLWS+JNNaVqJuDDictY2hZSXSsIHCx4FClMvqFg= sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60 h1:ihaeBTCFuEYPL1T1/FqAavDY7z5UcKSnWpnb+I3DYeM= sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60/go.mod h1:4+4tM2Es0ycqPedATtzPer5RTrUq3Xab59BYogt0mCE= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/staging/operator-lifecycle-manager/.bingo/variables.env b/staging/operator-lifecycle-manager/.bingo/variables.env index 36fd50bd90..c3260598a7 100644 --- a/staging/operator-lifecycle-manager/.bingo/variables.env +++ b/staging/operator-lifecycle-manager/.bingo/variables.env @@ -12,11 +12,11 @@ BINGO="${GOBIN}/bingo-v0.9.0" GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.59.0" -HELM="${GOBIN}/helm-v3.15.1" +HELM="${GOBIN}/helm-v3.14.3" KIND="${GOBIN}/kind-v0.23.0" -SETUP_ENVTEST="${GOBIN}/setup-envtest-v0.0.0-20240522175850-2e9781e9fc60" +SETUP_ENVTEST="${GOBIN}/setup-envtest-v0.0.0-20230927023946-553bd00cfec5" YQ="${GOBIN}/yq-v3.0.0-20201202084205-8846255d1c37" diff --git a/staging/operator-lifecycle-manager/.bingo/yq.mod b/staging/operator-lifecycle-manager/.bingo/yq.mod index 0da16a1ed1..082e2016e2 100644 --- a/staging/operator-lifecycle-manager/.bingo/yq.mod +++ b/staging/operator-lifecycle-manager/.bingo/yq.mod @@ -1,7 +1,7 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT -go 1.22.0 +go 1.21.0 -toolchain go1.22.3 +toolchain go1.21.0 require github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 From c5230f375f44872f206b64f327ec05849676a81c Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Mon, 3 Jun 2024 13:38:05 +0200 Subject: [PATCH 9/9] move helm to bingo Signed-off-by: Per Goncalves da Silva --- .bingo/.gitignore | 13 + .bingo/README.md | 14 + .bingo/Variables.mk | 25 + .bingo/go.mod | 1 + .bingo/helm.mod | 5 + .bingo/helm.sum | 488 + .bingo/variables.env | 12 + Makefile | 5 +- go.mod | 43 +- go.sum | 138 +- scripts/generate_crds_manifests.sh | 3 +- tools.go | 1 - .../Masterminds/goutils/.travis.yml | 18 - .../Masterminds/goutils/CHANGELOG.md | 8 - .../Masterminds/goutils/LICENSE.txt | 202 - .../github.com/Masterminds/goutils/README.md | 70 - .../Masterminds/goutils/appveyor.yml | 21 - .../goutils/cryptorandomstringutils.go | 230 - .../Masterminds/goutils/randomstringutils.go | 248 - .../Masterminds/goutils/stringutils.go | 240 - .../Masterminds/goutils/wordutils.go | 357 - .../Masterminds/semver/v3/.gitignore | 1 - .../Masterminds/semver/v3/.golangci.yml | 27 - .../Masterminds/semver/v3/CHANGELOG.md | 214 - .../Masterminds/semver/v3/LICENSE.txt | 19 - .../github.com/Masterminds/semver/v3/Makefile | 30 - .../Masterminds/semver/v3/README.md | 258 - .../Masterminds/semver/v3/SECURITY.md | 19 - .../Masterminds/semver/v3/collection.go | 24 - .../Masterminds/semver/v3/constraints.go | 594 - .../github.com/Masterminds/semver/v3/doc.go | 184 - .../Masterminds/semver/v3/version.go | 639 - .../Masterminds/sprig/v3/.gitignore | 2 - .../Masterminds/sprig/v3/CHANGELOG.md | 383 - .../Masterminds/sprig/v3/LICENSE.txt | 19 - .../github.com/Masterminds/sprig/v3/Makefile | 9 - .../github.com/Masterminds/sprig/v3/README.md | 100 - .../github.com/Masterminds/sprig/v3/crypto.go | 653 - .../github.com/Masterminds/sprig/v3/date.go | 152 - .../Masterminds/sprig/v3/defaults.go | 163 - .../github.com/Masterminds/sprig/v3/dict.go | 174 - vendor/github.com/Masterminds/sprig/v3/doc.go | 19 - .../Masterminds/sprig/v3/functions.go | 382 - .../github.com/Masterminds/sprig/v3/list.go | 464 - .../Masterminds/sprig/v3/network.go | 12 - .../Masterminds/sprig/v3/numeric.go | 186 - .../Masterminds/sprig/v3/reflect.go | 28 - .../github.com/Masterminds/sprig/v3/regex.go | 83 - .../github.com/Masterminds/sprig/v3/semver.go | 23 - .../Masterminds/sprig/v3/strings.go | 236 - vendor/github.com/Masterminds/sprig/v3/url.go | 66 - .../Masterminds/squirrel/.gitignore | 1 - .../Masterminds/squirrel/.travis.yml | 30 - .../github.com/Masterminds/squirrel/LICENSE | 23 - .../github.com/Masterminds/squirrel/README.md | 142 - .../github.com/Masterminds/squirrel/case.go | 128 - .../github.com/Masterminds/squirrel/delete.go | 191 - .../Masterminds/squirrel/delete_ctx.go | 69 - .../github.com/Masterminds/squirrel/expr.go | 419 - .../github.com/Masterminds/squirrel/insert.go | 298 - .../Masterminds/squirrel/insert_ctx.go | 69 - .../github.com/Masterminds/squirrel/part.go | 63 - .../Masterminds/squirrel/placeholder.go | 114 - vendor/github.com/Masterminds/squirrel/row.go | 22 - .../github.com/Masterminds/squirrel/select.go | 403 - .../Masterminds/squirrel/select_ctx.go | 69 - .../Masterminds/squirrel/squirrel.go | 183 - .../Masterminds/squirrel/squirrel_ctx.go | 93 - .../Masterminds/squirrel/statement.go | 104 - .../Masterminds/squirrel/stmtcacher.go | 121 - .../Masterminds/squirrel/stmtcacher_ctx.go | 86 - .../Masterminds/squirrel/stmtcacher_noctx.go | 21 - .../github.com/Masterminds/squirrel/update.go | 288 - .../Masterminds/squirrel/update_ctx.go | 69 - .../github.com/Masterminds/squirrel/where.go | 30 - vendor/github.com/Masterminds/vcs/.gitignore | 24 - .../github.com/Masterminds/vcs/.golangci.yml | 24 - .../github.com/Masterminds/vcs/CHANGELOG.md | 204 - vendor/github.com/Masterminds/vcs/LICENSE.txt | 20 - vendor/github.com/Masterminds/vcs/Makefile | 19 - vendor/github.com/Masterminds/vcs/README.md | 49 - vendor/github.com/Masterminds/vcs/bzr.go | 342 - vendor/github.com/Masterminds/vcs/errors.go | 114 - vendor/github.com/Masterminds/vcs/git.go | 457 - vendor/github.com/Masterminds/vcs/git_unix.go | 13 - .../github.com/Masterminds/vcs/git_windows.go | 47 - vendor/github.com/Masterminds/vcs/hg.go | 327 - vendor/github.com/Masterminds/vcs/repo.go | 276 - vendor/github.com/Masterminds/vcs/svn.go | 386 - .../Masterminds/vcs/vcs_local_lookup.go | 46 - .../Masterminds/vcs/vcs_remote_lookup.go | 339 - .../chai2010/gettext-go/.travis.yml | 5 - vendor/github.com/chai2010/gettext-go/LICENSE | 27 - .../github.com/chai2010/gettext-go/README.md | 191 - vendor/github.com/chai2010/gettext-go/doc.go | 67 - vendor/github.com/chai2010/gettext-go/fs.go | 84 - .../github.com/chai2010/gettext-go/fs_json.go | 66 - .../github.com/chai2010/gettext-go/fs_os.go | 91 - .../github.com/chai2010/gettext-go/fs_zip.go | 142 - .../github.com/chai2010/gettext-go/gettext.go | 219 - .../github.com/chai2010/gettext-go/locale.go | 205 - .../github.com/chai2010/gettext-go/mo/doc.go | 74 - .../chai2010/gettext-go/mo/encoder.go | 105 - .../github.com/chai2010/gettext-go/mo/file.go | 197 - .../chai2010/gettext-go/mo/header.go | 109 - .../chai2010/gettext-go/mo/message.go | 52 - .../github.com/chai2010/gettext-go/mo/util.go | 110 - .../chai2010/gettext-go/plural/doc.go | 36 - .../chai2010/gettext-go/plural/formula.go | 181 - .../chai2010/gettext-go/plural/table.go | 55 - .../chai2010/gettext-go/po/comment.go | 270 - .../github.com/chai2010/gettext-go/po/doc.go | 24 - .../github.com/chai2010/gettext-go/po/file.go | 81 - .../chai2010/gettext-go/po/header.go | 106 - .../chai2010/gettext-go/po/line_reader.go | 62 - .../chai2010/gettext-go/po/message.go | 193 - .../github.com/chai2010/gettext-go/po/re.go | 58 - .../github.com/chai2010/gettext-go/po/util.go | 114 - vendor/github.com/chai2010/gettext-go/tr.go | 175 - vendor/github.com/chai2010/gettext-go/util.go | 34 - .../cpuguy83/go-md2man/v2/LICENSE.md | 21 - .../cpuguy83/go-md2man/v2/md2man/md2man.go | 16 - .../cpuguy83/go-md2man/v2/md2man/roff.go | 348 - .../cyphar/filepath-securejoin/LICENSE | 28 - .../cyphar/filepath-securejoin/README.md | 79 - .../cyphar/filepath-securejoin/VERSION | 1 - .../cyphar/filepath-securejoin/join.go | 125 - .../cyphar/filepath-securejoin/vfs.go | 41 - .../docker/distribution/.dockerignore | 1 - .../github.com/docker/distribution/.gitignore | 38 - .../docker/distribution/.golangci.yml | 33 - .../github.com/docker/distribution/.mailmap | 54 - .../docker/distribution/BUILDING.md | 117 - .../docker/distribution/CONTRIBUTING.md | 148 - .../github.com/docker/distribution/Dockerfile | 60 - .../docker/distribution/MAINTAINERS | 243 - .../github.com/docker/distribution/Makefile | 102 - .../github.com/docker/distribution/README.md | 130 - .../github.com/docker/distribution/ROADMAP.md | 267 - .../github.com/docker/distribution/blobs.go | 265 - vendor/github.com/docker/distribution/doc.go | 7 - .../docker/distribution/docker-bake.hcl | 56 - .../github.com/docker/distribution/errors.go | 119 - .../docker/distribution/manifests.go | 125 - .../docker/distribution/metrics/prometheus.go | 13 - .../docker/distribution/registry.go | 118 - .../registry/client/auth/api_version.go | 58 - .../registry/client/auth/session.go | 530 - .../registry/client/blob_writer.go | 164 - .../distribution/registry/client/errors.go | 160 - .../registry/client/repository.go | 870 - .../registry/client/transport/http_reader.go | 249 - .../registry/client/transport/transport.go | 147 - .../registry/storage/cache/cache.go | 35 - .../cache/cachedblobdescriptorstore.go | 129 - .../registry/storage/cache/memory/memory.go | 179 - vendor/github.com/docker/distribution/tags.go | 27 - .../docker/distribution/vendor.conf | 52 - .../docker/docker/api/types/filters/errors.go | 37 - .../docker/docker/api/types/filters/parse.go | 346 - .../docker/api/types/registry/authconfig.go | 99 - .../docker/api/types/registry/authenticate.go | 21 - .../docker/api/types/registry/registry.go | 122 - .../github.com/docker/docker/errdefs/defs.go | 69 - .../github.com/docker/docker/errdefs/doc.go | 8 - .../docker/docker/errdefs/helpers.go | 279 - .../docker/docker/errdefs/http_helpers.go | 46 - vendor/github.com/docker/docker/errdefs/is.go | 123 - .../docker/docker/pkg/ioutils/buffer.go | 51 - .../docker/docker/pkg/ioutils/bytespipe.go | 187 - .../docker/docker/pkg/ioutils/fswriters.go | 161 - .../docker/docker/pkg/ioutils/readers.go | 172 - .../docker/docker/pkg/ioutils/writeflusher.go | 92 - .../docker/docker/pkg/ioutils/writers.go | 74 - .../github.com/docker/docker/registry/auth.go | 199 - .../docker/docker/registry/config.go | 437 - .../docker/docker/registry/config_unix.go | 16 - .../docker/docker/registry/config_windows.go | 20 - .../docker/docker/registry/errors.go | 36 - .../docker/docker/registry/registry.go | 136 - .../docker/docker/registry/search.go | 163 - .../docker/registry/search_endpoint_v1.go | 200 - .../docker/docker/registry/search_session.go | 218 - .../docker/docker/registry/service.go | 145 - .../docker/docker/registry/service_v2.go | 80 - .../docker/docker/registry/types.go | 41 - .../docker/go-metrics/CONTRIBUTING.md | 55 - vendor/github.com/docker/go-metrics/LICENSE | 191 - .../github.com/docker/go-metrics/LICENSE.docs | 425 - vendor/github.com/docker/go-metrics/NOTICE | 16 - vendor/github.com/docker/go-metrics/README.md | 91 - .../github.com/docker/go-metrics/counter.go | 52 - vendor/github.com/docker/go-metrics/docs.go | 3 - vendor/github.com/docker/go-metrics/gauge.go | 72 - .../github.com/docker/go-metrics/handler.go | 74 - .../github.com/docker/go-metrics/helpers.go | 10 - .../github.com/docker/go-metrics/namespace.go | 315 - .../github.com/docker/go-metrics/register.go | 15 - vendor/github.com/docker/go-metrics/timer.go | 85 - vendor/github.com/docker/go-metrics/unit.go | 12 - .../exponent-io/jsonpath/.gitignore | 24 - .../exponent-io/jsonpath/.travis.yml | 5 - .../github.com/exponent-io/jsonpath/LICENSE | 21 - .../github.com/exponent-io/jsonpath/README.md | 66 - .../exponent-io/jsonpath/decoder.go | 210 - .../github.com/exponent-io/jsonpath/path.go | 67 - .../exponent-io/jsonpath/pathaction.go | 61 - .../github.com/fvbommel/sortorder/.gitignore | 19 - vendor/github.com/fvbommel/sortorder/LICENSE | 17 - .../github.com/fvbommel/sortorder/README.md | 9 - vendor/github.com/fvbommel/sortorder/doc.go | 5 - .../github.com/fvbommel/sortorder/natsort.go | 76 - .../github.com/go-errors/errors/.travis.yml | 8 - .../github.com/go-errors/errors/LICENSE.MIT | 7 - vendor/github.com/go-errors/errors/README.md | 82 - vendor/github.com/go-errors/errors/error.go | 209 - .../github.com/go-errors/errors/error_1_13.go | 31 - .../go-errors/errors/error_backward.go | 57 - .../go-errors/errors/parse_panic.go | 127 - .../github.com/go-errors/errors/stackframe.go | 122 - vendor/github.com/go-gorp/gorp/v3/.gitignore | 11 - vendor/github.com/go-gorp/gorp/v3/.travis.yml | 36 - .../go-gorp/gorp/v3/CONTRIBUTING.md | 34 - vendor/github.com/go-gorp/gorp/v3/LICENSE | 22 - vendor/github.com/go-gorp/gorp/v3/README.md | 809 - vendor/github.com/go-gorp/gorp/v3/column.go | 76 - vendor/github.com/go-gorp/gorp/v3/db.go | 985 - vendor/github.com/go-gorp/gorp/v3/dialect.go | 105 - .../go-gorp/gorp/v3/dialect_mysql.go | 169 - .../go-gorp/gorp/v3/dialect_oracle.go | 139 - .../go-gorp/gorp/v3/dialect_postgres.go | 149 - .../go-gorp/gorp/v3/dialect_snowflake.go | 152 - .../go-gorp/gorp/v3/dialect_sqlite.go | 112 - .../go-gorp/gorp/v3/dialect_sqlserver.go | 145 - vendor/github.com/go-gorp/gorp/v3/doc.go | 11 - vendor/github.com/go-gorp/gorp/v3/errors.go | 31 - vendor/github.com/go-gorp/gorp/v3/gorp.go | 672 - vendor/github.com/go-gorp/gorp/v3/hooks.go | 42 - vendor/github.com/go-gorp/gorp/v3/index.go | 49 - .../github.com/go-gorp/gorp/v3/lockerror.go | 56 - vendor/github.com/go-gorp/gorp/v3/logging.go | 42 - .../github.com/go-gorp/gorp/v3/nulltypes.go | 65 - vendor/github.com/go-gorp/gorp/v3/select.go | 359 - vendor/github.com/go-gorp/gorp/v3/table.go | 258 - .../go-gorp/gorp/v3/table_bindings.go | 305 - vendor/github.com/go-gorp/gorp/v3/test_all.sh | 23 - .../github.com/go-gorp/gorp/v3/transaction.go | 239 - vendor/github.com/gobwas/glob/.gitignore | 8 - vendor/github.com/gobwas/glob/.travis.yml | 9 - vendor/github.com/gobwas/glob/LICENSE | 21 - vendor/github.com/gobwas/glob/bench.sh | 26 - .../gobwas/glob/compiler/compiler.go | 525 - vendor/github.com/gobwas/glob/glob.go | 80 - vendor/github.com/gobwas/glob/match/any.go | 45 - vendor/github.com/gobwas/glob/match/any_of.go | 82 - vendor/github.com/gobwas/glob/match/btree.go | 146 - .../github.com/gobwas/glob/match/contains.go | 58 - .../github.com/gobwas/glob/match/every_of.go | 99 - vendor/github.com/gobwas/glob/match/list.go | 49 - vendor/github.com/gobwas/glob/match/match.go | 81 - vendor/github.com/gobwas/glob/match/max.go | 49 - vendor/github.com/gobwas/glob/match/min.go | 57 - .../github.com/gobwas/glob/match/nothing.go | 27 - vendor/github.com/gobwas/glob/match/prefix.go | 50 - .../gobwas/glob/match/prefix_any.go | 55 - .../gobwas/glob/match/prefix_suffix.go | 62 - vendor/github.com/gobwas/glob/match/range.go | 48 - vendor/github.com/gobwas/glob/match/row.go | 77 - .../github.com/gobwas/glob/match/segments.go | 91 - vendor/github.com/gobwas/glob/match/single.go | 43 - vendor/github.com/gobwas/glob/match/suffix.go | 35 - .../gobwas/glob/match/suffix_any.go | 43 - vendor/github.com/gobwas/glob/match/super.go | 33 - vendor/github.com/gobwas/glob/match/text.go | 45 - vendor/github.com/gobwas/glob/readme.md | 148 - .../github.com/gobwas/glob/syntax/ast/ast.go | 122 - .../gobwas/glob/syntax/ast/parser.go | 157 - .../gobwas/glob/syntax/lexer/lexer.go | 273 - .../gobwas/glob/syntax/lexer/token.go | 88 - .../github.com/gobwas/glob/syntax/syntax.go | 14 - .../gobwas/glob/util/runes/runes.go | 154 - .../gobwas/glob/util/strings/strings.go | 39 - vendor/github.com/gofrs/flock/.gitignore | 24 - vendor/github.com/gofrs/flock/.travis.yml | 10 - vendor/github.com/gofrs/flock/LICENSE | 27 - vendor/github.com/gofrs/flock/README.md | 41 - vendor/github.com/gofrs/flock/appveyor.yml | 25 - vendor/github.com/gofrs/flock/flock.go | 144 - vendor/github.com/gofrs/flock/flock_aix.go | 281 - vendor/github.com/gofrs/flock/flock_unix.go | 197 - vendor/github.com/gofrs/flock/flock_winapi.go | 76 - .../github.com/gofrs/flock/flock_windows.go | 142 - vendor/github.com/google/btree/.travis.yml | 1 - vendor/github.com/google/btree/LICENSE | 202 - vendor/github.com/google/btree/README.md | 12 - vendor/github.com/google/btree/btree.go | 890 - vendor/github.com/google/shlex/COPYING | 202 - vendor/github.com/google/shlex/README | 2 - vendor/github.com/google/shlex/shlex.go | 416 - vendor/github.com/gosuri/uitable/.travis.yml | 6 - vendor/github.com/gosuri/uitable/LICENSE | 10 - vendor/github.com/gosuri/uitable/Makefile | 4 - vendor/github.com/gosuri/uitable/README.md | 67 - vendor/github.com/gosuri/uitable/table.go | 205 - .../gosuri/uitable/util/strutil/strutil.go | 101 - .../gosuri/uitable/util/wordwrap/LICENSE.md | 21 - .../gosuri/uitable/util/wordwrap/README.md | 39 - .../gosuri/uitable/util/wordwrap/wordwrap.go | 85 - .../gregjones/httpcache/.travis.yml | 19 - .../gregjones/httpcache/LICENSE.txt | 7 - .../github.com/gregjones/httpcache/README.md | 25 - .../gregjones/httpcache/httpcache.go | 551 - vendor/github.com/huandu/xstrings/.gitignore | 24 - .../huandu/xstrings/CONTRIBUTING.md | 23 - vendor/github.com/huandu/xstrings/LICENSE | 22 - vendor/github.com/huandu/xstrings/README.md | 117 - vendor/github.com/huandu/xstrings/common.go | 21 - vendor/github.com/huandu/xstrings/convert.go | 593 - vendor/github.com/huandu/xstrings/count.go | 120 - vendor/github.com/huandu/xstrings/doc.go | 8 - vendor/github.com/huandu/xstrings/format.go | 173 - .../github.com/huandu/xstrings/manipulate.go | 220 - .../huandu/xstrings/stringbuilder.go | 8 - .../huandu/xstrings/stringbuilder_go110.go | 10 - .../github.com/huandu/xstrings/translate.go | 552 - vendor/github.com/jmoiron/sqlx/.gitignore | 25 - vendor/github.com/jmoiron/sqlx/.travis.yml | 26 - vendor/github.com/jmoiron/sqlx/LICENSE | 23 - vendor/github.com/jmoiron/sqlx/README.md | 213 - vendor/github.com/jmoiron/sqlx/bind.go | 265 - vendor/github.com/jmoiron/sqlx/doc.go | 12 - vendor/github.com/jmoiron/sqlx/named.go | 458 - .../github.com/jmoiron/sqlx/named_context.go | 132 - .../jmoiron/sqlx/reflectx/README.md | 17 - .../jmoiron/sqlx/reflectx/reflect.go | 444 - vendor/github.com/jmoiron/sqlx/sqlx.go | 1051 - .../github.com/jmoiron/sqlx/sqlx_context.go | 414 - vendor/github.com/lann/builder/.gitignore | 2 - vendor/github.com/lann/builder/.travis.yml | 7 - vendor/github.com/lann/builder/LICENSE | 21 - vendor/github.com/lann/builder/README.md | 68 - vendor/github.com/lann/builder/builder.go | 225 - vendor/github.com/lann/builder/reflect.go | 24 - vendor/github.com/lann/builder/registry.go | 59 - vendor/github.com/lann/ps/LICENSE | 7 - vendor/github.com/lann/ps/README.md | 10 - vendor/github.com/lann/ps/list.go | 93 - vendor/github.com/lann/ps/map.go | 311 - vendor/github.com/lann/ps/profile.sh | 3 - vendor/github.com/lib/pq/.gitignore | 6 - vendor/github.com/lib/pq/LICENSE.md | 8 - vendor/github.com/lib/pq/README.md | 36 - vendor/github.com/lib/pq/TESTS.md | 33 - vendor/github.com/lib/pq/array.go | 895 - vendor/github.com/lib/pq/buf.go | 91 - vendor/github.com/lib/pq/conn.go | 2112 - vendor/github.com/lib/pq/conn_go115.go | 8 - vendor/github.com/lib/pq/conn_go18.go | 247 - vendor/github.com/lib/pq/connector.go | 120 - vendor/github.com/lib/pq/copy.go | 348 - vendor/github.com/lib/pq/doc.go | 268 - vendor/github.com/lib/pq/encode.go | 632 - vendor/github.com/lib/pq/error.go | 523 - vendor/github.com/lib/pq/krb.go | 27 - vendor/github.com/lib/pq/notice.go | 72 - vendor/github.com/lib/pq/notify.go | 858 - vendor/github.com/lib/pq/oid/doc.go | 6 - vendor/github.com/lib/pq/oid/types.go | 343 - vendor/github.com/lib/pq/rows.go | 93 - vendor/github.com/lib/pq/scram/scram.go | 264 - vendor/github.com/lib/pq/ssl.go | 204 - vendor/github.com/lib/pq/ssl_permissions.go | 93 - vendor/github.com/lib/pq/ssl_windows.go | 10 - vendor/github.com/lib/pq/url.go | 76 - vendor/github.com/lib/pq/user_other.go | 10 - vendor/github.com/lib/pq/user_posix.go | 25 - vendor/github.com/lib/pq/user_windows.go | 27 - vendor/github.com/lib/pq/uuid.go | 23 - vendor/github.com/mattn/go-runewidth/LICENSE | 21 - .../github.com/mattn/go-runewidth/README.md | 27 - .../mattn/go-runewidth/runewidth.go | 358 - .../mattn/go-runewidth/runewidth_appengine.go | 9 - .../mattn/go-runewidth/runewidth_js.go | 9 - .../mattn/go-runewidth/runewidth_posix.go | 81 - .../mattn/go-runewidth/runewidth_table.go | 439 - .../mattn/go-runewidth/runewidth_windows.go | 28 - .../mitchellh/copystructure/LICENSE | 21 - .../mitchellh/copystructure/README.md | 21 - .../mitchellh/copystructure/copier_time.go | 15 - .../mitchellh/copystructure/copystructure.go | 631 - .../mitchellh/reflectwalk/.travis.yml | 1 - .../github.com/mitchellh/reflectwalk/LICENSE | 21 - .../mitchellh/reflectwalk/README.md | 6 - .../mitchellh/reflectwalk/location.go | 19 - .../mitchellh/reflectwalk/location_string.go | 16 - .../mitchellh/reflectwalk/reflectwalk.go | 420 - .../monochromegane/go-gitignore/.travis.yml | 6 - .../monochromegane/go-gitignore/LICENSE | 21 - .../monochromegane/go-gitignore/README.md | 95 - .../go-gitignore/depth_holder.go | 79 - .../go-gitignore/full_scan_patterns.go | 31 - .../monochromegane/go-gitignore/gitignore.go | 80 - .../go-gitignore/index_scan_patterns.go | 35 - .../go-gitignore/initial_holder.go | 62 - .../monochromegane/go-gitignore/match.go | 24 - .../monochromegane/go-gitignore/pattern.go | 69 - .../monochromegane/go-gitignore/patterns.go | 22 - .../monochromegane/go-gitignore/util.go | 45 - vendor/github.com/peterbourgon/diskv/LICENSE | 19 - .../github.com/peterbourgon/diskv/README.md | 141 - .../peterbourgon/diskv/compression.go | 64 - vendor/github.com/peterbourgon/diskv/diskv.go | 624 - vendor/github.com/peterbourgon/diskv/index.go | 115 - vendor/github.com/rivo/uniseg/LICENSE.txt | 21 - vendor/github.com/rivo/uniseg/README.md | 137 - vendor/github.com/rivo/uniseg/doc.go | 108 - .../github.com/rivo/uniseg/eastasianwidth.go | 2588 - .../rivo/uniseg/emojipresentation.go | 295 - .../github.com/rivo/uniseg/gen_breaktest.go | 215 - .../github.com/rivo/uniseg/gen_properties.go | 261 - vendor/github.com/rivo/uniseg/grapheme.go | 331 - .../rivo/uniseg/graphemeproperties.go | 1915 - .../github.com/rivo/uniseg/graphemerules.go | 176 - vendor/github.com/rivo/uniseg/line.go | 134 - .../github.com/rivo/uniseg/lineproperties.go | 3554 -- vendor/github.com/rivo/uniseg/linerules.go | 626 - vendor/github.com/rivo/uniseg/properties.go | 208 - vendor/github.com/rivo/uniseg/sentence.go | 90 - .../rivo/uniseg/sentenceproperties.go | 2845 - .../github.com/rivo/uniseg/sentencerules.go | 276 - vendor/github.com/rivo/uniseg/step.go | 242 - vendor/github.com/rivo/uniseg/width.go | 61 - vendor/github.com/rivo/uniseg/word.go | 89 - .../github.com/rivo/uniseg/wordproperties.go | 1883 - vendor/github.com/rivo/uniseg/wordrules.go | 282 - .../rubenv/sql-migrate/.dockerignore | 6 - .../github.com/rubenv/sql-migrate/.gitignore | 9 - .../rubenv/sql-migrate/.golangci.yaml | 98 - .../github.com/rubenv/sql-migrate/Dockerfile | 25 - vendor/github.com/rubenv/sql-migrate/LICENSE | 21 - vendor/github.com/rubenv/sql-migrate/Makefile | 11 - .../github.com/rubenv/sql-migrate/README.md | 416 - vendor/github.com/rubenv/sql-migrate/doc.go | 238 - .../github.com/rubenv/sql-migrate/migrate.go | 877 - .../rubenv/sql-migrate/migrate_go116.go | 23 - .../rubenv/sql-migrate/sqlparse/LICENSE | 22 - .../rubenv/sql-migrate/sqlparse/README.md | 7 - .../rubenv/sql-migrate/sqlparse/sqlparse.go | 226 - .../sql-migrate/test-migrations/1_initial.sql | 8 - .../sql-migrate/test-migrations/2_record.sql | 5 - .../github.com/shopspring/decimal/.gitignore | 9 - .../github.com/shopspring/decimal/.travis.yml | 19 - .../shopspring/decimal/CHANGELOG.md | 49 - vendor/github.com/shopspring/decimal/LICENSE | 45 - .../github.com/shopspring/decimal/README.md | 130 - .../shopspring/decimal/decimal-go.go | 415 - .../github.com/shopspring/decimal/decimal.go | 1904 - .../github.com/shopspring/decimal/rounding.go | 160 - vendor/github.com/spf13/cast/.gitignore | 25 - vendor/github.com/spf13/cast/LICENSE | 21 - vendor/github.com/spf13/cast/Makefile | 40 - vendor/github.com/spf13/cast/README.md | 75 - vendor/github.com/spf13/cast/cast.go | 176 - vendor/github.com/spf13/cast/caste.go | 1476 - .../spf13/cast/timeformattype_string.go | 27 - vendor/github.com/spf13/cobra/doc/man_docs.go | 246 - vendor/github.com/spf13/cobra/doc/md_docs.go | 158 - .../github.com/spf13/cobra/doc/rest_docs.go | 186 - vendor/github.com/spf13/cobra/doc/util.go | 52 - .../github.com/spf13/cobra/doc/yaml_docs.go | 175 - .../gojsonpointer/LICENSE-APACHE-2.0.txt | 202 - .../xeipuuv/gojsonpointer/README.md | 41 - .../xeipuuv/gojsonpointer/pointer.go | 211 - .../gojsonreference/LICENSE-APACHE-2.0.txt | 202 - .../xeipuuv/gojsonreference/README.md | 10 - .../xeipuuv/gojsonreference/reference.go | 147 - .../xeipuuv/gojsonschema/.gitignore | 3 - .../xeipuuv/gojsonschema/.travis.yml | 9 - .../gojsonschema/LICENSE-APACHE-2.0.txt | 202 - .../github.com/xeipuuv/gojsonschema/README.md | 466 - .../github.com/xeipuuv/gojsonschema/draft.go | 125 - .../github.com/xeipuuv/gojsonschema/errors.go | 364 - .../xeipuuv/gojsonschema/format_checkers.go | 368 - .../xeipuuv/gojsonschema/glide.yaml | 13 - .../xeipuuv/gojsonschema/internalLog.go | 37 - .../xeipuuv/gojsonschema/jsonContext.go | 73 - .../xeipuuv/gojsonschema/jsonLoader.go | 386 - .../xeipuuv/gojsonschema/locales.go | 472 - .../github.com/xeipuuv/gojsonschema/result.go | 220 - .../github.com/xeipuuv/gojsonschema/schema.go | 1087 - .../xeipuuv/gojsonschema/schemaLoader.go | 206 - .../xeipuuv/gojsonschema/schemaPool.go | 215 - .../gojsonschema/schemaReferencePool.go | 68 - .../xeipuuv/gojsonschema/schemaType.go | 83 - .../xeipuuv/gojsonschema/subSchema.go | 149 - .../github.com/xeipuuv/gojsonschema/types.go | 62 - .../github.com/xeipuuv/gojsonschema/utils.go | 197 - .../xeipuuv/gojsonschema/validation.go | 858 - vendor/github.com/xlab/treeprint/.gitignore | 3 - vendor/github.com/xlab/treeprint/LICENSE | 20 - vendor/github.com/xlab/treeprint/README.md | 154 - vendor/github.com/xlab/treeprint/helpers.go | 47 - vendor/github.com/xlab/treeprint/struct.go | 322 - vendor/github.com/xlab/treeprint/treeprint.go | 294 - vendor/go.starlark.net/LICENSE | 29 - .../internal/compile/compile.go | 1924 - .../internal/compile/serial.go | 395 - .../go.starlark.net/internal/spell/spell.go | 115 - vendor/go.starlark.net/resolve/binding.go | 74 - vendor/go.starlark.net/resolve/resolve.go | 969 - vendor/go.starlark.net/starlark/debug.go | 42 - vendor/go.starlark.net/starlark/empty.s | 3 - vendor/go.starlark.net/starlark/eval.go | 1648 - vendor/go.starlark.net/starlark/hashtable.go | 390 - vendor/go.starlark.net/starlark/int.go | 452 - .../go.starlark.net/starlark/int_generic.go | 34 - .../go.starlark.net/starlark/int_posix64.go | 91 - vendor/go.starlark.net/starlark/interp.go | 705 - vendor/go.starlark.net/starlark/library.go | 2289 - vendor/go.starlark.net/starlark/profile.go | 449 - vendor/go.starlark.net/starlark/unpack.go | 355 - vendor/go.starlark.net/starlark/value.go | 1500 - .../go.starlark.net/starlarkstruct/module.go | 43 - .../go.starlark.net/starlarkstruct/struct.go | 282 - vendor/go.starlark.net/syntax/grammar.txt | 129 - vendor/go.starlark.net/syntax/parse.go | 1028 - vendor/go.starlark.net/syntax/quote.go | 309 - vendor/go.starlark.net/syntax/scan.go | 1123 - vendor/go.starlark.net/syntax/syntax.go | 525 - vendor/go.starlark.net/syntax/walk.go | 161 - vendor/golang.org/x/crypto/bcrypt/base64.go | 35 - vendor/golang.org/x/crypto/bcrypt/bcrypt.go | 304 - vendor/golang.org/x/crypto/blowfish/block.go | 159 - vendor/golang.org/x/crypto/blowfish/cipher.go | 99 - vendor/golang.org/x/crypto/blowfish/const.go | 199 - vendor/golang.org/x/crypto/cast5/cast5.go | 536 - .../x/crypto/openpgp/armor/armor.go | 232 - .../x/crypto/openpgp/armor/encode.go | 161 - .../x/crypto/openpgp/canonical_text.go | 59 - .../x/crypto/openpgp/clearsign/clearsign.go | 424 - .../x/crypto/openpgp/elgamal/elgamal.go | 130 - .../x/crypto/openpgp/errors/errors.go | 78 - vendor/golang.org/x/crypto/openpgp/keys.go | 693 - .../x/crypto/openpgp/packet/compressed.go | 123 - .../x/crypto/openpgp/packet/config.go | 91 - .../x/crypto/openpgp/packet/encrypted_key.go | 208 - .../x/crypto/openpgp/packet/literal.go | 89 - .../x/crypto/openpgp/packet/ocfb.go | 143 - .../openpgp/packet/one_pass_signature.go | 73 - .../x/crypto/openpgp/packet/opaque.go | 161 - .../x/crypto/openpgp/packet/packet.go | 590 - .../x/crypto/openpgp/packet/private_key.go | 384 - .../x/crypto/openpgp/packet/public_key.go | 753 - .../x/crypto/openpgp/packet/public_key_v3.go | 279 - .../x/crypto/openpgp/packet/reader.go | 76 - .../x/crypto/openpgp/packet/signature.go | 731 - .../x/crypto/openpgp/packet/signature_v3.go | 146 - .../openpgp/packet/symmetric_key_encrypted.go | 155 - .../openpgp/packet/symmetrically_encrypted.go | 290 - .../x/crypto/openpgp/packet/userattribute.go | 90 - .../x/crypto/openpgp/packet/userid.go | 159 - vendor/golang.org/x/crypto/openpgp/read.go | 448 - vendor/golang.org/x/crypto/openpgp/s2k/s2k.go | 279 - vendor/golang.org/x/crypto/openpgp/write.go | 418 - vendor/golang.org/x/crypto/scrypt/scrypt.go | 212 - vendor/golang.org/x/text/encoding/encoding.go | 335 - .../internal/identifier/identifier.go | 81 - .../text/encoding/internal/identifier/mib.go | 1627 - .../x/text/encoding/internal/internal.go | 75 - .../x/text/encoding/unicode/override.go | 82 - .../x/text/encoding/unicode/unicode.go | 512 - .../internal/utf8internal/utf8internal.go | 87 - vendor/golang.org/x/text/runes/cond.go | 187 - vendor/golang.org/x/text/runes/runes.go | 355 - vendor/helm.sh/helm/v3/LICENSE | 202 - vendor/helm.sh/helm/v3/cmd/helm/completion.go | 215 - vendor/helm.sh/helm/v3/cmd/helm/create.go | 113 - vendor/helm.sh/helm/v3/cmd/helm/dependency.go | 122 - .../helm/v3/cmd/helm/dependency_build.go | 93 - .../helm/v3/cmd/helm/dependency_update.go | 84 - vendor/helm.sh/helm/v3/cmd/helm/docs.go | 104 - vendor/helm.sh/helm/v3/cmd/helm/env.go | 76 - vendor/helm.sh/helm/v3/cmd/helm/flags.go | 252 - vendor/helm.sh/helm/v3/cmd/helm/get.go | 55 - vendor/helm.sh/helm/v3/cmd/helm/get_all.go | 82 - vendor/helm.sh/helm/v3/cmd/helm/get_hooks.go | 75 - .../helm.sh/helm/v3/cmd/helm/get_manifest.go | 75 - .../helm.sh/helm/v3/cmd/helm/get_metadata.go | 94 - vendor/helm.sh/helm/v3/cmd/helm/get_notes.go | 74 - vendor/helm.sh/helm/v3/cmd/helm/get_values.go | 98 - vendor/helm.sh/helm/v3/cmd/helm/helm.go | 130 - vendor/helm.sh/helm/v3/cmd/helm/history.go | 200 - vendor/helm.sh/helm/v3/cmd/helm/install.go | 350 - vendor/helm.sh/helm/v3/cmd/helm/lint.go | 155 - vendor/helm.sh/helm/v3/cmd/helm/list.go | 251 - .../helm.sh/helm/v3/cmd/helm/load_plugins.go | 377 - vendor/helm.sh/helm/v3/cmd/helm/package.go | 124 - vendor/helm.sh/helm/v3/cmd/helm/plugin.go | 72 - .../helm/v3/cmd/helm/plugin_install.go | 94 - .../helm.sh/helm/v3/cmd/helm/plugin_list.go | 88 - .../helm/v3/cmd/helm/plugin_uninstall.go | 100 - .../helm.sh/helm/v3/cmd/helm/plugin_update.go | 114 - vendor/helm.sh/helm/v3/cmd/helm/printer.go | 30 - vendor/helm.sh/helm/v3/cmd/helm/pull.go | 105 - vendor/helm.sh/helm/v3/cmd/helm/push.go | 101 - vendor/helm.sh/helm/v3/cmd/helm/registry.go | 41 - .../helm/v3/cmd/helm/registry_login.go | 151 - .../helm/v3/cmd/helm/registry_logout.go | 44 - .../helm/v3/cmd/helm/release_testing.go | 97 - vendor/helm.sh/helm/v3/cmd/helm/repo.go | 54 - vendor/helm.sh/helm/v3/cmd/helm/repo_add.go | 220 - vendor/helm.sh/helm/v3/cmd/helm/repo_index.go | 118 - vendor/helm.sh/helm/v3/cmd/helm/repo_list.go | 137 - .../helm.sh/helm/v3/cmd/helm/repo_remove.go | 96 - .../helm.sh/helm/v3/cmd/helm/repo_update.go | 167 - .../helm.sh/helm/v3/cmd/helm/require/args.go | 88 - vendor/helm.sh/helm/v3/cmd/helm/rollback.go | 90 - vendor/helm.sh/helm/v3/cmd/helm/root.go | 304 - vendor/helm.sh/helm/v3/cmd/helm/root_unix.go | 58 - .../helm.sh/helm/v3/cmd/helm/root_windows.go | 22 - vendor/helm.sh/helm/v3/cmd/helm/search.go | 43 - .../helm.sh/helm/v3/cmd/helm/search/search.go | 227 - vendor/helm.sh/helm/v3/cmd/helm/search_hub.go | 198 - .../helm.sh/helm/v3/cmd/helm/search_repo.go | 396 - vendor/helm.sh/helm/v3/cmd/helm/show.go | 236 - vendor/helm.sh/helm/v3/cmd/helm/status.go | 240 - vendor/helm.sh/helm/v3/cmd/helm/template.go | 262 - vendor/helm.sh/helm/v3/cmd/helm/uninstall.go | 92 - vendor/helm.sh/helm/v3/cmd/helm/upgrade.go | 287 - vendor/helm.sh/helm/v3/cmd/helm/verify.go | 70 - vendor/helm.sh/helm/v3/cmd/helm/version.go | 103 - .../helm/v3/internal/fileutil/fileutil.go | 50 - .../helm/v3/internal/monocular/client.go | 68 - .../helm.sh/helm/v3/internal/monocular/doc.go | 22 - .../helm/v3/internal/monocular/search.go | 145 - .../helm/v3/internal/resolver/resolver.go | 263 - .../helm.sh/helm/v3/internal/sympath/walk.go | 119 - .../helm/v3/internal/third_party/dep/fs/fs.go | 372 - .../v3/internal/third_party/dep/fs/rename.go | 58 - .../third_party/dep/fs/rename_windows.go | 69 - .../deployment/util/deploymentutil.go | 178 - .../helm.sh/helm/v3/internal/tlsutil/cfg.go | 58 - .../helm.sh/helm/v3/internal/tlsutil/tls.go | 78 - .../helm/v3/internal/urlutil/urlutil.go | 73 - .../helm/v3/internal/version/version.go | 81 - vendor/helm.sh/helm/v3/pkg/action/action.go | 424 - .../helm.sh/helm/v3/pkg/action/dependency.go | 230 - vendor/helm.sh/helm/v3/pkg/action/doc.go | 22 - vendor/helm.sh/helm/v3/pkg/action/get.go | 47 - .../helm/v3/pkg/action/get_metadata.go | 69 - .../helm.sh/helm/v3/pkg/action/get_values.go | 60 - vendor/helm.sh/helm/v3/pkg/action/history.go | 58 - vendor/helm.sh/helm/v3/pkg/action/hooks.go | 159 - vendor/helm.sh/helm/v3/pkg/action/install.go | 815 - .../helm.sh/helm/v3/pkg/action/lazyclient.go | 197 - vendor/helm.sh/helm/v3/pkg/action/lint.go | 129 - vendor/helm.sh/helm/v3/pkg/action/list.go | 324 - vendor/helm.sh/helm/v3/pkg/action/package.go | 181 - vendor/helm.sh/helm/v3/pkg/action/pull.go | 172 - vendor/helm.sh/helm/v3/pkg/action/push.go | 112 - .../helm/v3/pkg/action/registry_login.go | 88 - .../helm/v3/pkg/action/registry_logout.go | 38 - .../helm/v3/pkg/action/release_testing.go | 152 - .../helm/v3/pkg/action/resource_policy.go | 46 - vendor/helm.sh/helm/v3/pkg/action/rollback.go | 265 - vendor/helm.sh/helm/v3/pkg/action/show.go | 165 - vendor/helm.sh/helm/v3/pkg/action/status.go | 95 - .../helm.sh/helm/v3/pkg/action/uninstall.go | 251 - vendor/helm.sh/helm/v3/pkg/action/upgrade.go | 627 - vendor/helm.sh/helm/v3/pkg/action/validate.go | 184 - vendor/helm.sh/helm/v3/pkg/action/verify.go | 59 - vendor/helm.sh/helm/v3/pkg/chart/chart.go | 173 - .../helm.sh/helm/v3/pkg/chart/dependency.go | 82 - vendor/helm.sh/helm/v3/pkg/chart/errors.go | 30 - vendor/helm.sh/helm/v3/pkg/chart/file.go | 27 - .../helm/v3/pkg/chart/loader/archive.go | 205 - .../helm/v3/pkg/chart/loader/directory.go | 119 - .../helm.sh/helm/v3/pkg/chart/loader/load.go | 200 - vendor/helm.sh/helm/v3/pkg/chart/metadata.go | 178 - .../helm/v3/pkg/chartutil/capabilities.go | 126 - .../helm/v3/pkg/chartutil/chartfile.go | 92 - .../helm.sh/helm/v3/pkg/chartutil/coalesce.go | 293 - .../helm/v3/pkg/chartutil/compatible.go | 34 - .../helm.sh/helm/v3/pkg/chartutil/create.go | 723 - .../helm/v3/pkg/chartutil/dependencies.go | 356 - vendor/helm.sh/helm/v3/pkg/chartutil/doc.go | 45 - .../helm.sh/helm/v3/pkg/chartutil/errors.go | 43 - .../helm.sh/helm/v3/pkg/chartutil/expand.go | 90 - .../helm/v3/pkg/chartutil/jsonschema.go | 93 - vendor/helm.sh/helm/v3/pkg/chartutil/save.go | 264 - .../helm/v3/pkg/chartutil/validate_name.go | 112 - .../helm.sh/helm/v3/pkg/chartutil/values.go | 212 - vendor/helm.sh/helm/v3/pkg/cli/environment.go | 258 - .../helm.sh/helm/v3/pkg/cli/output/output.go | 140 - .../helm.sh/helm/v3/pkg/cli/roundtripper.go | 80 - .../helm.sh/helm/v3/pkg/cli/values/options.go | 147 - .../v3/pkg/downloader/chart_downloader.go | 406 - vendor/helm.sh/helm/v3/pkg/downloader/doc.go | 24 - .../helm.sh/helm/v3/pkg/downloader/manager.go | 905 - vendor/helm.sh/helm/v3/pkg/engine/doc.go | 24 - vendor/helm.sh/helm/v3/pkg/engine/engine.go | 441 - vendor/helm.sh/helm/v3/pkg/engine/files.go | 165 - vendor/helm.sh/helm/v3/pkg/engine/funcs.go | 176 - .../helm.sh/helm/v3/pkg/engine/lookup_func.go | 143 - vendor/helm.sh/helm/v3/pkg/getter/doc.go | 22 - vendor/helm.sh/helm/v3/pkg/getter/getter.go | 212 - .../helm.sh/helm/v3/pkg/getter/httpgetter.go | 157 - .../helm.sh/helm/v3/pkg/getter/ocigetter.go | 155 - .../helm/v3/pkg/getter/plugingetter.go | 110 - vendor/helm.sh/helm/v3/pkg/helmpath/home.go | 44 - .../helm.sh/helm/v3/pkg/helmpath/lazypath.go | 72 - .../helm/v3/pkg/helmpath/lazypath_darwin.go | 34 - .../helm/v3/pkg/helmpath/lazypath_unix.go | 45 - .../helm/v3/pkg/helmpath/lazypath_windows.go | 24 - .../helm.sh/helm/v3/pkg/helmpath/xdg/xdg.go | 34 - vendor/helm.sh/helm/v3/pkg/ignore/doc.go | 68 - vendor/helm.sh/helm/v3/pkg/ignore/rules.go | 228 - vendor/helm.sh/helm/v3/pkg/kube/client.go | 850 - vendor/helm.sh/helm/v3/pkg/kube/config.go | 30 - vendor/helm.sh/helm/v3/pkg/kube/converter.go | 69 - vendor/helm.sh/helm/v3/pkg/kube/factory.go | 51 - vendor/helm.sh/helm/v3/pkg/kube/fake/fake.go | 160 - .../helm.sh/helm/v3/pkg/kube/fake/printer.go | 136 - vendor/helm.sh/helm/v3/pkg/kube/interface.go | 116 - vendor/helm.sh/helm/v3/pkg/kube/ready.go | 463 - vendor/helm.sh/helm/v3/pkg/kube/resource.go | 85 - .../helm/v3/pkg/kube/resource_policy.go | 27 - vendor/helm.sh/helm/v3/pkg/kube/result.go | 28 - vendor/helm.sh/helm/v3/pkg/kube/wait.go | 128 - vendor/helm.sh/helm/v3/pkg/lint/lint.go | 43 - .../helm/v3/pkg/lint/rules/chartfile.go | 213 - .../helm/v3/pkg/lint/rules/dependencies.go | 103 - .../helm/v3/pkg/lint/rules/deprecations.go | 106 - .../helm/v3/pkg/lint/rules/template.go | 351 - .../helm.sh/helm/v3/pkg/lint/rules/values.go | 86 - .../helm.sh/helm/v3/pkg/lint/support/doc.go | 23 - .../helm/v3/pkg/lint/support/message.go | 76 - .../helm.sh/helm/v3/pkg/plugin/cache/cache.go | 67 - vendor/helm.sh/helm/v3/pkg/plugin/hooks.go | 29 - .../helm/v3/pkg/plugin/installer/base.go | 45 - .../helm/v3/pkg/plugin/installer/doc.go | 17 - .../v3/pkg/plugin/installer/http_installer.go | 268 - .../helm/v3/pkg/plugin/installer/installer.go | 135 - .../pkg/plugin/installer/local_installer.go | 68 - .../v3/pkg/plugin/installer/vcs_installer.go | 176 - vendor/helm.sh/helm/v3/pkg/plugin/plugin.go | 288 - vendor/helm.sh/helm/v3/pkg/postrender/exec.go | 109 - .../helm/v3/pkg/postrender/postrender.go | 29 - vendor/helm.sh/helm/v3/pkg/provenance/doc.go | 38 - vendor/helm.sh/helm/v3/pkg/provenance/sign.go | 427 - vendor/helm.sh/helm/v3/pkg/pusher/doc.go | 21 - .../helm.sh/helm/v3/pkg/pusher/ocipusher.go | 152 - vendor/helm.sh/helm/v3/pkg/pusher/pusher.go | 122 - vendor/helm.sh/helm/v3/pkg/registry/client.go | 703 - .../helm.sh/helm/v3/pkg/registry/constants.go | 37 - vendor/helm.sh/helm/v3/pkg/registry/util.go | 247 - vendor/helm.sh/helm/v3/pkg/release/hook.go | 106 - vendor/helm.sh/helm/v3/pkg/release/info.go | 40 - vendor/helm.sh/helm/v3/pkg/release/mock.go | 116 - vendor/helm.sh/helm/v3/pkg/release/release.go | 49 - .../helm.sh/helm/v3/pkg/release/responses.go | 24 - vendor/helm.sh/helm/v3/pkg/release/status.go | 49 - .../helm.sh/helm/v3/pkg/releaseutil/filter.go | 78 - .../helm/v3/pkg/releaseutil/kind_sorter.go | 160 - .../helm/v3/pkg/releaseutil/manifest.go | 72 - .../v3/pkg/releaseutil/manifest_sorter.go | 233 - .../helm.sh/helm/v3/pkg/releaseutil/sorter.go | 78 - vendor/helm.sh/helm/v3/pkg/repo/chartrepo.go | 317 - vendor/helm.sh/helm/v3/pkg/repo/doc.go | 94 - vendor/helm.sh/helm/v3/pkg/repo/index.go | 414 - vendor/helm.sh/helm/v3/pkg/repo/repo.go | 125 - .../helm/v3/pkg/storage/driver/cfgmaps.go | 263 - .../helm/v3/pkg/storage/driver/driver.go | 105 - .../helm/v3/pkg/storage/driver/labels.go | 48 - .../helm/v3/pkg/storage/driver/memory.go | 240 - .../helm/v3/pkg/storage/driver/records.go | 124 - .../helm/v3/pkg/storage/driver/secrets.go | 256 - .../helm.sh/helm/v3/pkg/storage/driver/sql.go | 697 - .../helm/v3/pkg/storage/driver/util.go | 122 - vendor/helm.sh/helm/v3/pkg/storage/storage.go | 266 - vendor/helm.sh/helm/v3/pkg/strvals/doc.go | 33 - .../helm/v3/pkg/strvals/literal_parser.go | 244 - vendor/helm.sh/helm/v3/pkg/strvals/parser.go | 559 - vendor/helm.sh/helm/v3/pkg/time/time.go | 91 - .../helm/v3/pkg/uploader/chart_uploader.go | 58 - vendor/helm.sh/helm/v3/pkg/uploader/doc.go | 21 - vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go | 23 - .../api/imagepolicy/v1alpha1/generated.pb.go | 1375 - .../api/imagepolicy/v1alpha1/generated.proto | 88 - .../api/imagepolicy/v1alpha1/register.go | 51 - .../k8s.io/api/imagepolicy/v1alpha1/types.go | 82 - .../v1alpha1/types_swagger_doc_generated.go | 72 - .../v1alpha1/zz_generated.deepcopy.go | 121 - .../unstructured/unstructuredscheme/scheme.go | 129 - .../pkg/genericclioptions/builder_flags.go | 231 - .../genericclioptions/builder_flags_fake.go | 54 - .../pkg/genericclioptions/client_config.go | 72 - .../pkg/genericclioptions/command_headers.go | 94 - .../pkg/genericclioptions/config_flags.go | 491 - .../genericclioptions/config_flags_fake.go | 127 - .../cli-runtime/pkg/genericclioptions/doc.go | 19 - .../pkg/genericclioptions/filename_flags.go | 82 - .../pkg/genericclioptions/io_options.go | 54 - .../pkg/genericclioptions/json_yaml_flags.go | 79 - .../pkg/genericclioptions/jsonpath_flags.go | 137 - .../genericclioptions/kube_template_flags.go | 94 - .../pkg/genericclioptions/name_flags.go | 83 - .../pkg/genericclioptions/print_flags.go | 171 - .../pkg/genericclioptions/record_flags.go | 201 - .../pkg/genericclioptions/template_flags.go | 136 - .../pkg/genericiooptions/io_options.go | 56 - .../cli-runtime/pkg/resource/builder.go | 1259 - .../k8s.io/cli-runtime/pkg/resource/client.go | 69 - .../cli-runtime/pkg/resource/crd_finder.go | 110 - vendor/k8s.io/cli-runtime/pkg/resource/doc.go | 24 - .../k8s.io/cli-runtime/pkg/resource/fake.go | 40 - .../resource/fallback_query_param_verifier.go | 59 - .../k8s.io/cli-runtime/pkg/resource/helper.go | 321 - .../cli-runtime/pkg/resource/interfaces.go | 103 - .../pkg/resource/kustomizevisitor.go | 54 - .../k8s.io/cli-runtime/pkg/resource/mapper.go | 166 - .../pkg/resource/metadata_decoder.go | 56 - .../pkg/resource/query_param_verifier.go | 176 - .../pkg/resource/query_param_verifier_v3.go | 145 - .../k8s.io/cli-runtime/pkg/resource/result.go | 242 - .../k8s.io/cli-runtime/pkg/resource/scheme.go | 82 - .../cli-runtime/pkg/resource/selector.go | 92 - .../cli-runtime/pkg/resource/visitor.go | 770 - .../discovery/cached/disk/cached_discovery.go | 325 - .../discovery/cached/disk/round_tripper.go | 120 - .../discovery/cached/memory/memcache.go | 332 - .../k8s.io/client-go/openapi/cached/client.go | 54 - .../client-go/openapi/cached/groupversion.go | 58 - vendor/k8s.io/client-go/openapi3/root.go | 182 - vendor/k8s.io/client-go/scale/client.go | 238 - vendor/k8s.io/client-go/scale/doc.go | 21 - vendor/k8s.io/client-go/scale/interfaces.go | 47 - .../client-go/scale/scheme/appsint/doc.go | 22 - .../scale/scheme/appsint/register.go | 55 - .../scale/scheme/appsv1beta1/conversion.go | 73 - .../client-go/scale/scheme/appsv1beta1/doc.go | 20 - .../scale/scheme/appsv1beta1/register.go | 45 - .../appsv1beta1/zz_generated.conversion.go | 134 - .../scale/scheme/appsv1beta2/conversion.go | 73 - .../client-go/scale/scheme/appsv1beta2/doc.go | 20 - .../scale/scheme/appsv1beta2/register.go | 45 - .../appsv1beta2/zz_generated.conversion.go | 134 - .../scale/scheme/autoscalingv1/conversion.go | 54 - .../scale/scheme/autoscalingv1/doc.go | 20 - .../scale/scheme/autoscalingv1/register.go | 45 - .../autoscalingv1/zz_generated.conversion.go | 133 - vendor/k8s.io/client-go/scale/scheme/doc.go | 22 - .../scale/scheme/extensionsint/doc.go | 22 - .../scale/scheme/extensionsint/register.go | 55 - .../scheme/extensionsv1beta1/conversion.go | 73 - .../scale/scheme/extensionsv1beta1/doc.go | 20 - .../scheme/extensionsv1beta1/register.go | 45 - .../zz_generated.conversion.go | 134 - .../k8s.io/client-go/scale/scheme/register.go | 54 - vendor/k8s.io/client-go/scale/scheme/types.go | 60 - .../scale/scheme/zz_generated.deepcopy.go | 92 - vendor/k8s.io/client-go/scale/util.go | 197 - .../client-go/tools/watch/informerwatcher.go | 150 - .../client-go/tools/watch/retrywatcher.go | 295 - vendor/k8s.io/client-go/tools/watch/until.go | 168 - .../pkg/util/proto/validation/errors.go | 79 - .../pkg/util/proto/validation/types.go | 299 - .../pkg/util/proto/validation/validation.go | 30 - .../kubectl/pkg/cmd/get/customcolumn.go | 262 - .../kubectl/pkg/cmd/get/customcolumn_flags.go | 113 - vendor/k8s.io/kubectl/pkg/cmd/get/get.go | 821 - .../k8s.io/kubectl/pkg/cmd/get/get_flags.go | 170 - .../pkg/cmd/get/humanreadable_flags.go | 138 - .../kubectl/pkg/cmd/get/skip_printer.go | 48 - vendor/k8s.io/kubectl/pkg/cmd/get/sorter.go | 424 - .../kubectl/pkg/cmd/get/table_printer.go | 94 - .../k8s.io/kubectl/pkg/cmd/util/env_file.go | 103 - vendor/k8s.io/kubectl/pkg/cmd/util/factory.go | 72 - .../pkg/cmd/util/factory_client_access.go | 218 - vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go | 915 - .../pkg/cmd/util/kubectl_match_version.go | 129 - .../kubectl/pkg/cmd/util/override_options.go | 90 - .../k8s.io/kubectl/pkg/cmd/util/printing.go | 29 - vendor/k8s.io/kubectl/pkg/rawhttp/raw.go | 95 - vendor/k8s.io/kubectl/pkg/scheme/install.go | 82 - vendor/k8s.io/kubectl/pkg/scheme/scheme.go | 39 - vendor/k8s.io/kubectl/pkg/util/i18n/i18n.go | 215 - .../kubectl/pkg/util/i18n/translations/OWNERS | 7 - .../pkg/util/i18n/translations/README.md | 82 - .../pkg/util/i18n/translations/extract.py | 105 - .../pkg/util/i18n/translations/kubectl/OWNERS | 6 - .../kubectl/de_DE/LC_MESSAGES/k8s.mo | Bin 17420 -> 0 bytes .../kubectl/de_DE/LC_MESSAGES/k8s.po | 2920 - .../kubectl/default/LC_MESSAGES/k8s.mo | Bin 153024 -> 0 bytes .../kubectl/default/LC_MESSAGES/k8s.po | 5077 -- .../kubectl/en_US/LC_MESSAGES/k8s.mo | Bin 153024 -> 0 bytes .../kubectl/en_US/LC_MESSAGES/k8s.po | 5077 -- .../kubectl/fr_FR/LC_MESSAGES/k8s.mo | Bin 1233 -> 0 bytes .../kubectl/fr_FR/LC_MESSAGES/k8s.po | 103 - .../kubectl/it_IT/LC_MESSAGES/k8s.mo | Bin 20017 -> 0 bytes .../kubectl/it_IT/LC_MESSAGES/k8s.po | 3249 -- .../kubectl/ja_JP/LC_MESSAGES/k8s.mo | Bin 19210 -> 0 bytes .../kubectl/ja_JP/LC_MESSAGES/k8s.po | 3365 -- .../kubectl/ko_KR/LC_MESSAGES/k8s.mo | Bin 1274 -> 0 bytes .../kubectl/ko_KR/LC_MESSAGES/k8s.po | 96 - .../kubectl/pt_BR/LC_MESSAGES/k8s.mo | Bin 19980 -> 0 bytes .../kubectl/pt_BR/LC_MESSAGES/k8s.po | 3250 -- .../i18n/translations/kubectl/template.pot | 3291 -- .../kubectl/zh_CN/LC_MESSAGES/k8s.mo | Bin 18566 -> 0 bytes .../kubectl/zh_CN/LC_MESSAGES/k8s.po | 3236 -- .../kubectl/zh_TW/LC_MESSAGES/k8s.mo | Bin 1187 -> 0 bytes .../kubectl/zh_TW/LC_MESSAGES/k8s.po | 81 - .../test/default/LC_MESSAGES/k8s.mo | Bin 563 -> 0 bytes .../test/default/LC_MESSAGES/k8s.po | 28 - .../test/en_US/LC_MESSAGES/k8s.mo | Bin 563 -> 0 bytes .../test/en_US/LC_MESSAGES/k8s.po | 28 - vendor/k8s.io/kubectl/pkg/util/openapi/OWNERS | 6 - vendor/k8s.io/kubectl/pkg/util/openapi/doc.go | 21 - .../kubectl/pkg/util/openapi/openapi.go | 177 - .../pkg/util/openapi/openapi_getter.go | 82 - vendor/k8s.io/kubectl/pkg/util/slice/slice.go | 57 - .../k8s.io/kubectl/pkg/validation/schema.go | 153 - .../kubectl/pkg/validation/validation.go | 144 - vendor/k8s.io/utils/exec/README.md | 5 - vendor/k8s.io/utils/exec/doc.go | 18 - vendor/k8s.io/utils/exec/exec.go | 256 - vendor/k8s.io/utils/exec/fixup_go118.go | 32 - vendor/k8s.io/utils/exec/fixup_go119.go | 40 - vendor/modules.txt | 337 +- vendor/oras.land/oras-go/LICENSE | 201 - .../oras.land/oras-go/pkg/artifact/consts.go | 22 - vendor/oras.land/oras-go/pkg/auth/client.go | 45 - .../oras.land/oras-go/pkg/auth/client_opts.go | 123 - .../oras-go/pkg/auth/docker/client.go | 123 - .../oras-go/pkg/auth/docker/login.go | 103 - .../oras-go/pkg/auth/docker/login_tls.go | 220 - .../oras-go/pkg/auth/docker/logout.go | 42 - .../oras-go/pkg/auth/docker/resolver.go | 86 - .../oras.land/oras-go/pkg/content/consts.go | 57 - .../oras-go/pkg/content/decompress.go | 151 - .../oras.land/oras-go/pkg/content/errors.go | 33 - vendor/oras.land/oras-go/pkg/content/file.go | 534 - .../oras.land/oras-go/pkg/content/gunzip.go | 72 - .../oras-go/pkg/content/interface.go | 26 - .../oras.land/oras-go/pkg/content/iowriter.go | 112 - .../oras.land/oras-go/pkg/content/manifest.go | 95 - .../oras.land/oras-go/pkg/content/memory.go | 284 - .../oras-go/pkg/content/multireader.go | 56 - .../oras-go/pkg/content/multiwriter.go | 42 - vendor/oras.land/oras-go/pkg/content/oci.go | 335 - vendor/oras.land/oras-go/pkg/content/opts.go | 112 - .../oras-go/pkg/content/passthrough.go | 286 - .../oras.land/oras-go/pkg/content/readerat.go | 68 - .../oras.land/oras-go/pkg/content/registry.go | 84 - vendor/oras.land/oras-go/pkg/content/untar.go | 157 - vendor/oras.land/oras-go/pkg/content/utils.go | 223 - .../oras.land/oras-go/pkg/context/context.go | 24 - .../oras.land/oras-go/pkg/context/logger.go | 50 - vendor/oras.land/oras-go/pkg/oras/copy.go | 213 - vendor/oras.land/oras-go/pkg/oras/errors.go | 42 - vendor/oras.land/oras-go/pkg/oras/opts.go | 254 - vendor/oras.land/oras-go/pkg/oras/provider.go | 79 - vendor/oras.land/oras-go/pkg/oras/store.go | 213 - .../oras-go/pkg/registry/reference.go | 177 - .../oras-go/pkg/registry/remote/auth/cache.go | 158 - .../pkg/registry/remote/auth/challenge.go | 166 - .../pkg/registry/remote/auth/client.go | 367 - .../pkg/registry/remote/auth/credential.go | 39 - .../oras-go/pkg/registry/remote/auth/scope.go | 231 - .../remote/internal/errutil/errors.go | 83 - .../registry/remote/internal/syncutil/once.go | 69 - .../oras-go/pkg/registry/remote/repository.go | 171 - .../oras-go/pkg/registry/remote/url.go | 42 - .../oras-go/pkg/registry/remote/utils.go | 72 - .../oras-go/pkg/registry/repository.go | 57 - vendor/oras.land/oras-go/pkg/target/target.go | 26 - vendor/sigs.k8s.io/kustomize/api/LICENSE | 201 - .../api/filters/annotations/annotations.go | 52 - .../kustomize/api/filters/annotations/doc.go | 6 - .../kustomize/api/filters/fieldspec/doc.go | 6 - .../api/filters/fieldspec/fieldspec.go | 182 - .../api/filters/filtersutil/setters.go | 105 - .../kustomize/api/filters/fsslice/doc.go | 6 - .../kustomize/api/filters/fsslice/fsslice.go | 47 - .../api/filters/iampolicygenerator/doc.go | 6 - .../iampolicygenerator/iampolicygenerator.go | 55 - .../kustomize/api/filters/imagetag/doc.go | 12 - .../api/filters/imagetag/imagetag.go | 72 - .../kustomize/api/filters/imagetag/legacy.go | 104 - .../kustomize/api/filters/imagetag/updater.go | 71 - .../kustomize/api/filters/labels/doc.go | 6 - .../kustomize/api/filters/labels/labels.go | 53 - .../kustomize/api/filters/nameref/doc.go | 6 - .../kustomize/api/filters/nameref/nameref.go | 413 - .../api/filters/nameref/seqfilter.go | 60 - .../kustomize/api/filters/namespace/doc.go | 9 - .../api/filters/namespace/namespace.go | 217 - .../api/filters/patchjson6902/doc.go | 6 - .../filters/patchjson6902/patchjson6902.go | 65 - .../api/filters/patchstrategicmerge/doc.go | 6 - .../patchstrategicmerge.go | 36 - .../kustomize/api/filters/prefix/doc.go | 6 - .../kustomize/api/filters/prefix/prefix.go | 50 - .../kustomize/api/filters/refvar/doc.go | 6 - .../kustomize/api/filters/refvar/expand.go | 147 - .../kustomize/api/filters/refvar/refvar.go | 113 - .../kustomize/api/filters/replacement/doc.go | 7 - .../api/filters/replacement/replacement.go | 244 - .../kustomize/api/filters/replicacount/doc.go | 6 - .../api/filters/replicacount/replicacount.go | 48 - .../kustomize/api/filters/suffix/doc.go | 6 - .../kustomize/api/filters/suffix/suffix.go | 50 - .../api/filters/valueadd/valueadd.go | 134 - .../kustomize/api/hasher/hasher.go | 155 - vendor/sigs.k8s.io/kustomize/api/ifc/ifc.go | 56 - .../sigs.k8s.io/kustomize/api/image/image.go | 66 - .../accumulator/loadconfigfromcrds.go | 198 - .../accumulator/namereferencetransformer.go | 164 - .../internal/accumulator/refvartransformer.go | 57 - .../internal/accumulator/resaccumulator.go | 190 - .../builtins/AnnotationsTransformer.go | 38 - .../internal/builtins/ConfigMapGenerator.go | 39 - .../api/internal/builtins/HashTransformer.go | 40 - .../builtins/HelmChartInflationGenerator.go | 329 - .../internal/builtins/IAMPolicyGenerator.go | 33 - .../internal/builtins/ImageTagTransformer.go | 41 - .../api/internal/builtins/LabelTransformer.go | 38 - .../internal/builtins/NamespaceTransformer.go | 74 - .../builtins/PatchJson6902Transformer.go | 105 - .../PatchStrategicMergeTransformer.go | 89 - .../api/internal/builtins/PatchTransformer.go | 153 - .../internal/builtins/PrefixTransformer.go | 96 - .../builtins/ReplacementTransformer.go | 78 - .../builtins/ReplicaCountTransformer.go | 73 - .../api/internal/builtins/SecretGenerator.go | 39 - .../internal/builtins/SortOrderTransformer.go | 244 - .../internal/builtins/SuffixTransformer.go | 96 - .../internal/builtins/ValueAddTransformer.go | 141 - .../kustomize/api/internal/builtins/doc.go | 8 - .../api/internal/generators/configmap.go | 52 - .../api/internal/generators/secret.go | 59 - .../api/internal/generators/utils.go | 124 - .../kustomize/api/internal/git/cloner.go | 50 - .../kustomize/api/internal/git/gitrunner.go | 55 - .../kustomize/api/internal/git/repospec.go | 387 - .../api/internal/kusterr/yamlformaterror.go | 55 - .../api/internal/plugins/builtinconfig/doc.go | 10 - .../builtinconfig/loaddefaultconfig.go | 42 - .../builtinconfig/namebackreferences.go | 99 - .../builtinconfig/transformerconfig.go | 156 - .../builtinplugintype_string.go | 41 - .../plugins/builtinhelpers/builtins.go | 115 - .../internal/plugins/execplugin/execplugin.go | 191 - .../api/internal/plugins/fnplugin/fnplugin.go | 202 - .../api/internal/plugins/loader/loader.go | 332 - .../api/internal/plugins/utils/utils.go | 240 - .../target/errmissingkustomization.go | 44 - .../api/internal/target/kusttarget.go | 574 - .../target/kusttarget_configplugin.go | 446 - .../api/internal/target/multitransformer.go | 41 - .../api/internal/utils/annotations.go | 29 - .../api/internal/utils/errtimeout.go | 29 - .../api/internal/utils/makeResIds.go | 68 - .../api/internal/utils/stringslice.go | 44 - .../kustomize/api/internal/utils/timedcall.go | 23 - .../api/internal/validate/fieldvalidator.go | 68 - .../builtinpluginconsts/commonannotations.go | 47 - .../builtinpluginconsts/commonlabels.go | 113 - .../builtinpluginconsts/defaultconfig.go | 42 - .../api/konfig/builtinpluginconsts/doc.go | 8 - .../api/konfig/builtinpluginconsts/images.go | 18 - .../builtinpluginconsts/metadatalabels.go | 51 - .../konfig/builtinpluginconsts/nameprefix.go | 11 - .../builtinpluginconsts/namereference.go | 427 - .../konfig/builtinpluginconsts/namespace.go | 20 - .../konfig/builtinpluginconsts/namesuffix.go | 11 - .../konfig/builtinpluginconsts/replicas.go | 23 - .../builtinpluginconsts/templatelabels.go | 8 - .../builtinpluginconsts/varreference.go | 223 - .../sigs.k8s.io/kustomize/api/konfig/doc.go | 7 - .../kustomize/api/konfig/general.go | 49 - .../kustomize/api/konfig/plugins.go | 138 - .../sigs.k8s.io/kustomize/api/krusty/doc.go | 11 - .../kustomize/api/krusty/kustomizer.go | 163 - .../kustomize/api/krusty/options.go | 70 - vendor/sigs.k8s.io/kustomize/api/kv/kv.go | 197 - .../kustomize/api/loader/errors.go | 11 - .../kustomize/api/loader/fileloader.go | 349 - .../kustomize/api/loader/loader.go | 35 - .../kustomize/api/loader/loadrestrictions.go | 35 - .../kustomize/api/provenance/provenance.go | 84 - .../kustomize/api/provider/depprovider.go | 42 - .../kustomize/api/resmap/factory.go | 145 - .../kustomize/api/resmap/resmap.go | 333 - .../kustomize/api/resmap/reswrangler.go | 764 - .../sigs.k8s.io/kustomize/api/resource/doc.go | 5 - .../kustomize/api/resource/factory.go | 293 - .../kustomize/api/resource/idset.go | 30 - .../kustomize/api/resource/origin.go | 106 - .../kustomize/api/resource/resource.go | 534 - .../builtinpluginloadingoptions_string.go | 25 - .../kustomize/api/types/configmapargs.go | 10 - vendor/sigs.k8s.io/kustomize/api/types/doc.go | 9 - .../api/types/erronlybuiltinpluginsallowed.go | 29 - .../kustomize/api/types/errunabletofind.go | 36 - .../kustomize/api/types/fieldspec.go | 91 - .../kustomize/api/types/generationbehavior.go | 46 - .../kustomize/api/types/generatorargs.go | 27 - .../kustomize/api/types/generatoroptions.go | 76 - .../kustomize/api/types/helmchartargs.go | 185 - .../kustomize/api/types/iampolicygenerator.go | 36 - .../sigs.k8s.io/kustomize/api/types/image.go | 25 - .../kustomize/api/types/kustomization.go | 351 - .../kustomize/api/types/kvpairsources.go | 36 - .../sigs.k8s.io/kustomize/api/types/labels.go | 30 - .../kustomize/api/types/loadrestrictions.go | 24 - .../api/types/loadrestrictions_string.go | 25 - .../kustomize/api/types/objectmeta.go | 13 - .../sigs.k8s.io/kustomize/api/types/pair.go | 10 - .../sigs.k8s.io/kustomize/api/types/patch.go | 34 - .../api/types/patchstrategicmerge.go | 9 - .../kustomize/api/types/pluginconfig.go | 47 - .../kustomize/api/types/pluginrestrictions.go | 62 - .../api/types/pluginrestrictions_string.go | 25 - .../kustomize/api/types/replacement.go | 87 - .../kustomize/api/types/replacementfield.go | 9 - .../kustomize/api/types/replica.go | 16 - .../kustomize/api/types/secretargs.go | 19 - .../kustomize/api/types/selector.go | 124 - .../kustomize/api/types/sortoptions.go | 28 - .../kustomize/api/types/typemeta.go | 11 - vendor/sigs.k8s.io/kustomize/api/types/var.go | 211 - vendor/sigs.k8s.io/kustomize/kyaml/LICENSE | 201 - .../kustomize/kyaml/comments/comments.go | 83 - .../kustomize/kyaml/errors/errors.go | 50 - vendor/sigs.k8s.io/kustomize/kyaml/ext/ext.go | 10 - .../kustomize/kyaml/fieldmeta/fieldmeta.go | 275 - .../kustomize/kyaml/filesys/confirmeddir.go | 79 - .../kustomize/kyaml/filesys/doc.go | 7 - .../kustomize/kyaml/filesys/file.go | 15 - .../kustomize/kyaml/filesys/fileinfo.go | 34 - .../kustomize/kyaml/filesys/fileondisk.go | 27 - .../kustomize/kyaml/filesys/filesystem.go | 153 - .../kustomize/kyaml/filesys/fsnode.go | 647 - .../kustomize/kyaml/filesys/fsondisk.go | 141 - .../kustomize/kyaml/filesys/fsondisk_unix.go | 15 - .../kyaml/filesys/fsondisk_windows.go | 18 - .../kustomize/kyaml/filesys/util.go | 143 - .../kyaml/fn/runtime/container/container.go | 208 - .../kustomize/kyaml/fn/runtime/exec/doc.go | 5 - .../kustomize/kyaml/fn/runtime/exec/exec.go | 54 - .../kyaml/fn/runtime/runtimeutil/doc.go | 5 - .../fn/runtime/runtimeutil/functiontypes.go | 312 - .../fn/runtime/runtimeutil/runtimeutil.go | 281 - .../kyaml/fn/runtime/runtimeutil/types.go | 8 - .../kyaml/fn/runtime/starlark/context.go | 79 - .../kyaml/fn/runtime/starlark/doc.go | 36 - .../kyaml/fn/runtime/starlark/starlark.go | 180 - .../forked/github.com/go-yaml/yaml/LICENSE | 50 - .../forked/github.com/go-yaml/yaml/NOTICE | 13 - .../forked/github.com/go-yaml/yaml/README.md | 150 - .../forked/github.com/go-yaml/yaml/apic.go | 747 - .../forked/github.com/go-yaml/yaml/decode.go | 1000 - .../github.com/go-yaml/yaml/emitterc.go | 2028 - .../forked/github.com/go-yaml/yaml/encode.go | 577 - .../forked/github.com/go-yaml/yaml/parserc.go | 1258 - .../forked/github.com/go-yaml/yaml/readerc.go | 434 - .../forked/github.com/go-yaml/yaml/resolve.go | 326 - .../github.com/go-yaml/yaml/scannerc.go | 3038 -- .../forked/github.com/go-yaml/yaml/sorter.go | 134 - .../forked/github.com/go-yaml/yaml/writerc.go | 48 - .../forked/github.com/go-yaml/yaml/yaml.go | 708 - .../forked/github.com/go-yaml/yaml/yamlh.go | 809 - .../github.com/go-yaml/yaml/yamlprivateh.go | 198 - .../github.com/qri-io/starlib/util/LICENSE | 21 - .../github.com/qri-io/starlib/util/doc.go | 25 - .../github.com/qri-io/starlib/util/util.go | 275 - .../kustomize/kyaml/kio/byteio_reader.go | 349 - .../kustomize/kyaml/kio/byteio_writer.go | 198 - vendor/sigs.k8s.io/kustomize/kyaml/kio/doc.go | 35 - .../kustomize/kyaml/kio/filters/filters.go | 210 - .../kustomize/kyaml/kio/filters/fmtr.go | 314 - .../kustomize/kyaml/kio/filters/grep.go | 117 - .../kustomize/kyaml/kio/filters/local.go | 38 - .../kustomize/kyaml/kio/filters/merge.go | 86 - .../kustomize/kyaml/kio/filters/merge3.go | 317 - .../kustomize/kyaml/kio/filters/modify.go | 4 - .../kyaml/kio/filters/stripcomments.go | 32 - .../kustomize/kyaml/kio/ignorefilesmatcher.go | 105 - vendor/sigs.k8s.io/kustomize/kyaml/kio/kio.go | 447 - .../kustomize/kyaml/kio/kioutil/kioutil.go | 420 - .../kustomize/kyaml/kio/pkgio_reader.go | 360 - .../kustomize/kyaml/kio/pkgio_writer.go | 150 - .../sigs.k8s.io/kustomize/kyaml/kio/tree.go | 519 - .../kustomize/kyaml/openapi/Makefile | 62 - .../kustomize/kyaml/openapi/README.md | 84 - .../openapi/kubernetesapi/openapiinfo.go | 18 - .../openapi/kubernetesapi/v1_21_2/swagger.go | 249 - .../openapi/kubernetesapi/v1_21_2/swagger.pb | 44195 ---------------- .../kyaml/openapi/kustomizationapi/swagger.go | 248 - .../openapi/kustomizationapi/swagger.json | 130 - .../kustomize/kyaml/openapi/openapi.go | 776 - .../kustomize/kyaml/order/syncorder.go | 121 - .../sigs.k8s.io/kustomize/kyaml/resid/gvk.go | 255 - .../kustomize/kyaml/resid/resid.go | 145 - .../kustomize/kyaml/runfn/runfn.go | 549 - .../kustomize/kyaml/sets/string.go | 64 - .../kustomize/kyaml/sets/stringlist.go | 44 - .../kustomize/kyaml/sliceutil/slice.go | 25 - .../kustomize/kyaml/utils/pathsplitter.go | 71 - .../sigs.k8s.io/kustomize/kyaml/yaml/alias.go | 109 - .../kustomize/kyaml/yaml/compatibility.go | 100 - .../sigs.k8s.io/kustomize/kyaml/yaml/const.go | 30 - .../kustomize/kyaml/yaml/datamap.go | 121 - .../sigs.k8s.io/kustomize/kyaml/yaml/doc.go | 49 - .../kustomize/kyaml/yaml/filters.go | 146 - .../sigs.k8s.io/kustomize/kyaml/yaml/fns.go | 878 - .../k8sgen/pkg/labels/copied.deepcopy.go | 44 - .../yaml/internal/k8sgen/pkg/labels/labels.go | 192 - .../internal/k8sgen/pkg/labels/selector.go | 925 - .../internal/k8sgen/pkg/selection/operator.go | 36 - .../internal/k8sgen/pkg/util/errors/errors.go | 252 - .../internal/k8sgen/pkg/util/sets/empty.go | 24 - .../internal/k8sgen/pkg/util/sets/string.go | 206 - .../pkg/util/validation/field/errors.go | 275 - .../k8sgen/pkg/util/validation/field/path.go | 94 - .../k8sgen/pkg/util/validation/validation.go | 506 - .../sigs.k8s.io/kustomize/kyaml/yaml/kfns.go | 137 - .../kustomize/kyaml/yaml/mapnode.go | 40 - .../sigs.k8s.io/kustomize/kyaml/yaml/match.go | 333 - .../kustomize/kyaml/yaml/merge2/merge2.go | 188 - .../kyaml/yaml/merge2/smpdirective.go | 101 - .../kyaml/yaml/merge2/smpdirective_string.go | 26 - .../kustomize/kyaml/yaml/merge3/merge3.go | 45 - .../kustomize/kyaml/yaml/merge3/visitor.go | 172 - .../sigs.k8s.io/kustomize/kyaml/yaml/order.go | 107 - .../sigs.k8s.io/kustomize/kyaml/yaml/rnode.go | 1368 - .../kustomize/kyaml/yaml/schema/schema.go | 44 - .../sigs.k8s.io/kustomize/kyaml/yaml/types.go | 299 - .../sigs.k8s.io/kustomize/kyaml/yaml/util.go | 70 - .../kyaml/yaml/walk/associative_sequence.go | 385 - .../kustomize/kyaml/yaml/walk/map.go | 173 - .../yaml/walk/nonassociative_sequence.go | 13 - .../kustomize/kyaml/yaml/walk/scalar.go | 11 - .../kustomize/kyaml/yaml/walk/visitor.go | 28 - .../kustomize/kyaml/yaml/walk/walk.go | 186 - 1246 files changed, 567 insertions(+), 289481 deletions(-) create mode 100644 .bingo/.gitignore create mode 100644 .bingo/README.md create mode 100644 .bingo/Variables.mk create mode 100644 .bingo/go.mod create mode 100644 .bingo/helm.mod create mode 100644 .bingo/helm.sum create mode 100644 .bingo/variables.env delete mode 100644 vendor/github.com/Masterminds/goutils/.travis.yml delete mode 100644 vendor/github.com/Masterminds/goutils/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/goutils/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/goutils/README.md delete mode 100644 vendor/github.com/Masterminds/goutils/appveyor.yml delete mode 100644 vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go delete mode 100644 vendor/github.com/Masterminds/goutils/randomstringutils.go delete mode 100644 vendor/github.com/Masterminds/goutils/stringutils.go delete mode 100644 vendor/github.com/Masterminds/goutils/wordutils.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/.gitignore delete mode 100644 vendor/github.com/Masterminds/semver/v3/.golangci.yml delete mode 100644 vendor/github.com/Masterminds/semver/v3/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/semver/v3/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/semver/v3/Makefile delete mode 100644 vendor/github.com/Masterminds/semver/v3/README.md delete mode 100644 vendor/github.com/Masterminds/semver/v3/SECURITY.md delete mode 100644 vendor/github.com/Masterminds/semver/v3/collection.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/constraints.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/doc.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/version.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/.gitignore delete mode 100644 vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/sprig/v3/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/sprig/v3/Makefile delete mode 100644 vendor/github.com/Masterminds/sprig/v3/README.md delete mode 100644 vendor/github.com/Masterminds/sprig/v3/crypto.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/date.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/defaults.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/dict.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/doc.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/functions.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/list.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/network.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/numeric.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/reflect.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/regex.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/semver.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/strings.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/url.go delete mode 100644 vendor/github.com/Masterminds/squirrel/.gitignore delete mode 100644 vendor/github.com/Masterminds/squirrel/.travis.yml delete mode 100644 vendor/github.com/Masterminds/squirrel/LICENSE delete mode 100644 vendor/github.com/Masterminds/squirrel/README.md delete mode 100644 vendor/github.com/Masterminds/squirrel/case.go delete mode 100644 vendor/github.com/Masterminds/squirrel/delete.go delete mode 100644 vendor/github.com/Masterminds/squirrel/delete_ctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/expr.go delete mode 100644 vendor/github.com/Masterminds/squirrel/insert.go delete mode 100644 vendor/github.com/Masterminds/squirrel/insert_ctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/part.go delete mode 100644 vendor/github.com/Masterminds/squirrel/placeholder.go delete mode 100644 vendor/github.com/Masterminds/squirrel/row.go delete mode 100644 vendor/github.com/Masterminds/squirrel/select.go delete mode 100644 vendor/github.com/Masterminds/squirrel/select_ctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/squirrel.go delete mode 100644 vendor/github.com/Masterminds/squirrel/squirrel_ctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/statement.go delete mode 100644 vendor/github.com/Masterminds/squirrel/stmtcacher.go delete mode 100644 vendor/github.com/Masterminds/squirrel/stmtcacher_ctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/stmtcacher_noctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/update.go delete mode 100644 vendor/github.com/Masterminds/squirrel/update_ctx.go delete mode 100644 vendor/github.com/Masterminds/squirrel/where.go delete mode 100644 vendor/github.com/Masterminds/vcs/.gitignore delete mode 100644 vendor/github.com/Masterminds/vcs/.golangci.yml delete mode 100644 vendor/github.com/Masterminds/vcs/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/vcs/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/vcs/Makefile delete mode 100644 vendor/github.com/Masterminds/vcs/README.md delete mode 100644 vendor/github.com/Masterminds/vcs/bzr.go delete mode 100644 vendor/github.com/Masterminds/vcs/errors.go delete mode 100644 vendor/github.com/Masterminds/vcs/git.go delete mode 100644 vendor/github.com/Masterminds/vcs/git_unix.go delete mode 100644 vendor/github.com/Masterminds/vcs/git_windows.go delete mode 100644 vendor/github.com/Masterminds/vcs/hg.go delete mode 100644 vendor/github.com/Masterminds/vcs/repo.go delete mode 100644 vendor/github.com/Masterminds/vcs/svn.go delete mode 100644 vendor/github.com/Masterminds/vcs/vcs_local_lookup.go delete mode 100644 vendor/github.com/Masterminds/vcs/vcs_remote_lookup.go delete mode 100644 vendor/github.com/chai2010/gettext-go/.travis.yml delete mode 100644 vendor/github.com/chai2010/gettext-go/LICENSE delete mode 100644 vendor/github.com/chai2010/gettext-go/README.md delete mode 100644 vendor/github.com/chai2010/gettext-go/doc.go delete mode 100644 vendor/github.com/chai2010/gettext-go/fs.go delete mode 100644 vendor/github.com/chai2010/gettext-go/fs_json.go delete mode 100644 vendor/github.com/chai2010/gettext-go/fs_os.go delete mode 100644 vendor/github.com/chai2010/gettext-go/fs_zip.go delete mode 100644 vendor/github.com/chai2010/gettext-go/gettext.go delete mode 100644 vendor/github.com/chai2010/gettext-go/locale.go delete mode 100644 vendor/github.com/chai2010/gettext-go/mo/doc.go delete mode 100644 vendor/github.com/chai2010/gettext-go/mo/encoder.go delete mode 100644 vendor/github.com/chai2010/gettext-go/mo/file.go delete mode 100644 vendor/github.com/chai2010/gettext-go/mo/header.go delete mode 100644 vendor/github.com/chai2010/gettext-go/mo/message.go delete mode 100644 vendor/github.com/chai2010/gettext-go/mo/util.go delete mode 100644 vendor/github.com/chai2010/gettext-go/plural/doc.go delete mode 100644 vendor/github.com/chai2010/gettext-go/plural/formula.go delete mode 100644 vendor/github.com/chai2010/gettext-go/plural/table.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/comment.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/doc.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/file.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/header.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/line_reader.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/message.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/re.go delete mode 100644 vendor/github.com/chai2010/gettext-go/po/util.go delete mode 100644 vendor/github.com/chai2010/gettext-go/tr.go delete mode 100644 vendor/github.com/chai2010/gettext-go/util.go delete mode 100644 vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md delete mode 100644 vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go delete mode 100644 vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/LICENSE delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/README.md delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/VERSION delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/join.go delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/vfs.go delete mode 100644 vendor/github.com/docker/distribution/.dockerignore delete mode 100644 vendor/github.com/docker/distribution/.gitignore delete mode 100644 vendor/github.com/docker/distribution/.golangci.yml delete mode 100644 vendor/github.com/docker/distribution/.mailmap delete mode 100644 vendor/github.com/docker/distribution/BUILDING.md delete mode 100644 vendor/github.com/docker/distribution/CONTRIBUTING.md delete mode 100644 vendor/github.com/docker/distribution/Dockerfile delete mode 100644 vendor/github.com/docker/distribution/MAINTAINERS delete mode 100644 vendor/github.com/docker/distribution/Makefile delete mode 100644 vendor/github.com/docker/distribution/README.md delete mode 100644 vendor/github.com/docker/distribution/ROADMAP.md delete mode 100644 vendor/github.com/docker/distribution/blobs.go delete mode 100644 vendor/github.com/docker/distribution/doc.go delete mode 100644 vendor/github.com/docker/distribution/docker-bake.hcl delete mode 100644 vendor/github.com/docker/distribution/errors.go delete mode 100644 vendor/github.com/docker/distribution/manifests.go delete mode 100644 vendor/github.com/docker/distribution/metrics/prometheus.go delete mode 100644 vendor/github.com/docker/distribution/registry.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/auth/api_version.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/auth/session.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/blob_writer.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/errors.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/repository.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/transport/http_reader.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/transport/transport.go delete mode 100644 vendor/github.com/docker/distribution/registry/storage/cache/cache.go delete mode 100644 vendor/github.com/docker/distribution/registry/storage/cache/cachedblobdescriptorstore.go delete mode 100644 vendor/github.com/docker/distribution/registry/storage/cache/memory/memory.go delete mode 100644 vendor/github.com/docker/distribution/tags.go delete mode 100644 vendor/github.com/docker/distribution/vendor.conf delete mode 100644 vendor/github.com/docker/docker/api/types/filters/errors.go delete mode 100644 vendor/github.com/docker/docker/api/types/filters/parse.go delete mode 100644 vendor/github.com/docker/docker/api/types/registry/authconfig.go delete mode 100644 vendor/github.com/docker/docker/api/types/registry/authenticate.go delete mode 100644 vendor/github.com/docker/docker/api/types/registry/registry.go delete mode 100644 vendor/github.com/docker/docker/errdefs/defs.go delete mode 100644 vendor/github.com/docker/docker/errdefs/doc.go delete mode 100644 vendor/github.com/docker/docker/errdefs/helpers.go delete mode 100644 vendor/github.com/docker/docker/errdefs/http_helpers.go delete mode 100644 vendor/github.com/docker/docker/errdefs/is.go delete mode 100644 vendor/github.com/docker/docker/pkg/ioutils/buffer.go delete mode 100644 vendor/github.com/docker/docker/pkg/ioutils/bytespipe.go delete mode 100644 vendor/github.com/docker/docker/pkg/ioutils/fswriters.go delete mode 100644 vendor/github.com/docker/docker/pkg/ioutils/readers.go delete mode 100644 vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go delete mode 100644 vendor/github.com/docker/docker/pkg/ioutils/writers.go delete mode 100644 vendor/github.com/docker/docker/registry/auth.go delete mode 100644 vendor/github.com/docker/docker/registry/config.go delete mode 100644 vendor/github.com/docker/docker/registry/config_unix.go delete mode 100644 vendor/github.com/docker/docker/registry/config_windows.go delete mode 100644 vendor/github.com/docker/docker/registry/errors.go delete mode 100644 vendor/github.com/docker/docker/registry/registry.go delete mode 100644 vendor/github.com/docker/docker/registry/search.go delete mode 100644 vendor/github.com/docker/docker/registry/search_endpoint_v1.go delete mode 100644 vendor/github.com/docker/docker/registry/search_session.go delete mode 100644 vendor/github.com/docker/docker/registry/service.go delete mode 100644 vendor/github.com/docker/docker/registry/service_v2.go delete mode 100644 vendor/github.com/docker/docker/registry/types.go delete mode 100644 vendor/github.com/docker/go-metrics/CONTRIBUTING.md delete mode 100644 vendor/github.com/docker/go-metrics/LICENSE delete mode 100644 vendor/github.com/docker/go-metrics/LICENSE.docs delete mode 100644 vendor/github.com/docker/go-metrics/NOTICE delete mode 100644 vendor/github.com/docker/go-metrics/README.md delete mode 100644 vendor/github.com/docker/go-metrics/counter.go delete mode 100644 vendor/github.com/docker/go-metrics/docs.go delete mode 100644 vendor/github.com/docker/go-metrics/gauge.go delete mode 100644 vendor/github.com/docker/go-metrics/handler.go delete mode 100644 vendor/github.com/docker/go-metrics/helpers.go delete mode 100644 vendor/github.com/docker/go-metrics/namespace.go delete mode 100644 vendor/github.com/docker/go-metrics/register.go delete mode 100644 vendor/github.com/docker/go-metrics/timer.go delete mode 100644 vendor/github.com/docker/go-metrics/unit.go delete mode 100644 vendor/github.com/exponent-io/jsonpath/.gitignore delete mode 100644 vendor/github.com/exponent-io/jsonpath/.travis.yml delete mode 100644 vendor/github.com/exponent-io/jsonpath/LICENSE delete mode 100644 vendor/github.com/exponent-io/jsonpath/README.md delete mode 100644 vendor/github.com/exponent-io/jsonpath/decoder.go delete mode 100644 vendor/github.com/exponent-io/jsonpath/path.go delete mode 100644 vendor/github.com/exponent-io/jsonpath/pathaction.go delete mode 100644 vendor/github.com/fvbommel/sortorder/.gitignore delete mode 100644 vendor/github.com/fvbommel/sortorder/LICENSE delete mode 100644 vendor/github.com/fvbommel/sortorder/README.md delete mode 100644 vendor/github.com/fvbommel/sortorder/doc.go delete mode 100644 vendor/github.com/fvbommel/sortorder/natsort.go delete mode 100644 vendor/github.com/go-errors/errors/.travis.yml delete mode 100644 vendor/github.com/go-errors/errors/LICENSE.MIT delete mode 100644 vendor/github.com/go-errors/errors/README.md delete mode 100644 vendor/github.com/go-errors/errors/error.go delete mode 100644 vendor/github.com/go-errors/errors/error_1_13.go delete mode 100644 vendor/github.com/go-errors/errors/error_backward.go delete mode 100644 vendor/github.com/go-errors/errors/parse_panic.go delete mode 100644 vendor/github.com/go-errors/errors/stackframe.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/.gitignore delete mode 100644 vendor/github.com/go-gorp/gorp/v3/.travis.yml delete mode 100644 vendor/github.com/go-gorp/gorp/v3/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-gorp/gorp/v3/LICENSE delete mode 100644 vendor/github.com/go-gorp/gorp/v3/README.md delete mode 100644 vendor/github.com/go-gorp/gorp/v3/column.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/db.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect_mysql.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect_oracle.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect_postgres.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect_snowflake.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect_sqlite.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/dialect_sqlserver.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/doc.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/errors.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/gorp.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/hooks.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/index.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/lockerror.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/logging.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/nulltypes.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/select.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/table.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/table_bindings.go delete mode 100644 vendor/github.com/go-gorp/gorp/v3/test_all.sh delete mode 100644 vendor/github.com/go-gorp/gorp/v3/transaction.go delete mode 100644 vendor/github.com/gobwas/glob/.gitignore delete mode 100644 vendor/github.com/gobwas/glob/.travis.yml delete mode 100644 vendor/github.com/gobwas/glob/LICENSE delete mode 100644 vendor/github.com/gobwas/glob/bench.sh delete mode 100644 vendor/github.com/gobwas/glob/compiler/compiler.go delete mode 100644 vendor/github.com/gobwas/glob/glob.go delete mode 100644 vendor/github.com/gobwas/glob/match/any.go delete mode 100644 vendor/github.com/gobwas/glob/match/any_of.go delete mode 100644 vendor/github.com/gobwas/glob/match/btree.go delete mode 100644 vendor/github.com/gobwas/glob/match/contains.go delete mode 100644 vendor/github.com/gobwas/glob/match/every_of.go delete mode 100644 vendor/github.com/gobwas/glob/match/list.go delete mode 100644 vendor/github.com/gobwas/glob/match/match.go delete mode 100644 vendor/github.com/gobwas/glob/match/max.go delete mode 100644 vendor/github.com/gobwas/glob/match/min.go delete mode 100644 vendor/github.com/gobwas/glob/match/nothing.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix_any.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix_suffix.go delete mode 100644 vendor/github.com/gobwas/glob/match/range.go delete mode 100644 vendor/github.com/gobwas/glob/match/row.go delete mode 100644 vendor/github.com/gobwas/glob/match/segments.go delete mode 100644 vendor/github.com/gobwas/glob/match/single.go delete mode 100644 vendor/github.com/gobwas/glob/match/suffix.go delete mode 100644 vendor/github.com/gobwas/glob/match/suffix_any.go delete mode 100644 vendor/github.com/gobwas/glob/match/super.go delete mode 100644 vendor/github.com/gobwas/glob/match/text.go delete mode 100644 vendor/github.com/gobwas/glob/readme.md delete mode 100644 vendor/github.com/gobwas/glob/syntax/ast/ast.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/ast/parser.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/lexer/lexer.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/lexer/token.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/syntax.go delete mode 100644 vendor/github.com/gobwas/glob/util/runes/runes.go delete mode 100644 vendor/github.com/gobwas/glob/util/strings/strings.go delete mode 100644 vendor/github.com/gofrs/flock/.gitignore delete mode 100644 vendor/github.com/gofrs/flock/.travis.yml delete mode 100644 vendor/github.com/gofrs/flock/LICENSE delete mode 100644 vendor/github.com/gofrs/flock/README.md delete mode 100644 vendor/github.com/gofrs/flock/appveyor.yml delete mode 100644 vendor/github.com/gofrs/flock/flock.go delete mode 100644 vendor/github.com/gofrs/flock/flock_aix.go delete mode 100644 vendor/github.com/gofrs/flock/flock_unix.go delete mode 100644 vendor/github.com/gofrs/flock/flock_winapi.go delete mode 100644 vendor/github.com/gofrs/flock/flock_windows.go delete mode 100644 vendor/github.com/google/btree/.travis.yml delete mode 100644 vendor/github.com/google/btree/LICENSE delete mode 100644 vendor/github.com/google/btree/README.md delete mode 100644 vendor/github.com/google/btree/btree.go delete mode 100644 vendor/github.com/google/shlex/COPYING delete mode 100644 vendor/github.com/google/shlex/README delete mode 100644 vendor/github.com/google/shlex/shlex.go delete mode 100644 vendor/github.com/gosuri/uitable/.travis.yml delete mode 100644 vendor/github.com/gosuri/uitable/LICENSE delete mode 100644 vendor/github.com/gosuri/uitable/Makefile delete mode 100644 vendor/github.com/gosuri/uitable/README.md delete mode 100644 vendor/github.com/gosuri/uitable/table.go delete mode 100644 vendor/github.com/gosuri/uitable/util/strutil/strutil.go delete mode 100644 vendor/github.com/gosuri/uitable/util/wordwrap/LICENSE.md delete mode 100644 vendor/github.com/gosuri/uitable/util/wordwrap/README.md delete mode 100644 vendor/github.com/gosuri/uitable/util/wordwrap/wordwrap.go delete mode 100644 vendor/github.com/gregjones/httpcache/.travis.yml delete mode 100644 vendor/github.com/gregjones/httpcache/LICENSE.txt delete mode 100644 vendor/github.com/gregjones/httpcache/README.md delete mode 100644 vendor/github.com/gregjones/httpcache/httpcache.go delete mode 100644 vendor/github.com/huandu/xstrings/.gitignore delete mode 100644 vendor/github.com/huandu/xstrings/CONTRIBUTING.md delete mode 100644 vendor/github.com/huandu/xstrings/LICENSE delete mode 100644 vendor/github.com/huandu/xstrings/README.md delete mode 100644 vendor/github.com/huandu/xstrings/common.go delete mode 100644 vendor/github.com/huandu/xstrings/convert.go delete mode 100644 vendor/github.com/huandu/xstrings/count.go delete mode 100644 vendor/github.com/huandu/xstrings/doc.go delete mode 100644 vendor/github.com/huandu/xstrings/format.go delete mode 100644 vendor/github.com/huandu/xstrings/manipulate.go delete mode 100644 vendor/github.com/huandu/xstrings/stringbuilder.go delete mode 100644 vendor/github.com/huandu/xstrings/stringbuilder_go110.go delete mode 100644 vendor/github.com/huandu/xstrings/translate.go delete mode 100644 vendor/github.com/jmoiron/sqlx/.gitignore delete mode 100644 vendor/github.com/jmoiron/sqlx/.travis.yml delete mode 100644 vendor/github.com/jmoiron/sqlx/LICENSE delete mode 100644 vendor/github.com/jmoiron/sqlx/README.md delete mode 100644 vendor/github.com/jmoiron/sqlx/bind.go delete mode 100644 vendor/github.com/jmoiron/sqlx/doc.go delete mode 100644 vendor/github.com/jmoiron/sqlx/named.go delete mode 100644 vendor/github.com/jmoiron/sqlx/named_context.go delete mode 100644 vendor/github.com/jmoiron/sqlx/reflectx/README.md delete mode 100644 vendor/github.com/jmoiron/sqlx/reflectx/reflect.go delete mode 100644 vendor/github.com/jmoiron/sqlx/sqlx.go delete mode 100644 vendor/github.com/jmoiron/sqlx/sqlx_context.go delete mode 100644 vendor/github.com/lann/builder/.gitignore delete mode 100644 vendor/github.com/lann/builder/.travis.yml delete mode 100644 vendor/github.com/lann/builder/LICENSE delete mode 100644 vendor/github.com/lann/builder/README.md delete mode 100644 vendor/github.com/lann/builder/builder.go delete mode 100644 vendor/github.com/lann/builder/reflect.go delete mode 100644 vendor/github.com/lann/builder/registry.go delete mode 100644 vendor/github.com/lann/ps/LICENSE delete mode 100644 vendor/github.com/lann/ps/README.md delete mode 100644 vendor/github.com/lann/ps/list.go delete mode 100644 vendor/github.com/lann/ps/map.go delete mode 100644 vendor/github.com/lann/ps/profile.sh delete mode 100644 vendor/github.com/lib/pq/.gitignore delete mode 100644 vendor/github.com/lib/pq/LICENSE.md delete mode 100644 vendor/github.com/lib/pq/README.md delete mode 100644 vendor/github.com/lib/pq/TESTS.md delete mode 100644 vendor/github.com/lib/pq/array.go delete mode 100644 vendor/github.com/lib/pq/buf.go delete mode 100644 vendor/github.com/lib/pq/conn.go delete mode 100644 vendor/github.com/lib/pq/conn_go115.go delete mode 100644 vendor/github.com/lib/pq/conn_go18.go delete mode 100644 vendor/github.com/lib/pq/connector.go delete mode 100644 vendor/github.com/lib/pq/copy.go delete mode 100644 vendor/github.com/lib/pq/doc.go delete mode 100644 vendor/github.com/lib/pq/encode.go delete mode 100644 vendor/github.com/lib/pq/error.go delete mode 100644 vendor/github.com/lib/pq/krb.go delete mode 100644 vendor/github.com/lib/pq/notice.go delete mode 100644 vendor/github.com/lib/pq/notify.go delete mode 100644 vendor/github.com/lib/pq/oid/doc.go delete mode 100644 vendor/github.com/lib/pq/oid/types.go delete mode 100644 vendor/github.com/lib/pq/rows.go delete mode 100644 vendor/github.com/lib/pq/scram/scram.go delete mode 100644 vendor/github.com/lib/pq/ssl.go delete mode 100644 vendor/github.com/lib/pq/ssl_permissions.go delete mode 100644 vendor/github.com/lib/pq/ssl_windows.go delete mode 100644 vendor/github.com/lib/pq/url.go delete mode 100644 vendor/github.com/lib/pq/user_other.go delete mode 100644 vendor/github.com/lib/pq/user_posix.go delete mode 100644 vendor/github.com/lib/pq/user_windows.go delete mode 100644 vendor/github.com/lib/pq/uuid.go delete mode 100644 vendor/github.com/mattn/go-runewidth/LICENSE delete mode 100644 vendor/github.com/mattn/go-runewidth/README.md delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_appengine.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_js.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_posix.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_table.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_windows.go delete mode 100644 vendor/github.com/mitchellh/copystructure/LICENSE delete mode 100644 vendor/github.com/mitchellh/copystructure/README.md delete mode 100644 vendor/github.com/mitchellh/copystructure/copier_time.go delete mode 100644 vendor/github.com/mitchellh/copystructure/copystructure.go delete mode 100644 vendor/github.com/mitchellh/reflectwalk/.travis.yml delete mode 100644 vendor/github.com/mitchellh/reflectwalk/LICENSE delete mode 100644 vendor/github.com/mitchellh/reflectwalk/README.md delete mode 100644 vendor/github.com/mitchellh/reflectwalk/location.go delete mode 100644 vendor/github.com/mitchellh/reflectwalk/location_string.go delete mode 100644 vendor/github.com/mitchellh/reflectwalk/reflectwalk.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/.travis.yml delete mode 100644 vendor/github.com/monochromegane/go-gitignore/LICENSE delete mode 100644 vendor/github.com/monochromegane/go-gitignore/README.md delete mode 100644 vendor/github.com/monochromegane/go-gitignore/depth_holder.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/full_scan_patterns.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/gitignore.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/index_scan_patterns.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/initial_holder.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/match.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/pattern.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/patterns.go delete mode 100644 vendor/github.com/monochromegane/go-gitignore/util.go delete mode 100644 vendor/github.com/peterbourgon/diskv/LICENSE delete mode 100644 vendor/github.com/peterbourgon/diskv/README.md delete mode 100644 vendor/github.com/peterbourgon/diskv/compression.go delete mode 100644 vendor/github.com/peterbourgon/diskv/diskv.go delete mode 100644 vendor/github.com/peterbourgon/diskv/index.go delete mode 100644 vendor/github.com/rivo/uniseg/LICENSE.txt delete mode 100644 vendor/github.com/rivo/uniseg/README.md delete mode 100644 vendor/github.com/rivo/uniseg/doc.go delete mode 100644 vendor/github.com/rivo/uniseg/eastasianwidth.go delete mode 100644 vendor/github.com/rivo/uniseg/emojipresentation.go delete mode 100644 vendor/github.com/rivo/uniseg/gen_breaktest.go delete mode 100644 vendor/github.com/rivo/uniseg/gen_properties.go delete mode 100644 vendor/github.com/rivo/uniseg/grapheme.go delete mode 100644 vendor/github.com/rivo/uniseg/graphemeproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/graphemerules.go delete mode 100644 vendor/github.com/rivo/uniseg/line.go delete mode 100644 vendor/github.com/rivo/uniseg/lineproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/linerules.go delete mode 100644 vendor/github.com/rivo/uniseg/properties.go delete mode 100644 vendor/github.com/rivo/uniseg/sentence.go delete mode 100644 vendor/github.com/rivo/uniseg/sentenceproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/sentencerules.go delete mode 100644 vendor/github.com/rivo/uniseg/step.go delete mode 100644 vendor/github.com/rivo/uniseg/width.go delete mode 100644 vendor/github.com/rivo/uniseg/word.go delete mode 100644 vendor/github.com/rivo/uniseg/wordproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/wordrules.go delete mode 100644 vendor/github.com/rubenv/sql-migrate/.dockerignore delete mode 100644 vendor/github.com/rubenv/sql-migrate/.gitignore delete mode 100644 vendor/github.com/rubenv/sql-migrate/.golangci.yaml delete mode 100644 vendor/github.com/rubenv/sql-migrate/Dockerfile delete mode 100644 vendor/github.com/rubenv/sql-migrate/LICENSE delete mode 100644 vendor/github.com/rubenv/sql-migrate/Makefile delete mode 100644 vendor/github.com/rubenv/sql-migrate/README.md delete mode 100644 vendor/github.com/rubenv/sql-migrate/doc.go delete mode 100644 vendor/github.com/rubenv/sql-migrate/migrate.go delete mode 100644 vendor/github.com/rubenv/sql-migrate/migrate_go116.go delete mode 100644 vendor/github.com/rubenv/sql-migrate/sqlparse/LICENSE delete mode 100644 vendor/github.com/rubenv/sql-migrate/sqlparse/README.md delete mode 100644 vendor/github.com/rubenv/sql-migrate/sqlparse/sqlparse.go delete mode 100644 vendor/github.com/rubenv/sql-migrate/test-migrations/1_initial.sql delete mode 100644 vendor/github.com/rubenv/sql-migrate/test-migrations/2_record.sql delete mode 100644 vendor/github.com/shopspring/decimal/.gitignore delete mode 100644 vendor/github.com/shopspring/decimal/.travis.yml delete mode 100644 vendor/github.com/shopspring/decimal/CHANGELOG.md delete mode 100644 vendor/github.com/shopspring/decimal/LICENSE delete mode 100644 vendor/github.com/shopspring/decimal/README.md delete mode 100644 vendor/github.com/shopspring/decimal/decimal-go.go delete mode 100644 vendor/github.com/shopspring/decimal/decimal.go delete mode 100644 vendor/github.com/shopspring/decimal/rounding.go delete mode 100644 vendor/github.com/spf13/cast/.gitignore delete mode 100644 vendor/github.com/spf13/cast/LICENSE delete mode 100644 vendor/github.com/spf13/cast/Makefile delete mode 100644 vendor/github.com/spf13/cast/README.md delete mode 100644 vendor/github.com/spf13/cast/cast.go delete mode 100644 vendor/github.com/spf13/cast/caste.go delete mode 100644 vendor/github.com/spf13/cast/timeformattype_string.go delete mode 100644 vendor/github.com/spf13/cobra/doc/man_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/md_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/rest_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/util.go delete mode 100644 vendor/github.com/spf13/cobra/doc/yaml_docs.go delete mode 100644 vendor/github.com/xeipuuv/gojsonpointer/LICENSE-APACHE-2.0.txt delete mode 100644 vendor/github.com/xeipuuv/gojsonpointer/README.md delete mode 100644 vendor/github.com/xeipuuv/gojsonpointer/pointer.go delete mode 100644 vendor/github.com/xeipuuv/gojsonreference/LICENSE-APACHE-2.0.txt delete mode 100644 vendor/github.com/xeipuuv/gojsonreference/README.md delete mode 100644 vendor/github.com/xeipuuv/gojsonreference/reference.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/.gitignore delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/.travis.yml delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/LICENSE-APACHE-2.0.txt delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/README.md delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/draft.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/errors.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/format_checkers.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/glide.yaml delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/internalLog.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/jsonContext.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/locales.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/result.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/schema.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/schemaLoader.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/schemaPool.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/schemaReferencePool.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/schemaType.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/subSchema.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/types.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/utils.go delete mode 100644 vendor/github.com/xeipuuv/gojsonschema/validation.go delete mode 100644 vendor/github.com/xlab/treeprint/.gitignore delete mode 100644 vendor/github.com/xlab/treeprint/LICENSE delete mode 100644 vendor/github.com/xlab/treeprint/README.md delete mode 100644 vendor/github.com/xlab/treeprint/helpers.go delete mode 100644 vendor/github.com/xlab/treeprint/struct.go delete mode 100644 vendor/github.com/xlab/treeprint/treeprint.go delete mode 100644 vendor/go.starlark.net/LICENSE delete mode 100644 vendor/go.starlark.net/internal/compile/compile.go delete mode 100644 vendor/go.starlark.net/internal/compile/serial.go delete mode 100644 vendor/go.starlark.net/internal/spell/spell.go delete mode 100644 vendor/go.starlark.net/resolve/binding.go delete mode 100644 vendor/go.starlark.net/resolve/resolve.go delete mode 100644 vendor/go.starlark.net/starlark/debug.go delete mode 100644 vendor/go.starlark.net/starlark/empty.s delete mode 100644 vendor/go.starlark.net/starlark/eval.go delete mode 100644 vendor/go.starlark.net/starlark/hashtable.go delete mode 100644 vendor/go.starlark.net/starlark/int.go delete mode 100644 vendor/go.starlark.net/starlark/int_generic.go delete mode 100644 vendor/go.starlark.net/starlark/int_posix64.go delete mode 100644 vendor/go.starlark.net/starlark/interp.go delete mode 100644 vendor/go.starlark.net/starlark/library.go delete mode 100644 vendor/go.starlark.net/starlark/profile.go delete mode 100644 vendor/go.starlark.net/starlark/unpack.go delete mode 100644 vendor/go.starlark.net/starlark/value.go delete mode 100644 vendor/go.starlark.net/starlarkstruct/module.go delete mode 100644 vendor/go.starlark.net/starlarkstruct/struct.go delete mode 100644 vendor/go.starlark.net/syntax/grammar.txt delete mode 100644 vendor/go.starlark.net/syntax/parse.go delete mode 100644 vendor/go.starlark.net/syntax/quote.go delete mode 100644 vendor/go.starlark.net/syntax/scan.go delete mode 100644 vendor/go.starlark.net/syntax/syntax.go delete mode 100644 vendor/go.starlark.net/syntax/walk.go delete mode 100644 vendor/golang.org/x/crypto/bcrypt/base64.go delete mode 100644 vendor/golang.org/x/crypto/bcrypt/bcrypt.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/block.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/cipher.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/const.go delete mode 100644 vendor/golang.org/x/crypto/cast5/cast5.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/armor/armor.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/armor/encode.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/canonical_text.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/clearsign/clearsign.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/errors/errors.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/keys.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/compressed.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/config.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/literal.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/ocfb.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/opaque.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/packet.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/private_key.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/public_key.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/reader.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/signature.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/userattribute.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/userid.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/read.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/s2k/s2k.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/write.go delete mode 100644 vendor/golang.org/x/crypto/scrypt/scrypt.go delete mode 100644 vendor/golang.org/x/text/encoding/encoding.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/identifier/identifier.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/identifier/mib.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/internal.go delete mode 100644 vendor/golang.org/x/text/encoding/unicode/override.go delete mode 100644 vendor/golang.org/x/text/encoding/unicode/unicode.go delete mode 100644 vendor/golang.org/x/text/internal/utf8internal/utf8internal.go delete mode 100644 vendor/golang.org/x/text/runes/cond.go delete mode 100644 vendor/golang.org/x/text/runes/runes.go delete mode 100644 vendor/helm.sh/helm/v3/LICENSE delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/completion.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/create.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/dependency.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/dependency_build.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/dependency_update.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/docs.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/env.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/flags.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get_all.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get_hooks.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get_manifest.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get_metadata.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get_notes.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/get_values.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/helm.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/history.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/install.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/lint.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/list.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/load_plugins.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/package.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/plugin.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/plugin_install.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/plugin_list.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/plugin_uninstall.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/plugin_update.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/printer.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/pull.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/push.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/registry.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/registry_login.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/registry_logout.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/release_testing.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/repo.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/repo_add.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/repo_index.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/repo_list.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/repo_remove.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/repo_update.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/require/args.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/rollback.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/root.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/root_unix.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/root_windows.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/search.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/search/search.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/search_hub.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/search_repo.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/show.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/status.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/template.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/uninstall.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/upgrade.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/verify.go delete mode 100644 vendor/helm.sh/helm/v3/cmd/helm/version.go delete mode 100644 vendor/helm.sh/helm/v3/internal/fileutil/fileutil.go delete mode 100644 vendor/helm.sh/helm/v3/internal/monocular/client.go delete mode 100644 vendor/helm.sh/helm/v3/internal/monocular/doc.go delete mode 100644 vendor/helm.sh/helm/v3/internal/monocular/search.go delete mode 100644 vendor/helm.sh/helm/v3/internal/resolver/resolver.go delete mode 100644 vendor/helm.sh/helm/v3/internal/sympath/walk.go delete mode 100644 vendor/helm.sh/helm/v3/internal/third_party/dep/fs/fs.go delete mode 100644 vendor/helm.sh/helm/v3/internal/third_party/dep/fs/rename.go delete mode 100644 vendor/helm.sh/helm/v3/internal/third_party/dep/fs/rename_windows.go delete mode 100644 vendor/helm.sh/helm/v3/internal/third_party/k8s.io/kubernetes/deployment/util/deploymentutil.go delete mode 100644 vendor/helm.sh/helm/v3/internal/tlsutil/cfg.go delete mode 100644 vendor/helm.sh/helm/v3/internal/tlsutil/tls.go delete mode 100644 vendor/helm.sh/helm/v3/internal/urlutil/urlutil.go delete mode 100644 vendor/helm.sh/helm/v3/internal/version/version.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/action.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/dependency.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/get.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/get_metadata.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/get_values.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/history.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/hooks.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/install.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/lazyclient.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/lint.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/list.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/package.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/pull.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/push.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/registry_login.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/registry_logout.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/release_testing.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/resource_policy.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/rollback.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/show.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/status.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/uninstall.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/upgrade.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/validate.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/action/verify.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/chart.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/dependency.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/errors.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/file.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/loader/archive.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/loader/directory.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/loader/load.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chart/metadata.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/capabilities.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/chartfile.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/coalesce.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/compatible.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/create.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/dependencies.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/errors.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/expand.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/jsonschema.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/save.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/validate_name.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/chartutil/values.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/cli/environment.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/cli/output/output.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/cli/roundtripper.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/cli/values/options.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/downloader/chart_downloader.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/downloader/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/downloader/manager.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/engine/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/engine/engine.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/engine/files.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/engine/funcs.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/engine/lookup_func.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/getter/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/getter/getter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/getter/httpgetter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/getter/ocigetter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/getter/plugingetter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/helmpath/home.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/helmpath/lazypath.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/helmpath/lazypath_darwin.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/helmpath/lazypath_unix.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/helmpath/lazypath_windows.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/helmpath/xdg/xdg.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/ignore/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/ignore/rules.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/client.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/config.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/converter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/factory.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/fake/fake.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/fake/printer.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/interface.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/ready.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/resource.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/resource_policy.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/result.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/kube/wait.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/lint.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/rules/chartfile.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/rules/dependencies.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/rules/deprecations.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/rules/template.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/rules/values.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/support/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/lint/support/message.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/cache/cache.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/hooks.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/installer/base.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/installer/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/installer/http_installer.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/installer/installer.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/installer/local_installer.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/installer/vcs_installer.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/plugin/plugin.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/postrender/exec.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/postrender/postrender.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/provenance/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/provenance/sign.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/pusher/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/pusher/ocipusher.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/pusher/pusher.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/registry/client.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/registry/constants.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/registry/util.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/release/hook.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/release/info.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/release/mock.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/release/release.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/release/responses.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/release/status.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/releaseutil/filter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/releaseutil/kind_sorter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/releaseutil/manifest.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/releaseutil/sorter.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/repo/chartrepo.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/repo/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/repo/index.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/repo/repo.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/cfgmaps.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/driver.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/labels.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/memory.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/records.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/secrets.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/sql.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/driver/util.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/storage/storage.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/strvals/doc.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/strvals/literal_parser.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/strvals/parser.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/time/time.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/uploader/chart_uploader.go delete mode 100644 vendor/helm.sh/helm/v3/pkg/uploader/doc.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.pb.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/register.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/types.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructuredscheme/scheme.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/builder_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/builder_flags_fake.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/client_config.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/command_headers.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags_fake.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/doc.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/filename_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/io_options.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/json_yaml_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/jsonpath_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/kube_template_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/name_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/print_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/record_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericclioptions/template_flags.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/genericiooptions/io_options.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/builder.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/client.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/crd_finder.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/doc.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/fake.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/fallback_query_param_verifier.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/helper.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/interfaces.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/kustomizevisitor.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/mapper.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/metadata_decoder.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/query_param_verifier.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/query_param_verifier_v3.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/result.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/scheme.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/selector.go delete mode 100644 vendor/k8s.io/cli-runtime/pkg/resource/visitor.go delete mode 100644 vendor/k8s.io/client-go/discovery/cached/disk/cached_discovery.go delete mode 100644 vendor/k8s.io/client-go/discovery/cached/disk/round_tripper.go delete mode 100644 vendor/k8s.io/client-go/discovery/cached/memory/memcache.go delete mode 100644 vendor/k8s.io/client-go/openapi/cached/client.go delete mode 100644 vendor/k8s.io/client-go/openapi/cached/groupversion.go delete mode 100644 vendor/k8s.io/client-go/openapi3/root.go delete mode 100644 vendor/k8s.io/client-go/scale/client.go delete mode 100644 vendor/k8s.io/client-go/scale/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/interfaces.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsint/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsint/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsint/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/doc.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/register.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/types.go delete mode 100644 vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/client-go/scale/util.go delete mode 100644 vendor/k8s.io/client-go/tools/watch/informerwatcher.go delete mode 100644 vendor/k8s.io/client-go/tools/watch/retrywatcher.go delete mode 100644 vendor/k8s.io/client-go/tools/watch/until.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/validation/errors.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/validation/types.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/validation/validation.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/customcolumn.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/customcolumn_flags.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/get.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/get_flags.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/humanreadable_flags.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/skip_printer.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/sorter.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/get/table_printer.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/env_file.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/factory.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/factory_client_access.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/kubectl_match_version.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/override_options.go delete mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/printing.go delete mode 100644 vendor/k8s.io/kubectl/pkg/rawhttp/raw.go delete mode 100644 vendor/k8s.io/kubectl/pkg/scheme/install.go delete mode 100644 vendor/k8s.io/kubectl/pkg/scheme/scheme.go delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/i18n.go delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/OWNERS delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/README.md delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/extract.py delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/OWNERS delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/de_DE/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/de_DE/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/default/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/default/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/en_US/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/en_US/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/fr_FR/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/fr_FR/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/it_IT/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/it_IT/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/ja_JP/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/ja_JP/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/ko_KR/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/ko_KR/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/pt_BR/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/pt_BR/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/template.pot delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/zh_CN/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/zh_CN/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/zh_TW/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/kubectl/zh_TW/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/test/default/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/test/default/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/test/en_US/LC_MESSAGES/k8s.mo delete mode 100644 vendor/k8s.io/kubectl/pkg/util/i18n/translations/test/en_US/LC_MESSAGES/k8s.po delete mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/OWNERS delete mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/doc.go delete mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/openapi.go delete mode 100644 vendor/k8s.io/kubectl/pkg/util/openapi/openapi_getter.go delete mode 100644 vendor/k8s.io/kubectl/pkg/util/slice/slice.go delete mode 100644 vendor/k8s.io/kubectl/pkg/validation/schema.go delete mode 100644 vendor/k8s.io/kubectl/pkg/validation/validation.go delete mode 100644 vendor/k8s.io/utils/exec/README.md delete mode 100644 vendor/k8s.io/utils/exec/doc.go delete mode 100644 vendor/k8s.io/utils/exec/exec.go delete mode 100644 vendor/k8s.io/utils/exec/fixup_go118.go delete mode 100644 vendor/k8s.io/utils/exec/fixup_go119.go delete mode 100644 vendor/oras.land/oras-go/LICENSE delete mode 100644 vendor/oras.land/oras-go/pkg/artifact/consts.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/client.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/client_opts.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/docker/client.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/docker/login.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/docker/login_tls.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/docker/logout.go delete mode 100644 vendor/oras.land/oras-go/pkg/auth/docker/resolver.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/consts.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/decompress.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/errors.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/file.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/gunzip.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/interface.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/iowriter.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/manifest.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/memory.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/multireader.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/multiwriter.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/oci.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/opts.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/passthrough.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/readerat.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/registry.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/untar.go delete mode 100644 vendor/oras.land/oras-go/pkg/content/utils.go delete mode 100644 vendor/oras.land/oras-go/pkg/context/context.go delete mode 100644 vendor/oras.land/oras-go/pkg/context/logger.go delete mode 100644 vendor/oras.land/oras-go/pkg/oras/copy.go delete mode 100644 vendor/oras.land/oras-go/pkg/oras/errors.go delete mode 100644 vendor/oras.land/oras-go/pkg/oras/opts.go delete mode 100644 vendor/oras.land/oras-go/pkg/oras/provider.go delete mode 100644 vendor/oras.land/oras-go/pkg/oras/store.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/reference.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/auth/cache.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/auth/challenge.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/auth/client.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/auth/credential.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/auth/scope.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/internal/errutil/errors.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/internal/syncutil/once.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/repository.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/url.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/remote/utils.go delete mode 100644 vendor/oras.land/oras-go/pkg/registry/repository.go delete mode 100644 vendor/oras.land/oras-go/pkg/target/target.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/LICENSE delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/annotations/annotations.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/annotations/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/fieldspec/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/fieldspec/fieldspec.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/filtersutil/setters.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/fsslice/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/fsslice/fsslice.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/iampolicygenerator/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/iampolicygenerator/iampolicygenerator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/imagetag/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/imagetag/imagetag.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/imagetag/legacy.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/imagetag/updater.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/labels/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/labels/labels.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/nameref/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/nameref/nameref.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/nameref/seqfilter.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/namespace/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/namespace/namespace.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/patchjson6902/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/patchjson6902/patchjson6902.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/patchstrategicmerge/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/patchstrategicmerge/patchstrategicmerge.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/prefix/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/prefix/prefix.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/refvar/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/refvar/expand.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/refvar/refvar.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/replacement/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/replacement/replacement.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/replicacount/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/replicacount/replicacount.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/suffix/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/suffix/suffix.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/filters/valueadd/valueadd.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/hasher/hasher.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/ifc/ifc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/image/image.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/accumulator/loadconfigfromcrds.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/accumulator/namereferencetransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/accumulator/refvartransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/accumulator/resaccumulator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/AnnotationsTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/ConfigMapGenerator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/HashTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/IAMPolicyGenerator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/ImageTagTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/LabelTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/NamespaceTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/PatchJson6902Transformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/PatchStrategicMergeTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/PatchTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/PrefixTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/ReplacementTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/ReplicaCountTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/SecretGenerator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/SortOrderTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/SuffixTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/ValueAddTransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/builtins/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/generators/configmap.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/generators/secret.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/generators/utils.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/git/cloner.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/git/gitrunner.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/git/repospec.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/kusterr/yamlformaterror.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/loaddefaultconfig.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/namebackreferences.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/transformerconfig.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers/builtinplugintype_string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers/builtins.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/fnplugin/fnplugin.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/loader.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/utils/utils.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/target/errmissingkustomization.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/target/kusttarget.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/target/kusttarget_configplugin.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/target/multitransformer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/utils/annotations.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/utils/errtimeout.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/utils/makeResIds.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/utils/stringslice.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/utils/timedcall.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/validate/fieldvalidator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/commonannotations.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/commonlabels.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/defaultconfig.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/images.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/metadatalabels.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/nameprefix.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namereference.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namespace.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/namesuffix.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/replicas.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/templatelabels.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts/varreference.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/general.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/konfig/plugins.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/krusty/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/krusty/kustomizer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/krusty/options.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/kv/kv.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/loader/errors.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/loader/fileloader.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/loader/loader.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/loader/loadrestrictions.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/provenance/provenance.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/provider/depprovider.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resmap/factory.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resmap/resmap.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resmap/reswrangler.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resource/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resource/factory.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resource/idset.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resource/origin.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/resource/resource.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/builtinpluginloadingoptions_string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/configmapargs.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/erronlybuiltinpluginsallowed.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/errunabletofind.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/fieldspec.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/generationbehavior.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/generatorargs.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/generatoroptions.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/helmchartargs.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/iampolicygenerator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/image.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/kustomization.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/kvpairsources.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/labels.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/loadrestrictions.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/loadrestrictions_string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/objectmeta.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/pair.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/patch.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/patchstrategicmerge.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/pluginconfig.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/pluginrestrictions.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/pluginrestrictions_string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/replacement.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/replacementfield.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/replica.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/secretargs.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/selector.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/sortoptions.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/typemeta.go delete mode 100644 vendor/sigs.k8s.io/kustomize/api/types/var.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/LICENSE delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/comments/comments.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/errors/errors.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/ext/ext.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fieldmeta/fieldmeta.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/confirmeddir.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/file.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/fileinfo.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/fileondisk.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/filesystem.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/fsnode.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/fsondisk.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/fsondisk_unix.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/fsondisk_windows.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/filesys/util.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/container/container.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/exec/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/exec/exec.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil/functiontypes.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil/runtimeutil.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil/types.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/starlark/context.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/starlark/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/starlark/starlark.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/LICENSE delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/NOTICE delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/README.md delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/apic.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/decode.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/emitterc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/encode.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/parserc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/readerc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/resolve.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/scannerc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/sorter.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/writerc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/yaml.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/yamlh.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/yamlprivateh.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util/LICENSE delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util/util.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/byteio_reader.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/byteio_writer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/filters.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/fmtr.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/grep.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/local.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/merge.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/merge3.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/modify.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/stripcomments.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/ignorefilesmatcher.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/kio.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/kioutil/kioutil.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/pkgio_reader.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/pkgio_writer.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/tree.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/Makefile delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/README.md delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi/openapiinfo.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi/v1_21_2/swagger.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi/v1_21_2/swagger.pb delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/kustomizationapi/swagger.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/kustomizationapi/swagger.json delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/openapi/openapi.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/order/syncorder.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/resid/gvk.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/resid/resid.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/runfn/runfn.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/sets/string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/sets/stringlist.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/sliceutil/slice.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/utils/pathsplitter.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/alias.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/compatibility.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/const.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/datamap.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/doc.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/filters.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/fns.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/labels/copied.deepcopy.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/labels/labels.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/labels/selector.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/selection/operator.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/errors/errors.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/sets/empty.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/sets/string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/validation/field/errors.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/validation/field/path.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/validation/validation.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/kfns.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/mapnode.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/match.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge2/merge2.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge2/smpdirective.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge2/smpdirective_string.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge3/merge3.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge3/visitor.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/order.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/rnode.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/schema/schema.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/types.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/util.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/associative_sequence.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/map.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/nonassociative_sequence.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/scalar.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/visitor.go delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/walk.go diff --git a/.bingo/.gitignore b/.bingo/.gitignore new file mode 100644 index 0000000000..9efccf683c --- /dev/null +++ b/.bingo/.gitignore @@ -0,0 +1,13 @@ + +# Ignore everything +* + +# But not these files: +!.gitignore +!*.mod +!*.sum +!README.md +!Variables.mk +!variables.env + +*tmp.mod diff --git a/.bingo/README.md b/.bingo/README.md new file mode 100644 index 0000000000..7a5c2d4f6d --- /dev/null +++ b/.bingo/README.md @@ -0,0 +1,14 @@ +# Project Development Dependencies. + +This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo. + +* Run `bingo get` to install all tools having each own module file in this directory. +* Run `bingo get ` to install that have own module file in this directory. +* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $() variable where is the .bingo/.mod. +* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool. +* For go: Import `.bingo/variables.go` to for variable names. +* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies. + +## Requirements + +* Go 1.14+ diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk new file mode 100644 index 0000000000..1ee7efad64 --- /dev/null +++ b/.bingo/Variables.mk @@ -0,0 +1,25 @@ +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT. +# All tools are designed to be build inside $GOBIN. +BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +GOPATH ?= $(shell go env GOPATH) +GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin +GO ?= $(shell which go) + +# Below generated variables ensure that every time a tool under each variable is invoked, the correct version +# will be used; reinstalling only if needed. +# For example for helm variable: +# +# In your main Makefile (for non array binaries): +# +#include .bingo/Variables.mk # Assuming -dir was set to .bingo . +# +#command: $(HELM) +# @echo "Running helm" +# @$(HELM) +# +HELM := $(GOBIN)/helm-v3.14.3 +$(HELM): $(BINGO_DIR)/helm.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/helm-v3.14.3" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=helm.mod -o=$(GOBIN)/helm-v3.14.3 "helm.sh/helm/v3/cmd/helm" + diff --git a/.bingo/go.mod b/.bingo/go.mod new file mode 100644 index 0000000000..610249af0b --- /dev/null +++ b/.bingo/go.mod @@ -0,0 +1 @@ +module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. \ No newline at end of file diff --git a/.bingo/helm.mod b/.bingo/helm.mod new file mode 100644 index 0000000000..41dc220278 --- /dev/null +++ b/.bingo/helm.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.21.0 + +require helm.sh/helm/v3 v3.14.3 // cmd/helm diff --git a/.bingo/helm.sum b/.bingo/helm.sum new file mode 100644 index 0000000000..358d3eff49 --- /dev/null +++ b/.bingo/helm.sum @@ -0,0 +1,488 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +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/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= +github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= +github.com/Masterminds/vcs v1.13.3 h1:IIA2aBdXvfbIM+yl/eTnL4hb1XwdpvuQLglAix1gweE= +github.com/Masterminds/vcs v1.13.3/go.mod h1:TiE7xuEjl1N4j016moRd6vezp6e6Lz23gypeXfzXeW8= +github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= +github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= +github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= +github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= +github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= +github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= +github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= +github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= +github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs= +github.com/go-gorp/gorp/v3 v3.1.0/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= +github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= +github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +helm.sh/helm/v3 v3.14.3 h1:HmvRJlwyyt9HjgmAuxHbHv3PhMz9ir/XNWHyXfmnOP4= +helm.sh/helm/v3 v3.14.3/go.mod h1:v6myVbyseSBJTzhmeE39UcPLNv6cQK6qss3dvgAySaE= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= +k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= +k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0= +k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc= +k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= +k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= +k8s.io/apiserver v0.29.0 h1:Y1xEMjJkP+BIi0GSEv1BBrf1jLU9UPfAnnGGbbDdp7o= +k8s.io/apiserver v0.29.0/go.mod h1:31n78PsRKPmfpee7/l9NYEv67u6hOL6AfcE761HapDM= +k8s.io/cli-runtime v0.29.0 h1:q2kC3cex4rOBLfPOnMSzV2BIrrQlx97gxHJs21KxKS4= +k8s.io/cli-runtime v0.29.0/go.mod h1:VKudXp3X7wR45L+nER85YUzOQIru28HQpXr0mTdeCrk= +k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= +k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= +k8s.io/component-base v0.29.0 h1:T7rjd5wvLnPBV1vC4zWd/iWRbV8Mdxs+nGaoaFzGw3s= +k8s.io/component-base v0.29.0/go.mod h1:sADonFTQ9Zc9yFLghpDpmNXEdHyQmFIGbiuZbqAXQ1M= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI= +k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY= +oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/.bingo/variables.env b/.bingo/variables.env new file mode 100644 index 0000000000..dac7a015da --- /dev/null +++ b/.bingo/variables.env @@ -0,0 +1,12 @@ +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT. +# All tools are designed to be build inside $GOBIN. +# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. +GOBIN=${GOBIN:=$(go env GOBIN)} + +if [ -z "$GOBIN" ]; then + GOBIN="$(go env GOPATH)/bin" +fi + + +HELM="${GOBIN}/helm-v3.14.3" + diff --git a/Makefile b/Makefile index 23e45ee0e8..d6d9d88dab 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ SHELL := /bin/bash ROOT_DIR:= $(patsubst %/,%,$(dir $(realpath $(lastword $(MAKEFILE_LIST))))) CONTAINER_ENGINE := docker +# import tools +include .bingo/Variables.mk + OPM_VERSION := $(or $(SOURCE_GIT_TAG),$(shell git describe --always --tags HEAD)) BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') # ART builds are performed in dist-git, with content (but not commits) copied @@ -139,7 +142,7 @@ vendor: go mod verify .PHONY: manifests -manifests: ## Generate manifests +manifests: $(HELM) ## Generate manifests OLM_VERSION=$(OLM_VERSION) ./scripts/generate_crds_manifests.sh .PHONY: generate-manifests diff --git a/go.mod b/go.mod index 75e939a1b8..f6e6ad7288 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v2 v2.4.0 - helm.sh/helm/v3 v3.14.3 k8s.io/api v0.29.3 k8s.io/apimachinery v0.29.3 k8s.io/client-go v0.29.3 @@ -38,11 +37,6 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.3.2 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Masterminds/squirrel v1.5.4 // indirect - github.com/Masterminds/vcs v1.13.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.12.0-rc.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect @@ -51,7 +45,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chai2010/gettext-go v1.0.2 // indirect github.com/containerd/cgroups/v3 v3.0.2 // indirect github.com/containerd/containerd v1.7.12 // indirect github.com/containerd/continuity v0.4.2 // indirect @@ -65,8 +58,6 @@ require ( github.com/containers/storage v1.51.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/distribution v2.7.1+incompatible // indirect github.com/distribution/reference v0.6.0 // indirect @@ -75,22 +66,17 @@ require ( github.com/docker/docker v25.0.5+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.0 // indirect github.com/docker/go-connections v0.5.0 // indirect - github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.8.0 // indirect - github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/fvbommel/sortorder v1.1.0 // indirect github.com/go-air/gini v1.0.4 // indirect - github.com/go-errors/errors v1.4.2 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-git/go-git/v5 v5.11.0 // indirect - github.com/go-gorp/gorp/v3 v3.1.0 // indirect github.com/go-jose/go-jose/v3 v3.0.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect @@ -99,38 +85,30 @@ require ( github.com/go-openapi/swag v0.22.9 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gobuffalo/flect v0.2.3 // indirect - github.com/gobwas/glob v0.2.3 // indirect github.com/goccy/go-yaml v1.8.1 // indirect - github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-migrate/migrate/v4 v4.17.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/btree v1.0.1 // indirect github.com/google/cel-go v0.17.7 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/gosuri/uitable v0.0.4 // indirect - github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/h2non/filetype v1.1.3 // indirect github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/gojq v0.12.15 // indirect github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jmoiron/sqlx v1.3.5 // indirect github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -138,20 +116,14 @@ require ( github.com/klauspost/compress v1.17.4 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect - github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect - github.com/lib/pq v1.10.9 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/hashstructure v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/spdystream v0.2.0 // indirect github.com/moby/sys/mountinfo v0.7.1 // indirect @@ -159,7 +131,6 @@ require ( github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/onsi/gomega v1.31.1 // indirect @@ -169,28 +140,20 @@ require ( github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/openshift/client-go v0.0.0-20220525160904-9e1acff93e4a // indirect github.com/otiai10/copy v1.14.0 // indirect - github.com/peterbourgon/diskv v2.0.1+incompatible // indirect + github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect github.com/prometheus/common v0.47.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/rivo/uniseg v0.4.7 // indirect - github.com/rubenv/sql-migrate v1.5.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shopspring/decimal v1.3.1 // indirect - github.com/spf13/cast v1.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spiffe/go-spiffe/v2 v2.1.6 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/vbatts/tar-split v0.11.5 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect - github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/xlab/treeprint v1.2.0 // indirect github.com/zeebo/errs v1.3.0 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.etcd.io/etcd/api/v3 v3.5.12 // indirect @@ -206,7 +169,6 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect - go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.21.0 // indirect @@ -243,11 +205,8 @@ require ( k8s.io/kms v0.29.3 // indirect k8s.io/kube-aggregator v0.29.3 // indirect k8s.io/kubectl v0.29.3 // indirect - oras.land/oras-go v1.2.5 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect - sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 7e5d45410a..ab56c26b50 100644 --- a/go.sum +++ b/go.sum @@ -20,21 +20,8 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= -github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= -github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -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/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= -github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= -github.com/Masterminds/vcs v1.13.3 h1:IIA2aBdXvfbIM+yl/eTnL4hb1XwdpvuQLglAix1gweE= -github.com/Masterminds/vcs v1.13.3/go.mod h1:TiE7xuEjl1N4j016moRd6vezp6e6Lz23gypeXfzXeW8= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -75,11 +62,6 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= -github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= @@ -116,13 +98,10 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -152,8 +131,6 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -176,8 +153,6 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro= github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -185,15 +160,9 @@ github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBD github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI= -github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= -github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -202,8 +171,6 @@ github.com/go-air/gini v1.0.4 h1:lteMAxHKNOAjIqazL/klOJJmxq6YxxSuJ17MnMXny+s= github.com/go-air/gini v1.0.4/go.mod h1:dd8RvT1xcv6N1da33okvBd8DhMh1/A4siGy6ErjTljs= github.com/go-bindata/go-bindata/v3 v3.1.3 h1:F0nVttLC3ws0ojc7p60veTurcOm//D4QBODNM7EGrCI= github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I= -github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= @@ -215,8 +182,6 @@ github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= -github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs= -github.com/go-gorp/gorp/v3 v3.1.0/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw= github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -252,26 +217,14 @@ github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZC github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobuffalo/flect v0.2.3 h1:f/ZukRnSNA/DUpSNDadko7Qc0PhGvsew35p/2tu+CRY= github.com/gobuffalo/flect v0.2.3/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= -github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= -github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= -github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= -github.com/gobuffalo/packd v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY= -github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= -github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-yaml v1.8.1 h1:JuZRFlqLM5cWF6A+waL8AKVuCcqvKOuhJtUQI+L3ez0= github.com/goccy/go-yaml v1.8.1/go.mod h1:wS4gNoLalDSJxo/SpngzPQ2BN4uuZVLCmbM4S3vd4+Y= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -320,7 +273,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -336,8 +288,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20230323073829-e72429f035bd h1:r8yyd+DJDmsUhGrRBxH5Pj7KeFK5l+Y3FsgT8keqKtk= github.com/google/pprof v0.0.0-20230323073829-e72429f035bd/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -357,9 +307,6 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= -github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -383,19 +330,15 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru/arc/v2 v2.0.5 h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGNJAg1dcN2Fpfw= github.com/hashicorp/golang-lru/arc/v2 v2.0.5/go.mod h1:ny6zBSQZi2JxIeYcv7kt2sH2PXJtirBN7RDhRpxPkxU= github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4= github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= -github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -409,8 +352,6 @@ github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2s github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= -github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d h1:A2/B900ip/Z20TzkLeGRNy1s6J2HmH9AmGt+dHyqb4I= github.com/joelanford/ignore v0.0.0-20210607151042-0d25dc18b62d/go.mod h1:7HQupe4vyNxMKXmM5DFuwXHsqwMyglcYmZBtlDPIcZ8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -419,15 +360,12 @@ github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUB github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= -github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -452,12 +390,7 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= -github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= -github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= -github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= @@ -469,12 +402,6 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= -github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= -github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= -github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= -github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -486,23 +413,13 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 h1:NicmruxkeqHjDv03SfSxqmaLuisddudfP3h5wdXFbhM= github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1/go.mod h1:eyp4DdUJAKkr9tvxR3jWhw2mDK7CWABMG5r9uyaKC7I= -github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg= -github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 h1:lPmsut5Sk7eK2BmDXuvNEvMbT7MkAJBu64Yxr7iJ6nk= github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37/go.mod h1:dYWq+UWoFCDY1TndvFUQuhBbIYmZpjreC8adEAx93zE= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= @@ -511,9 +428,6 @@ github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -531,8 +445,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -572,7 +484,6 @@ github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI= github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= @@ -582,12 +493,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= -github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -597,14 +504,10 @@ github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZ github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= @@ -615,24 +518,15 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY= github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= -github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= -github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -646,9 +540,6 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= @@ -667,7 +558,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -691,17 +581,8 @@ github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= -github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -763,8 +644,6 @@ go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6 go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= -go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= -go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -786,7 +665,6 @@ golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= @@ -833,7 +711,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= @@ -868,7 +745,6 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -894,7 +770,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -903,8 +778,6 @@ golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= @@ -918,7 +791,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -1039,8 +911,6 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= -helm.sh/helm/v3 v3.14.3 h1:HmvRJlwyyt9HjgmAuxHbHv3PhMz9ir/XNWHyXfmnOP4= -helm.sh/helm/v3 v3.14.3/go.mod h1:v6myVbyseSBJTzhmeE39UcPLNv6cQK6qss3dvgAySaE= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1095,8 +965,6 @@ k8s.io/kubectl v0.29.3/go.mod h1:yCxfY1dbwgVdEt2zkJ6d5NNLOhhWgTyrqACIoFhpdd4= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo= -oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= @@ -1105,10 +973,6 @@ sigs.k8s.io/controller-tools v0.8.0 h1:uUkfTGEwrguqYYfcI2RRGUnC8mYdCFDqfwPKUcNJh sigs.k8s.io/controller-tools v0.8.0/go.mod h1:qE2DXhVOiEq5ijmINcFbqi9GZrrUjzB1TuJU0xa6eoY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= -sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= -sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= -sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/scripts/generate_crds_manifests.sh b/scripts/generate_crds_manifests.sh index 7a71f68ffb..0bbbf35438 100755 --- a/scripts/generate_crds_manifests.sh +++ b/scripts/generate_crds_manifests.sh @@ -7,9 +7,10 @@ set -o pipefail ROOT_DIR=$(dirname "${BASH_SOURCE[0]}")/.. export GOFLAGS="-mod=vendor" +source .bingo/variables.env + YQ="go run ./vendor/github.com/mikefarah/yq/v3/" CONTROLLER_GEN="go run ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen" -HELM="go run helm.sh/helm/v3/cmd/helm" ver=${OLM_VERSION:-"0.0.0-dev"} tmpdir="$(mktemp -p . -d 2>/dev/null || mktemp -d ./tmpdir.XXXXXXX)" diff --git a/tools.go b/tools.go index 67a9435300..e63fe1fd15 100644 --- a/tools.go +++ b/tools.go @@ -18,7 +18,6 @@ import ( _ "github.com/operator-framework/api/crds" // operators.coreos.com CRD manifests _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" _ "google.golang.org/protobuf/cmd/protoc-gen-go" - _ "helm.sh/helm/v3/cmd/helm" _ "k8s.io/code-generator" _ "k8s.io/kube-openapi/cmd/openapi-gen" ) diff --git a/vendor/github.com/Masterminds/goutils/.travis.yml b/vendor/github.com/Masterminds/goutils/.travis.yml deleted file mode 100644 index 4025e01ec4..0000000000 --- a/vendor/github.com/Masterminds/goutils/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go - -go: - - 1.6 - - 1.7 - - 1.8 - - tip - -script: - - go test -v - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/06e3328629952dabe3e0 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/vendor/github.com/Masterminds/goutils/CHANGELOG.md b/vendor/github.com/Masterminds/goutils/CHANGELOG.md deleted file mode 100644 index d700ec47f2..0000000000 --- a/vendor/github.com/Masterminds/goutils/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# 1.0.1 (2017-05-31) - -## Fixed -- #21: Fix generation of alphanumeric strings (thanks @dbarranco) - -# 1.0.0 (2014-04-30) - -- Initial release. diff --git a/vendor/github.com/Masterminds/goutils/LICENSE.txt b/vendor/github.com/Masterminds/goutils/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/Masterminds/goutils/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Masterminds/goutils/README.md b/vendor/github.com/Masterminds/goutils/README.md deleted file mode 100644 index 163ffe72a8..0000000000 --- a/vendor/github.com/Masterminds/goutils/README.md +++ /dev/null @@ -1,70 +0,0 @@ -GoUtils -=========== -[![Stability: Maintenance](https://masterminds.github.io/stability/maintenance.svg)](https://masterminds.github.io/stability/maintenance.html) -[![GoDoc](https://godoc.org/github.com/Masterminds/goutils?status.png)](https://godoc.org/github.com/Masterminds/goutils) [![Build Status](https://travis-ci.org/Masterminds/goutils.svg?branch=master)](https://travis-ci.org/Masterminds/goutils) [![Build status](https://ci.appveyor.com/api/projects/status/sc2b1ew0m7f0aiju?svg=true)](https://ci.appveyor.com/project/mattfarina/goutils) - - -GoUtils provides users with utility functions to manipulate strings in various ways. It is a Go implementation of some -string manipulation libraries of Java Apache Commons. GoUtils includes the following Java Apache Commons classes: -* WordUtils -* RandomStringUtils -* StringUtils (partial implementation) - -## Installation -If you have Go set up on your system, from the GOPATH directory within the command line/terminal, enter this: - - go get github.com/Masterminds/goutils - -If you do not have Go set up on your system, please follow the [Go installation directions from the documenation](http://golang.org/doc/install), and then follow the instructions above to install GoUtils. - - -## Documentation -GoUtils doc is available here: [![GoDoc](https://godoc.org/github.com/Masterminds/goutils?status.png)](https://godoc.org/github.com/Masterminds/goutils) - - -## Usage -The code snippets below show examples of how to use GoUtils. Some functions return errors while others do not. The first instance below, which does not return an error, is the `Initials` function (located within the `wordutils.go` file). - - package main - - import ( - "fmt" - "github.com/Masterminds/goutils" - ) - - func main() { - - // EXAMPLE 1: A goutils function which returns no errors - fmt.Println (goutils.Initials("John Doe Foo")) // Prints out "JDF" - - } -Some functions return errors mainly due to illegal arguements used as parameters. The code example below illustrates how to deal with function that returns an error. In this instance, the function is the `Random` function (located within the `randomstringutils.go` file). - - package main - - import ( - "fmt" - "github.com/Masterminds/goutils" - ) - - func main() { - - // EXAMPLE 2: A goutils function which returns an error - rand1, err1 := goutils.Random (-1, 0, 0, true, true) - - if err1 != nil { - fmt.Println(err1) // Prints out error message because -1 was entered as the first parameter in goutils.Random(...) - } else { - fmt.Println(rand1) - } - - } - -## License -GoUtils is licensed under the Apache License, Version 2.0. Please check the LICENSE.txt file or visit http://www.apache.org/licenses/LICENSE-2.0 for a copy of the license. - -## Issue Reporting -Make suggestions or report issues using the Git issue tracker: https://github.com/Masterminds/goutils/issues - -## Website -* [GoUtils webpage](http://Masterminds.github.io/goutils/) diff --git a/vendor/github.com/Masterminds/goutils/appveyor.yml b/vendor/github.com/Masterminds/goutils/appveyor.yml deleted file mode 100644 index 657564a847..0000000000 --- a/vendor/github.com/Masterminds/goutils/appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\Masterminds\goutils -shallow_clone: true - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -build: off - -install: - - go version - - go env - -test_script: - - go test -v - -deploy: off diff --git a/vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go b/vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go deleted file mode 100644 index 8dbd924858..0000000000 --- a/vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goutils - -import ( - "crypto/rand" - "fmt" - "math" - "math/big" - "unicode" -) - -/* -CryptoRandomNonAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of all characters (ASCII/Unicode values between 0 to 2,147,483,647 (math.MaxInt32)). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomNonAlphaNumeric(count int) (string, error) { - return CryptoRandomAlphaNumericCustom(count, false, false) -} - -/* -CryptoRandomAscii creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of characters whose ASCII value is between 32 and 126 (inclusive). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAscii(count int) (string, error) { - return CryptoRandom(count, 32, 127, false, false) -} - -/* -CryptoRandomNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomNumeric(count int) (string, error) { - return CryptoRandom(count, 0, 0, false, true) -} - -/* -CryptoRandomAlphabetic creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments. - -Parameters: - count - the length of random string to create - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAlphabetic(count int) (string, error) { - return CryptoRandom(count, 0, 0, true, false) -} - -/* -CryptoRandomAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAlphaNumeric(count int) (string, error) { - return CryptoRandom(count, 0, 0, true, true) -} - -/* -CryptoRandomAlphaNumericCustom creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments. - -Parameters: - count - the length of random string to create - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAlphaNumericCustom(count int, letters bool, numbers bool) (string, error) { - return CryptoRandom(count, 0, 0, letters, numbers) -} - -/* -CryptoRandom creates a random string based on a variety of options, using using golang's crypto/rand source of randomness. -If the parameters start and end are both 0, start and end are set to ' ' and 'z', the ASCII printable characters, will be used, -unless letters and numbers are both false, in which case, start and end are set to 0 and math.MaxInt32, respectively. -If chars is not nil, characters stored in chars that are between start and end are chosen. - -Parameters: - count - the length of random string to create - start - the position in set of chars (ASCII/Unicode int) to start at - end - the position in set of chars (ASCII/Unicode int) to end before - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - chars - the set of chars to choose randoms from. If nil, then it will use the set of all chars. - -Returns: - string - the random string - error - an error stemming from invalid parameters: if count < 0; or the provided chars array is empty; or end <= start; or end > len(chars) -*/ -func CryptoRandom(count int, start int, end int, letters bool, numbers bool, chars ...rune) (string, error) { - if count == 0 { - return "", nil - } else if count < 0 { - err := fmt.Errorf("randomstringutils illegal argument: Requested random string length %v is less than 0.", count) // equiv to err := errors.New("...") - return "", err - } - if chars != nil && len(chars) == 0 { - err := fmt.Errorf("randomstringutils illegal argument: The chars array must not be empty") - return "", err - } - - if start == 0 && end == 0 { - if chars != nil { - end = len(chars) - } else { - if !letters && !numbers { - end = math.MaxInt32 - } else { - end = 'z' + 1 - start = ' ' - } - } - } else { - if end <= start { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) must be greater than start (%v)", end, start) - return "", err - } - - if chars != nil && end > len(chars) { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) cannot be greater than len(chars) (%v)", end, len(chars)) - return "", err - } - } - - buffer := make([]rune, count) - gap := end - start - - // high-surrogates range, (\uD800-\uDBFF) = 55296 - 56319 - // low-surrogates range, (\uDC00-\uDFFF) = 56320 - 57343 - - for count != 0 { - count-- - var ch rune - if chars == nil { - ch = rune(getCryptoRandomInt(gap) + int64(start)) - } else { - ch = chars[getCryptoRandomInt(gap)+int64(start)] - } - - if letters && unicode.IsLetter(ch) || numbers && unicode.IsDigit(ch) || !letters && !numbers { - if ch >= 56320 && ch <= 57343 { // low surrogate range - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = ch - count-- - // Insert high surrogate - buffer[count] = rune(55296 + getCryptoRandomInt(128)) - } - } else if ch >= 55296 && ch <= 56191 { // High surrogates range (Partial) - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = rune(56320 + getCryptoRandomInt(128)) - count-- - // Insert high surrogate - buffer[count] = ch - } - } else if ch >= 56192 && ch <= 56319 { - // private high surrogate, skip it - count++ - } else { - // not one of the surrogates* - buffer[count] = ch - } - } else { - count++ - } - } - return string(buffer), nil -} - -func getCryptoRandomInt(count int) int64 { - nBig, err := rand.Int(rand.Reader, big.NewInt(int64(count))) - if err != nil { - panic(err) - } - return nBig.Int64() -} diff --git a/vendor/github.com/Masterminds/goutils/randomstringutils.go b/vendor/github.com/Masterminds/goutils/randomstringutils.go deleted file mode 100644 index 272670231a..0000000000 --- a/vendor/github.com/Masterminds/goutils/randomstringutils.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goutils - -import ( - "fmt" - "math" - "math/rand" - "time" - "unicode" -) - -// RANDOM provides the time-based seed used to generate random numbers -var RANDOM = rand.New(rand.NewSource(time.Now().UnixNano())) - -/* -RandomNonAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of all characters (ASCII/Unicode values between 0 to 2,147,483,647 (math.MaxInt32)). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomNonAlphaNumeric(count int) (string, error) { - return RandomAlphaNumericCustom(count, false, false) -} - -/* -RandomAscii creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of characters whose ASCII value is between 32 and 126 (inclusive). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAscii(count int) (string, error) { - return Random(count, 32, 127, false, false) -} - -/* -RandomNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomNumeric(count int) (string, error) { - return Random(count, 0, 0, false, true) -} - -/* -RandomAlphabetic creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alphabetic characters. - -Parameters: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAlphabetic(count int) (string, error) { - return Random(count, 0, 0, true, false) -} - -/* -RandomAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAlphaNumeric(count int) (string, error) { - return Random(count, 0, 0, true, true) -} - -/* -RandomAlphaNumericCustom creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments. - -Parameters: - count - the length of random string to create - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAlphaNumericCustom(count int, letters bool, numbers bool) (string, error) { - return Random(count, 0, 0, letters, numbers) -} - -/* -Random creates a random string based on a variety of options, using default source of randomness. -This method has exactly the same semantics as RandomSeed(int, int, int, bool, bool, []char, *rand.Rand), but -instead of using an externally supplied source of randomness, it uses the internal *rand.Rand instance. - -Parameters: - count - the length of random string to create - start - the position in set of chars (ASCII/Unicode int) to start at - end - the position in set of chars (ASCII/Unicode int) to end before - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - chars - the set of chars to choose randoms from. If nil, then it will use the set of all chars. - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func Random(count int, start int, end int, letters bool, numbers bool, chars ...rune) (string, error) { - return RandomSeed(count, start, end, letters, numbers, chars, RANDOM) -} - -/* -RandomSeed creates a random string based on a variety of options, using supplied source of randomness. -If the parameters start and end are both 0, start and end are set to ' ' and 'z', the ASCII printable characters, will be used, -unless letters and numbers are both false, in which case, start and end are set to 0 and math.MaxInt32, respectively. -If chars is not nil, characters stored in chars that are between start and end are chosen. -This method accepts a user-supplied *rand.Rand instance to use as a source of randomness. By seeding a single *rand.Rand instance -with a fixed seed and using it for each call, the same random sequence of strings can be generated repeatedly and predictably. - -Parameters: - count - the length of random string to create - start - the position in set of chars (ASCII/Unicode decimals) to start at - end - the position in set of chars (ASCII/Unicode decimals) to end before - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - chars - the set of chars to choose randoms from. If nil, then it will use the set of all chars. - random - a source of randomness. - -Returns: - string - the random string - error - an error stemming from invalid parameters: if count < 0; or the provided chars array is empty; or end <= start; or end > len(chars) -*/ -func RandomSeed(count int, start int, end int, letters bool, numbers bool, chars []rune, random *rand.Rand) (string, error) { - - if count == 0 { - return "", nil - } else if count < 0 { - err := fmt.Errorf("randomstringutils illegal argument: Requested random string length %v is less than 0.", count) // equiv to err := errors.New("...") - return "", err - } - if chars != nil && len(chars) == 0 { - err := fmt.Errorf("randomstringutils illegal argument: The chars array must not be empty") - return "", err - } - - if start == 0 && end == 0 { - if chars != nil { - end = len(chars) - } else { - if !letters && !numbers { - end = math.MaxInt32 - } else { - end = 'z' + 1 - start = ' ' - } - } - } else { - if end <= start { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) must be greater than start (%v)", end, start) - return "", err - } - - if chars != nil && end > len(chars) { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) cannot be greater than len(chars) (%v)", end, len(chars)) - return "", err - } - } - - buffer := make([]rune, count) - gap := end - start - - // high-surrogates range, (\uD800-\uDBFF) = 55296 - 56319 - // low-surrogates range, (\uDC00-\uDFFF) = 56320 - 57343 - - for count != 0 { - count-- - var ch rune - if chars == nil { - ch = rune(random.Intn(gap) + start) - } else { - ch = chars[random.Intn(gap)+start] - } - - if letters && unicode.IsLetter(ch) || numbers && unicode.IsDigit(ch) || !letters && !numbers { - if ch >= 56320 && ch <= 57343 { // low surrogate range - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = ch - count-- - // Insert high surrogate - buffer[count] = rune(55296 + random.Intn(128)) - } - } else if ch >= 55296 && ch <= 56191 { // High surrogates range (Partial) - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = rune(56320 + random.Intn(128)) - count-- - // Insert high surrogate - buffer[count] = ch - } - } else if ch >= 56192 && ch <= 56319 { - // private high surrogate, skip it - count++ - } else { - // not one of the surrogates* - buffer[count] = ch - } - } else { - count++ - } - } - return string(buffer), nil -} diff --git a/vendor/github.com/Masterminds/goutils/stringutils.go b/vendor/github.com/Masterminds/goutils/stringutils.go deleted file mode 100644 index 741bb530e8..0000000000 --- a/vendor/github.com/Masterminds/goutils/stringutils.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goutils - -import ( - "bytes" - "fmt" - "strings" - "unicode" -) - -// Typically returned by functions where a searched item cannot be found -const INDEX_NOT_FOUND = -1 - -/* -Abbreviate abbreviates a string using ellipses. This will turn the string "Now is the time for all good men" into "Now is the time for..." - -Specifically, the algorithm is as follows: - - - If str is less than maxWidth characters long, return it. - - Else abbreviate it to (str[0:maxWidth - 3] + "..."). - - If maxWidth is less than 4, return an illegal argument error. - - In no case will it return a string of length greater than maxWidth. - -Parameters: - str - the string to check - maxWidth - maximum length of result string, must be at least 4 - -Returns: - string - abbreviated string - error - if the width is too small -*/ -func Abbreviate(str string, maxWidth int) (string, error) { - return AbbreviateFull(str, 0, maxWidth) -} - -/* -AbbreviateFull abbreviates a string using ellipses. This will turn the string "Now is the time for all good men" into "...is the time for..." -This function works like Abbreviate(string, int), but allows you to specify a "left edge" offset. Note that this left edge is not -necessarily going to be the leftmost character in the result, or the first character following the ellipses, but it will appear -somewhere in the result. -In no case will it return a string of length greater than maxWidth. - -Parameters: - str - the string to check - offset - left edge of source string - maxWidth - maximum length of result string, must be at least 4 - -Returns: - string - abbreviated string - error - if the width is too small -*/ -func AbbreviateFull(str string, offset int, maxWidth int) (string, error) { - if str == "" { - return "", nil - } - if maxWidth < 4 { - err := fmt.Errorf("stringutils illegal argument: Minimum abbreviation width is 4") - return "", err - } - if len(str) <= maxWidth { - return str, nil - } - if offset > len(str) { - offset = len(str) - } - if len(str)-offset < (maxWidth - 3) { // 15 - 5 < 10 - 3 = 10 < 7 - offset = len(str) - (maxWidth - 3) - } - abrevMarker := "..." - if offset <= 4 { - return str[0:maxWidth-3] + abrevMarker, nil // str.substring(0, maxWidth - 3) + abrevMarker; - } - if maxWidth < 7 { - err := fmt.Errorf("stringutils illegal argument: Minimum abbreviation width with offset is 7") - return "", err - } - if (offset + maxWidth - 3) < len(str) { // 5 + (10-3) < 15 = 12 < 15 - abrevStr, _ := Abbreviate(str[offset:len(str)], (maxWidth - 3)) - return abrevMarker + abrevStr, nil // abrevMarker + abbreviate(str.substring(offset), maxWidth - 3); - } - return abrevMarker + str[(len(str)-(maxWidth-3)):len(str)], nil // abrevMarker + str.substring(str.length() - (maxWidth - 3)); -} - -/* -DeleteWhiteSpace deletes all whitespaces from a string as defined by unicode.IsSpace(rune). -It returns the string without whitespaces. - -Parameter: - str - the string to delete whitespace from, may be nil - -Returns: - the string without whitespaces -*/ -func DeleteWhiteSpace(str string) string { - if str == "" { - return str - } - sz := len(str) - var chs bytes.Buffer - count := 0 - for i := 0; i < sz; i++ { - ch := rune(str[i]) - if !unicode.IsSpace(ch) { - chs.WriteRune(ch) - count++ - } - } - if count == sz { - return str - } - return chs.String() -} - -/* -IndexOfDifference compares two strings, and returns the index at which the strings begin to differ. - -Parameters: - str1 - the first string - str2 - the second string - -Returns: - the index where str1 and str2 begin to differ; -1 if they are equal -*/ -func IndexOfDifference(str1 string, str2 string) int { - if str1 == str2 { - return INDEX_NOT_FOUND - } - if IsEmpty(str1) || IsEmpty(str2) { - return 0 - } - var i int - for i = 0; i < len(str1) && i < len(str2); i++ { - if rune(str1[i]) != rune(str2[i]) { - break - } - } - if i < len(str2) || i < len(str1) { - return i - } - return INDEX_NOT_FOUND -} - -/* -IsBlank checks if a string is whitespace or empty (""). Observe the following behavior: - - goutils.IsBlank("") = true - goutils.IsBlank(" ") = true - goutils.IsBlank("bob") = false - goutils.IsBlank(" bob ") = false - -Parameter: - str - the string to check - -Returns: - true - if the string is whitespace or empty ("") -*/ -func IsBlank(str string) bool { - strLen := len(str) - if str == "" || strLen == 0 { - return true - } - for i := 0; i < strLen; i++ { - if unicode.IsSpace(rune(str[i])) == false { - return false - } - } - return true -} - -/* -IndexOf returns the index of the first instance of sub in str, with the search beginning from the -index start point specified. -1 is returned if sub is not present in str. - -An empty string ("") will return -1 (INDEX_NOT_FOUND). A negative start position is treated as zero. -A start position greater than the string length returns -1. - -Parameters: - str - the string to check - sub - the substring to find - start - the start position; negative treated as zero - -Returns: - the first index where the sub string was found (always >= start) -*/ -func IndexOf(str string, sub string, start int) int { - - if start < 0 { - start = 0 - } - - if len(str) < start { - return INDEX_NOT_FOUND - } - - if IsEmpty(str) || IsEmpty(sub) { - return INDEX_NOT_FOUND - } - - partialIndex := strings.Index(str[start:len(str)], sub) - if partialIndex == -1 { - return INDEX_NOT_FOUND - } - return partialIndex + start -} - -// IsEmpty checks if a string is empty (""). Returns true if empty, and false otherwise. -func IsEmpty(str string) bool { - return len(str) == 0 -} - -// Returns either the passed in string, or if the string is empty, the value of defaultStr. -func DefaultString(str string, defaultStr string) string { - if IsEmpty(str) { - return defaultStr - } - return str -} - -// Returns either the passed in string, or if the string is whitespace, empty (""), the value of defaultStr. -func DefaultIfBlank(str string, defaultStr string) string { - if IsBlank(str) { - return defaultStr - } - return str -} diff --git a/vendor/github.com/Masterminds/goutils/wordutils.go b/vendor/github.com/Masterminds/goutils/wordutils.go deleted file mode 100644 index 034cad8e21..0000000000 --- a/vendor/github.com/Masterminds/goutils/wordutils.go +++ /dev/null @@ -1,357 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* -Package goutils provides utility functions to manipulate strings in various ways. -The code snippets below show examples of how to use goutils. Some functions return -errors while others do not, so usage would vary as a result. - -Example: - - package main - - import ( - "fmt" - "github.com/aokoli/goutils" - ) - - func main() { - - // EXAMPLE 1: A goutils function which returns no errors - fmt.Println (goutils.Initials("John Doe Foo")) // Prints out "JDF" - - - - // EXAMPLE 2: A goutils function which returns an error - rand1, err1 := goutils.Random (-1, 0, 0, true, true) - - if err1 != nil { - fmt.Println(err1) // Prints out error message because -1 was entered as the first parameter in goutils.Random(...) - } else { - fmt.Println(rand1) - } - } -*/ -package goutils - -import ( - "bytes" - "strings" - "unicode" -) - -// VERSION indicates the current version of goutils -const VERSION = "1.0.0" - -/* -Wrap wraps a single line of text, identifying words by ' '. -New lines will be separated by '\n'. Very long words, such as URLs will not be wrapped. -Leading spaces on a new line are stripped. Trailing spaces are not stripped. - -Parameters: - str - the string to be word wrapped - wrapLength - the column (a column can fit only one character) to wrap the words at, less than 1 is treated as 1 - -Returns: - a line with newlines inserted -*/ -func Wrap(str string, wrapLength int) string { - return WrapCustom(str, wrapLength, "", false) -} - -/* -WrapCustom wraps a single line of text, identifying words by ' '. -Leading spaces on a new line are stripped. Trailing spaces are not stripped. - -Parameters: - str - the string to be word wrapped - wrapLength - the column number (a column can fit only one character) to wrap the words at, less than 1 is treated as 1 - newLineStr - the string to insert for a new line, "" uses '\n' - wrapLongWords - true if long words (such as URLs) should be wrapped - -Returns: - a line with newlines inserted -*/ -func WrapCustom(str string, wrapLength int, newLineStr string, wrapLongWords bool) string { - - if str == "" { - return "" - } - if newLineStr == "" { - newLineStr = "\n" // TODO Assumes "\n" is seperator. Explore SystemUtils.LINE_SEPARATOR from Apache Commons - } - if wrapLength < 1 { - wrapLength = 1 - } - - inputLineLength := len(str) - offset := 0 - - var wrappedLine bytes.Buffer - - for inputLineLength-offset > wrapLength { - - if rune(str[offset]) == ' ' { - offset++ - continue - } - - end := wrapLength + offset + 1 - spaceToWrapAt := strings.LastIndex(str[offset:end], " ") + offset - - if spaceToWrapAt >= offset { - // normal word (not longer than wrapLength) - wrappedLine.WriteString(str[offset:spaceToWrapAt]) - wrappedLine.WriteString(newLineStr) - offset = spaceToWrapAt + 1 - - } else { - // long word or URL - if wrapLongWords { - end := wrapLength + offset - // long words are wrapped one line at a time - wrappedLine.WriteString(str[offset:end]) - wrappedLine.WriteString(newLineStr) - offset += wrapLength - } else { - // long words aren't wrapped, just extended beyond limit - end := wrapLength + offset - index := strings.IndexRune(str[end:len(str)], ' ') - if index == -1 { - wrappedLine.WriteString(str[offset:len(str)]) - offset = inputLineLength - } else { - spaceToWrapAt = index + end - wrappedLine.WriteString(str[offset:spaceToWrapAt]) - wrappedLine.WriteString(newLineStr) - offset = spaceToWrapAt + 1 - } - } - } - } - - wrappedLine.WriteString(str[offset:len(str)]) - - return wrappedLine.String() - -} - -/* -Capitalize capitalizes all the delimiter separated words in a string. Only the first letter of each word is changed. -To convert the rest of each word to lowercase at the same time, use CapitalizeFully(str string, delimiters ...rune). -The delimiters represent a set of characters understood to separate words. The first string character -and the first non-delimiter character after a delimiter will be capitalized. A "" input string returns "". -Capitalization uses the Unicode title case, normally equivalent to upper case. - -Parameters: - str - the string to capitalize - delimiters - set of characters to determine capitalization, exclusion of this parameter means whitespace would be delimeter - -Returns: - capitalized string -*/ -func Capitalize(str string, delimiters ...rune) string { - - var delimLen int - - if delimiters == nil { - delimLen = -1 - } else { - delimLen = len(delimiters) - } - - if str == "" || delimLen == 0 { - return str - } - - buffer := []rune(str) - capitalizeNext := true - for i := 0; i < len(buffer); i++ { - ch := buffer[i] - if isDelimiter(ch, delimiters...) { - capitalizeNext = true - } else if capitalizeNext { - buffer[i] = unicode.ToTitle(ch) - capitalizeNext = false - } - } - return string(buffer) - -} - -/* -CapitalizeFully converts all the delimiter separated words in a string into capitalized words, that is each word is made up of a -titlecase character and then a series of lowercase characters. The delimiters represent a set of characters understood -to separate words. The first string character and the first non-delimiter character after a delimiter will be capitalized. -Capitalization uses the Unicode title case, normally equivalent to upper case. - -Parameters: - str - the string to capitalize fully - delimiters - set of characters to determine capitalization, exclusion of this parameter means whitespace would be delimeter - -Returns: - capitalized string -*/ -func CapitalizeFully(str string, delimiters ...rune) string { - - var delimLen int - - if delimiters == nil { - delimLen = -1 - } else { - delimLen = len(delimiters) - } - - if str == "" || delimLen == 0 { - return str - } - str = strings.ToLower(str) - return Capitalize(str, delimiters...) -} - -/* -Uncapitalize uncapitalizes all the whitespace separated words in a string. Only the first letter of each word is changed. -The delimiters represent a set of characters understood to separate words. The first string character and the first non-delimiter -character after a delimiter will be uncapitalized. Whitespace is defined by unicode.IsSpace(char). - -Parameters: - str - the string to uncapitalize fully - delimiters - set of characters to determine capitalization, exclusion of this parameter means whitespace would be delimeter - -Returns: - uncapitalized string -*/ -func Uncapitalize(str string, delimiters ...rune) string { - - var delimLen int - - if delimiters == nil { - delimLen = -1 - } else { - delimLen = len(delimiters) - } - - if str == "" || delimLen == 0 { - return str - } - - buffer := []rune(str) - uncapitalizeNext := true // TODO Always makes capitalize/un apply to first char. - for i := 0; i < len(buffer); i++ { - ch := buffer[i] - if isDelimiter(ch, delimiters...) { - uncapitalizeNext = true - } else if uncapitalizeNext { - buffer[i] = unicode.ToLower(ch) - uncapitalizeNext = false - } - } - return string(buffer) -} - -/* -SwapCase swaps the case of a string using a word based algorithm. - -Conversion algorithm: - - Upper case character converts to Lower case - Title case character converts to Lower case - Lower case character after Whitespace or at start converts to Title case - Other Lower case character converts to Upper case - Whitespace is defined by unicode.IsSpace(char). - -Parameters: - str - the string to swap case - -Returns: - the changed string -*/ -func SwapCase(str string) string { - if str == "" { - return str - } - buffer := []rune(str) - - whitespace := true - - for i := 0; i < len(buffer); i++ { - ch := buffer[i] - if unicode.IsUpper(ch) { - buffer[i] = unicode.ToLower(ch) - whitespace = false - } else if unicode.IsTitle(ch) { - buffer[i] = unicode.ToLower(ch) - whitespace = false - } else if unicode.IsLower(ch) { - if whitespace { - buffer[i] = unicode.ToTitle(ch) - whitespace = false - } else { - buffer[i] = unicode.ToUpper(ch) - } - } else { - whitespace = unicode.IsSpace(ch) - } - } - return string(buffer) -} - -/* -Initials extracts the initial letters from each word in the string. The first letter of the string and all first -letters after the defined delimiters are returned as a new string. Their case is not changed. If the delimiters -parameter is excluded, then Whitespace is used. Whitespace is defined by unicode.IsSpacea(char). An empty delimiter array returns an empty string. - -Parameters: - str - the string to get initials from - delimiters - set of characters to determine words, exclusion of this parameter means whitespace would be delimeter -Returns: - string of initial letters -*/ -func Initials(str string, delimiters ...rune) string { - if str == "" { - return str - } - if delimiters != nil && len(delimiters) == 0 { - return "" - } - strLen := len(str) - var buf bytes.Buffer - lastWasGap := true - for i := 0; i < strLen; i++ { - ch := rune(str[i]) - - if isDelimiter(ch, delimiters...) { - lastWasGap = true - } else if lastWasGap { - buf.WriteRune(ch) - lastWasGap = false - } - } - return buf.String() -} - -// private function (lower case func name) -func isDelimiter(ch rune, delimiters ...rune) bool { - if delimiters == nil { - return unicode.IsSpace(ch) - } - for _, delimiter := range delimiters { - if ch == delimiter { - return true - } - } - return false -} diff --git a/vendor/github.com/Masterminds/semver/v3/.gitignore b/vendor/github.com/Masterminds/semver/v3/.gitignore deleted file mode 100644 index 6b061e6174..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_fuzz/ \ No newline at end of file diff --git a/vendor/github.com/Masterminds/semver/v3/.golangci.yml b/vendor/github.com/Masterminds/semver/v3/.golangci.yml deleted file mode 100644 index fbc6332592..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/.golangci.yml +++ /dev/null @@ -1,27 +0,0 @@ -run: - deadline: 2m - -linters: - disable-all: true - enable: - - misspell - - govet - - staticcheck - - errcheck - - unparam - - ineffassign - - nakedret - - gocyclo - - dupl - - goimports - - revive - - gosec - - gosimple - - typecheck - - unused - -linters-settings: - gofmt: - simplify: true - dupl: - threshold: 600 diff --git a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md deleted file mode 100644 index f12626423a..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md +++ /dev/null @@ -1,214 +0,0 @@ -# Changelog - -## 3.2.0 (2022-11-28) - -### Added - -- #190: Added text marshaling and unmarshaling -- #167: Added JSON marshalling for constraints (thanks @SimonTheLeg) -- #173: Implement encoding.TextMarshaler and encoding.TextUnmarshaler on Version (thanks @MarkRosemaker) -- #179: Added New() version constructor (thanks @kazhuravlev) - -### Changed - -- #182/#183: Updated CI testing setup - -### Fixed - -- #186: Fixing issue where validation of constraint section gave false positives -- #176: Fix constraints check with *-0 (thanks @mtt0) -- #181: Fixed Caret operator (^) gives unexpected results when the minor version in constraint is 0 (thanks @arshchimni) -- #161: Fixed godoc (thanks @afirth) - -## 3.1.1 (2020-11-23) - -### Fixed - -- #158: Fixed issue with generated regex operation order that could cause problem - -## 3.1.0 (2020-04-15) - -### Added - -- #131: Add support for serializing/deserializing SQL (thanks @ryancurrah) - -### Changed - -- #148: More accurate validation messages on constraints - -## 3.0.3 (2019-12-13) - -### Fixed - -- #141: Fixed issue with <= comparison - -## 3.0.2 (2019-11-14) - -### Fixed - -- #134: Fixed broken constraint checking with ^0.0 (thanks @krmichelos) - -## 3.0.1 (2019-09-13) - -### Fixed - -- #125: Fixes issue with module path for v3 - -## 3.0.0 (2019-09-12) - -This is a major release of the semver package which includes API changes. The Go -API is compatible with ^1. The Go API was not changed because many people are using -`go get` without Go modules for their applications and API breaking changes cause -errors which we have or would need to support. - -The changes in this release are the handling based on the data passed into the -functions. These are described in the added and changed sections below. - -### Added - -- StrictNewVersion function. This is similar to NewVersion but will return an - error if the version passed in is not a strict semantic version. For example, - 1.2.3 would pass but v1.2.3 or 1.2 would fail because they are not strictly - speaking semantic versions. This function is faster, performs fewer operations, - and uses fewer allocations than NewVersion. -- Fuzzing has been performed on NewVersion, StrictNewVersion, and NewConstraint. - The Makefile contains the operations used. For more information on you can start - on Wikipedia at https://en.wikipedia.org/wiki/Fuzzing -- Now using Go modules - -### Changed - -- NewVersion has proper prerelease and metadata validation with error messages - to signal an issue with either of them -- ^ now operates using a similar set of rules to npm/js and Rust/Cargo. If the - version is >=1 the ^ ranges works the same as v1. For major versions of 0 the - rules have changed. The minor version is treated as the stable version unless - a patch is specified and then it is equivalent to =. One difference from npm/js - is that prereleases there are only to a specific version (e.g. 1.2.3). - Prereleases here look over multiple versions and follow semantic version - ordering rules. This pattern now follows along with the expected and requested - handling of this packaged by numerous users. - -## 1.5.0 (2019-09-11) - -### Added - -- #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c) - -### Changed - -- #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil) -- #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil) -- #72: Adding docs comment pointing to vert for a cli -- #71: Update the docs on pre-release comparator handling -- #89: Test with new go versions (thanks @thedevsaddam) -- #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll) - -### Fixed - -- #78: Fix unchecked error in example code (thanks @ravron) -- #70: Fix the handling of pre-releases and the 0.0.0 release edge case -- #97: Fixed copyright file for proper display on GitHub -- #107: Fix handling prerelease when sorting alphanum and num -- #109: Fixed where Validate sometimes returns wrong message on error - -## 1.4.2 (2018-04-10) - -### Changed - -- #72: Updated the docs to point to vert for a console appliaction -- #71: Update the docs on pre-release comparator handling - -### Fixed - -- #70: Fix the handling of pre-releases and the 0.0.0 release edge case - -## 1.4.1 (2018-04-02) - -### Fixed - -- Fixed #64: Fix pre-release precedence issue (thanks @uudashr) - -## 1.4.0 (2017-10-04) - -### Changed - -- #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill) - -## 1.3.1 (2017-07-10) - -### Fixed - -- Fixed #57: number comparisons in prerelease sometimes inaccurate - -## 1.3.0 (2017-05-02) - -### Added - -- #45: Added json (un)marshaling support (thanks @mh-cbon) -- Stability marker. See https://masterminds.github.io/stability/ - -### Fixed - -- #51: Fix handling of single digit tilde constraint (thanks @dgodd) - -### Changed - -- #55: The godoc icon moved from png to svg - -## 1.2.3 (2017-04-03) - -### Fixed - -- #46: Fixed 0.x.x and 0.0.x in constraints being treated as * - -## Release 1.2.2 (2016-12-13) - -### Fixed - -- #34: Fixed issue where hyphen range was not working with pre-release parsing. - -## Release 1.2.1 (2016-11-28) - -### Fixed - -- #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha" - properly. - -## Release 1.2.0 (2016-11-04) - -### Added - -- #20: Added MustParse function for versions (thanks @adamreese) -- #15: Added increment methods on versions (thanks @mh-cbon) - -### Fixed - -- Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and - might not satisfy the intended compatibility. The change here ignores pre-releases - on constraint checks (e.g., ~ or ^) when a pre-release is not part of the - constraint. For example, `^1.2.3` will ignore pre-releases while - `^1.2.3-alpha` will include them. - -## Release 1.1.1 (2016-06-30) - -### Changed - -- Issue #9: Speed up version comparison performance (thanks @sdboyer) -- Issue #8: Added benchmarks (thanks @sdboyer) -- Updated Go Report Card URL to new location -- Updated Readme to add code snippet formatting (thanks @mh-cbon) -- Updating tagging to v[SemVer] structure for compatibility with other tools. - -## Release 1.1.0 (2016-03-11) - -- Issue #2: Implemented validation to provide reasons a versions failed a - constraint. - -## Release 1.0.1 (2015-12-31) - -- Fixed #1: * constraint failing on valid versions. - -## Release 1.0.0 (2015-10-20) - -- Initial release diff --git a/vendor/github.com/Masterminds/semver/v3/LICENSE.txt b/vendor/github.com/Masterminds/semver/v3/LICENSE.txt deleted file mode 100644 index 9ff7da9c48..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014-2019, Matt Butcher and Matt Farina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/semver/v3/Makefile b/vendor/github.com/Masterminds/semver/v3/Makefile deleted file mode 100644 index 0e7b5c7138..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -GOPATH=$(shell go env GOPATH) -GOLANGCI_LINT=$(GOPATH)/bin/golangci-lint - -.PHONY: lint -lint: $(GOLANGCI_LINT) - @echo "==> Linting codebase" - @$(GOLANGCI_LINT) run - -.PHONY: test -test: - @echo "==> Running tests" - GO111MODULE=on go test -v - -.PHONY: test-cover -test-cover: - @echo "==> Running Tests with coverage" - GO111MODULE=on go test -cover . - -.PHONY: fuzz -fuzz: - @echo "==> Running Fuzz Tests" - go test -fuzz=FuzzNewVersion -fuzztime=15s . - go test -fuzz=FuzzStrictNewVersion -fuzztime=15s . - go test -fuzz=FuzzNewConstraint -fuzztime=15s . - -$(GOLANGCI_LINT): - # Install golangci-lint. The configuration for it is in the .golangci.yml - # file in the root of the repository - echo ${GOPATH} - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.17.1 diff --git a/vendor/github.com/Masterminds/semver/v3/README.md b/vendor/github.com/Masterminds/semver/v3/README.md deleted file mode 100644 index eab8cac3b7..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/README.md +++ /dev/null @@ -1,258 +0,0 @@ -# SemVer - -The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to: - -* Parse semantic versions -* Sort semantic versions -* Check if a semantic version fits within a set of constraints -* Optionally work with a `v` prefix - -[![Stability: -Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html) -[![](https://github.com/Masterminds/semver/workflows/Tests/badge.svg)](https://github.com/Masterminds/semver/actions) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/Masterminds/semver/v3) -[![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/semver)](https://goreportcard.com/report/github.com/Masterminds/semver) - -If you are looking for a command line tool for version comparisons please see -[vert](https://github.com/Masterminds/vert) which uses this library. - -## Package Versions - -Note, import `github.com/github.com/Masterminds/semver/v3` to use the latest version. - -There are three major versions fo the `semver` package. - -* 3.x.x is the stable and active version. This version is focused on constraint - compatibility for range handling in other tools from other languages. It has - a similar API to the v1 releases. The development of this version is on the master - branch. The documentation for this version is below. -* 2.x was developed primarily for [dep](https://github.com/golang/dep). There are - no tagged releases and the development was performed by [@sdboyer](https://github.com/sdboyer). - There are API breaking changes from v1. This version lives on the [2.x branch](https://github.com/Masterminds/semver/tree/2.x). -* 1.x.x is the original release. It is no longer maintained. You should use the - v3 release instead. You can read the documentation for the 1.x.x release - [here](https://github.com/Masterminds/semver/blob/release-1/README.md). - -## Parsing Semantic Versions - -There are two functions that can parse semantic versions. The `StrictNewVersion` -function only parses valid version 2 semantic versions as outlined in the -specification. The `NewVersion` function attempts to coerce a version into a -semantic version and parse it. For example, if there is a leading v or a version -listed without all 3 parts (e.g. `v1.2`) it will attempt to coerce it into a valid -semantic version (e.g., 1.2.0). In both cases a `Version` object is returned -that can be sorted, compared, and used in constraints. - -When parsing a version an error is returned if there is an issue parsing the -version. For example, - - v, err := semver.NewVersion("1.2.3-beta.1+build345") - -The version object has methods to get the parts of the version, compare it to -other versions, convert the version back into a string, and get the original -string. Getting the original string is useful if the semantic version was coerced -into a valid form. - -## Sorting Semantic Versions - -A set of versions can be sorted using the `sort` package from the standard library. -For example, - -```go -raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} -vs := make([]*semver.Version, len(raw)) -for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v -} - -sort.Sort(semver.Collection(vs)) -``` - -## Checking Version Constraints - -There are two methods for comparing versions. One uses comparison methods on -`Version` instances and the other uses `Constraints`. There are some important -differences to notes between these two methods of comparison. - -1. When two versions are compared using functions such as `Compare`, `LessThan`, - and others it will follow the specification and always include prereleases - within the comparison. It will provide an answer that is valid with the - comparison section of the spec at https://semver.org/#spec-item-11 -2. When constraint checking is used for checks or validation it will follow a - different set of rules that are common for ranges with tools like npm/js - and Rust/Cargo. This includes considering prereleases to be invalid if the - ranges does not include one. If you want to have it include pre-releases a - simple solution is to include `-0` in your range. -3. Constraint ranges can have some complex rules including the shorthand use of - ~ and ^. For more details on those see the options below. - -There are differences between the two methods or checking versions because the -comparison methods on `Version` follow the specification while comparison ranges -are not part of the specification. Different packages and tools have taken it -upon themselves to come up with range rules. This has resulted in differences. -For example, npm/js and Cargo/Rust follow similar patterns while PHP has a -different pattern for ^. The comparison features in this package follow the -npm/js and Cargo/Rust lead because applications using it have followed similar -patters with their versions. - -Checking a version against version constraints is one of the most featureful -parts of the package. - -```go -c, err := semver.NewConstraint(">= 1.2.3") -if err != nil { - // Handle constraint not being parsable. -} - -v, err := semver.NewVersion("1.3") -if err != nil { - // Handle version not being parsable. -} -// Check if the version meets the constraints. The a variable will be true. -a := c.Check(v) -``` - -### Basic Comparisons - -There are two elements to the comparisons. First, a comparison string is a list -of space or comma separated AND comparisons. These are then separated by || (OR) -comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a -comparison that's greater than or equal to 1.2 and less than 3.0.0 or is -greater than or equal to 4.2.3. - -The basic comparisons are: - -* `=`: equal (aliased to no operator) -* `!=`: not equal -* `>`: greater than -* `<`: less than -* `>=`: greater than or equal to -* `<=`: less than or equal to - -### Working With Prerelease Versions - -Pre-releases, for those not familiar with them, are used for software releases -prior to stable or generally available releases. Examples of prereleases include -development, alpha, beta, and release candidate releases. A prerelease may be -a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the -order of precedence, prereleases come before their associated releases. In this -example `1.2.3-beta.1 < 1.2.3`. - -According to the Semantic Version specification prereleases may not be -API compliant with their release counterpart. It says, - -> A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. - -SemVer comparisons using constraints without a prerelease comparator will skip -prerelease versions. For example, `>=1.2.3` will skip prereleases when looking -at a list of releases while `>=1.2.3-0` will evaluate and find prereleases. - -The reason for the `0` as a pre-release version in the example comparison is -because pre-releases can only contain ASCII alphanumerics and hyphens (along with -`.` separators), per the spec. Sorting happens in ASCII sort order, again per the -spec. The lowest character is a `0` in ASCII sort order -(see an [ASCII Table](http://www.asciitable.com/)) - -Understanding ASCII sort ordering is important because A-Z comes before a-z. That -means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case -sensitivity doesn't apply here. This is due to ASCII sort ordering which is what -the spec specifies. - -### Hyphen Range Comparisons - -There are multiple methods to handle ranges and the first is hyphens ranges. -These look like: - -* `1.2 - 1.4.5` which is equivalent to `>= 1.2 <= 1.4.5` -* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` - -### Wildcards In Comparisons - -The `x`, `X`, and `*` characters can be used as a wildcard character. This works -for all comparison operators. When used on the `=` operator it falls -back to the patch level comparison (see tilde below). For example, - -* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` -* `>= 1.2.x` is equivalent to `>= 1.2.0` -* `<= 2.x` is equivalent to `< 3` -* `*` is equivalent to `>= 0.0.0` - -### Tilde Range Comparisons (Patch) - -The tilde (`~`) comparison operator is for patch level ranges when a minor -version is specified and major level changes when the minor number is missing. -For example, - -* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` -* `~1` is equivalent to `>= 1, < 2` -* `~2.3` is equivalent to `>= 2.3, < 2.4` -* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` -* `~1.x` is equivalent to `>= 1, < 2` - -### Caret Range Comparisons (Major) - -The caret (`^`) comparison operator is for major level changes once a stable -(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts -as the API stability level. This is useful when comparisons of API versions as a -major change is API breaking. For example, - -* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` -* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` -* `^2.3` is equivalent to `>= 2.3, < 3` -* `^2.x` is equivalent to `>= 2.0.0, < 3` -* `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` -* `^0.2` is equivalent to `>=0.2.0 <0.3.0` -* `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` -* `^0.0` is equivalent to `>=0.0.0 <0.1.0` -* `^0` is equivalent to `>=0.0.0 <1.0.0` - -## Validation - -In addition to testing a version against a constraint, a version can be validated -against a constraint. When validation fails a slice of errors containing why a -version didn't meet the constraint is returned. For example, - -```go -c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") -if err != nil { - // Handle constraint not being parseable. -} - -v, err := semver.NewVersion("1.3") -if err != nil { - // Handle version not being parseable. -} - -// Validate a version against a constraint. -a, msgs := c.Validate(v) -// a is false -for _, m := range msgs { - fmt.Println(m) - - // Loops over the errors which would read - // "1.3 is greater than 1.2.3" - // "1.3 is less than 1.4" -} -``` - -## Contribute - -If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues) -or [create a pull request](https://github.com/Masterminds/semver/pulls). - -## Security - -Security is an important consideration for this project. The project currently -uses the following tools to help discover security issues: - -* [CodeQL](https://github.com/Masterminds/semver) -* [gosec](https://github.com/securego/gosec) -* Daily Fuzz testing - -If you believe you have found a security vulnerability you can privately disclose -it through the [GitHub security page](https://github.com/Masterminds/semver/security). diff --git a/vendor/github.com/Masterminds/semver/v3/SECURITY.md b/vendor/github.com/Masterminds/semver/v3/SECURITY.md deleted file mode 100644 index a30a66b1f7..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/SECURITY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Security Policy - -## Supported Versions - -The following versions of semver are currently supported: - -| Version | Supported | -| ------- | ------------------ | -| 3.x | :white_check_mark: | -| 2.x | :x: | -| 1.x | :x: | - -Fixes are only released for the latest minor version in the form of a patch release. - -## Reporting a Vulnerability - -You can privately disclose a vulnerability through GitHubs -[private vulnerability reporting](https://github.com/Masterminds/semver/security/advisories) -mechanism. diff --git a/vendor/github.com/Masterminds/semver/v3/collection.go b/vendor/github.com/Masterminds/semver/v3/collection.go deleted file mode 100644 index a78235895f..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/collection.go +++ /dev/null @@ -1,24 +0,0 @@ -package semver - -// Collection is a collection of Version instances and implements the sort -// interface. See the sort package for more details. -// https://golang.org/pkg/sort/ -type Collection []*Version - -// Len returns the length of a collection. The number of Version instances -// on the slice. -func (c Collection) Len() int { - return len(c) -} - -// Less is needed for the sort interface to compare two Version objects on the -// slice. If checks if one is less than the other. -func (c Collection) Less(i, j int) bool { - return c[i].LessThan(c[j]) -} - -// Swap is needed for the sort interface to replace the Version objects -// at two different positions in the slice. -func (c Collection) Swap(i, j int) { - c[i], c[j] = c[j], c[i] -} diff --git a/vendor/github.com/Masterminds/semver/v3/constraints.go b/vendor/github.com/Masterminds/semver/v3/constraints.go deleted file mode 100644 index 8461c7ed90..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/constraints.go +++ /dev/null @@ -1,594 +0,0 @@ -package semver - -import ( - "bytes" - "errors" - "fmt" - "regexp" - "strings" -) - -// Constraints is one or more constraint that a semantic version can be -// checked against. -type Constraints struct { - constraints [][]*constraint -} - -// NewConstraint returns a Constraints instance that a Version instance can -// be checked against. If there is a parse error it will be returned. -func NewConstraint(c string) (*Constraints, error) { - - // Rewrite - ranges into a comparison operation. - c = rewriteRange(c) - - ors := strings.Split(c, "||") - or := make([][]*constraint, len(ors)) - for k, v := range ors { - - // TODO: Find a way to validate and fetch all the constraints in a simpler form - - // Validate the segment - if !validConstraintRegex.MatchString(v) { - return nil, fmt.Errorf("improper constraint: %s", v) - } - - cs := findConstraintRegex.FindAllString(v, -1) - if cs == nil { - cs = append(cs, v) - } - result := make([]*constraint, len(cs)) - for i, s := range cs { - pc, err := parseConstraint(s) - if err != nil { - return nil, err - } - - result[i] = pc - } - or[k] = result - } - - o := &Constraints{constraints: or} - return o, nil -} - -// Check tests if a version satisfies the constraints. -func (cs Constraints) Check(v *Version) bool { - // TODO(mattfarina): For v4 of this library consolidate the Check and Validate - // functions as the underlying functions make that possible now. - // loop over the ORs and check the inner ANDs - for _, o := range cs.constraints { - joy := true - for _, c := range o { - if check, _ := c.check(v); !check { - joy = false - break - } - } - - if joy { - return true - } - } - - return false -} - -// Validate checks if a version satisfies a constraint. If not a slice of -// reasons for the failure are returned in addition to a bool. -func (cs Constraints) Validate(v *Version) (bool, []error) { - // loop over the ORs and check the inner ANDs - var e []error - - // Capture the prerelease message only once. When it happens the first time - // this var is marked - var prerelesase bool - for _, o := range cs.constraints { - joy := true - for _, c := range o { - // Before running the check handle the case there the version is - // a prerelease and the check is not searching for prereleases. - if c.con.pre == "" && v.pre != "" { - if !prerelesase { - em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - e = append(e, em) - prerelesase = true - } - joy = false - - } else { - - if _, err := c.check(v); err != nil { - e = append(e, err) - joy = false - } - } - } - - if joy { - return true, []error{} - } - } - - return false, e -} - -func (cs Constraints) String() string { - buf := make([]string, len(cs.constraints)) - var tmp bytes.Buffer - - for k, v := range cs.constraints { - tmp.Reset() - vlen := len(v) - for kk, c := range v { - tmp.WriteString(c.string()) - - // Space separate the AND conditions - if vlen > 1 && kk < vlen-1 { - tmp.WriteString(" ") - } - } - buf[k] = tmp.String() - } - - return strings.Join(buf, " || ") -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (cs *Constraints) UnmarshalText(text []byte) error { - temp, err := NewConstraint(string(text)) - if err != nil { - return err - } - - *cs = *temp - - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (cs Constraints) MarshalText() ([]byte, error) { - return []byte(cs.String()), nil -} - -var constraintOps map[string]cfunc -var constraintRegex *regexp.Regexp -var constraintRangeRegex *regexp.Regexp - -// Used to find individual constraints within a multi-constraint string -var findConstraintRegex *regexp.Regexp - -// Used to validate an segment of ANDs is valid -var validConstraintRegex *regexp.Regexp - -const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` + - `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` - -func init() { - constraintOps = map[string]cfunc{ - "": constraintTildeOrEqual, - "=": constraintTildeOrEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "=>": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "=<": constraintLessThanEqual, - "~": constraintTilde, - "~>": constraintTilde, - "^": constraintCaret, - } - - ops := `=||!=|>|<|>=|=>|<=|=<|~|~>|\^` - - constraintRegex = regexp.MustCompile(fmt.Sprintf( - `^\s*(%s)\s*(%s)\s*$`, - ops, - cvRegex)) - - constraintRangeRegex = regexp.MustCompile(fmt.Sprintf( - `\s*(%s)\s+-\s+(%s)\s*`, - cvRegex, cvRegex)) - - findConstraintRegex = regexp.MustCompile(fmt.Sprintf( - `(%s)\s*(%s)`, - ops, - cvRegex)) - - // The first time a constraint shows up will look slightly different from - // future times it shows up due to a leading space or comma in a given - // string. - validConstraintRegex = regexp.MustCompile(fmt.Sprintf( - `^(\s*(%s)\s*(%s)\s*)((?:\s+|,\s*)(%s)\s*(%s)\s*)*$`, - ops, - cvRegex, - ops, - cvRegex)) -} - -// An individual constraint -type constraint struct { - // The version used in the constraint check. For example, if a constraint - // is '<= 2.0.0' the con a version instance representing 2.0.0. - con *Version - - // The original parsed version (e.g., 4.x from != 4.x) - orig string - - // The original operator for the constraint - origfunc string - - // When an x is used as part of the version (e.g., 1.x) - minorDirty bool - dirty bool - patchDirty bool -} - -// Check if a version meets the constraint -func (c *constraint) check(v *Version) (bool, error) { - return constraintOps[c.origfunc](v, c) -} - -// String prints an individual constraint into a string -func (c *constraint) string() string { - return c.origfunc + c.orig -} - -type cfunc func(v *Version, c *constraint) (bool, error) - -func parseConstraint(c string) (*constraint, error) { - if len(c) > 0 { - m := constraintRegex.FindStringSubmatch(c) - if m == nil { - return nil, fmt.Errorf("improper constraint: %s", c) - } - - cs := &constraint{ - orig: m[2], - origfunc: m[1], - } - - ver := m[2] - minorDirty := false - patchDirty := false - dirty := false - if isX(m[3]) || m[3] == "" { - ver = fmt.Sprintf("0.0.0%s", m[6]) - dirty = true - } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { - minorDirty = true - dirty = true - ver = fmt.Sprintf("%s.0.0%s", m[3], m[6]) - } else if isX(strings.TrimPrefix(m[5], ".")) || m[5] == "" { - dirty = true - patchDirty = true - ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6]) - } - - con, err := NewVersion(ver) - if err != nil { - - // The constraintRegex should catch any regex parsing errors. So, - // we should never get here. - return nil, errors.New("constraint Parser Error") - } - - cs.con = con - cs.minorDirty = minorDirty - cs.patchDirty = patchDirty - cs.dirty = dirty - - return cs, nil - } - - // The rest is the special case where an empty string was passed in which - // is equivalent to * or >=0.0.0 - con, err := StrictNewVersion("0.0.0") - if err != nil { - - // The constraintRegex should catch any regex parsing errors. So, - // we should never get here. - return nil, errors.New("constraint Parser Error") - } - - cs := &constraint{ - con: con, - orig: c, - origfunc: "", - minorDirty: false, - patchDirty: false, - dirty: true, - } - return cs, nil -} - -// Constraint functions -func constraintNotEqual(v *Version, c *constraint) (bool, error) { - if c.dirty { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - if c.con.Major() != v.Major() { - return true, nil - } - if c.con.Minor() != v.Minor() && !c.minorDirty { - return true, nil - } else if c.minorDirty { - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } else if c.con.Patch() != v.Patch() && !c.patchDirty { - return true, nil - } else if c.patchDirty { - // Need to handle prereleases if present - if v.Prerelease() != "" || c.con.Prerelease() != "" { - eq := comparePrerelease(v.Prerelease(), c.con.Prerelease()) != 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } - } - - eq := v.Equal(c.con) - if eq { - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } - - return true, nil -} - -func constraintGreaterThan(v *Version, c *constraint) (bool, error) { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - var eq bool - - if !c.dirty { - eq = v.Compare(c.con) == 1 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } - - if v.Major() > c.con.Major() { - return true, nil - } else if v.Major() < c.con.Major() { - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } else if c.minorDirty { - // This is a range case such as >11. When the version is something like - // 11.1.0 is it not > 11. For that we would need 12 or higher - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } else if c.patchDirty { - // This is for ranges such as >11.1. A version of 11.1.1 is not greater - // which one of 11.2.1 is greater - eq = v.Minor() > c.con.Minor() - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } - - // If we have gotten here we are not comparing pre-preleases and can use the - // Compare function to accomplish that. - eq = v.Compare(c.con) == 1 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) -} - -func constraintLessThan(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - eq := v.Compare(c.con) < 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is greater than or equal to %s", v, c.orig) -} - -func constraintGreaterThanEqual(v *Version, c *constraint) (bool, error) { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - eq := v.Compare(c.con) >= 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than %s", v, c.orig) -} - -func constraintLessThanEqual(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - var eq bool - - if !c.dirty { - eq = v.Compare(c.con) <= 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is greater than %s", v, c.orig) - } - - if v.Major() > c.con.Major() { - return false, fmt.Errorf("%s is greater than %s", v, c.orig) - } else if v.Major() == c.con.Major() && v.Minor() > c.con.Minor() && !c.minorDirty { - return false, fmt.Errorf("%s is greater than %s", v, c.orig) - } - - return true, nil -} - -// ~*, ~>* --> >= 0.0.0 (any) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 -func constraintTilde(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - if v.LessThan(c.con) { - return false, fmt.Errorf("%s is less than %s", v, c.orig) - } - - // ~0.0.0 is a special case where all constraints are accepted. It's - // equivalent to >= 0.0.0. - if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 && - !c.minorDirty && !c.patchDirty { - return true, nil - } - - if v.Major() != c.con.Major() { - return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) - } - - if v.Minor() != c.con.Minor() && !c.minorDirty { - return false, fmt.Errorf("%s does not have same major and minor version as %s", v, c.orig) - } - - return true, nil -} - -// When there is a .x (dirty) status it automatically opts in to ~. Otherwise -// it's a straight = -func constraintTildeOrEqual(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - if c.dirty { - return constraintTilde(v, c) - } - - eq := v.Equal(c.con) - if eq { - return true, nil - } - - return false, fmt.Errorf("%s is not equal to %s", v, c.orig) -} - -// ^* --> (any) -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2 --> >=1.2.0 <2.0.0 -// ^1 --> >=1.0.0 <2.0.0 -// ^0.2.3 --> >=0.2.3 <0.3.0 -// ^0.2 --> >=0.2.0 <0.3.0 -// ^0.0.3 --> >=0.0.3 <0.0.4 -// ^0.0 --> >=0.0.0 <0.1.0 -// ^0 --> >=0.0.0 <1.0.0 -func constraintCaret(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - // This less than handles prereleases - if v.LessThan(c.con) { - return false, fmt.Errorf("%s is less than %s", v, c.orig) - } - - var eq bool - - // ^ when the major > 0 is >=x.y.z < x+1 - if c.con.Major() > 0 || c.minorDirty { - - // ^ has to be within a major range for > 0. Everything less than was - // filtered out with the LessThan call above. This filters out those - // that greater but not within the same major range. - eq = v.Major() == c.con.Major() - if eq { - return true, nil - } - return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) - } - - // ^ when the major is 0 and minor > 0 is >=0.y.z < 0.y+1 - if c.con.Major() == 0 && v.Major() > 0 { - return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) - } - // If the con Minor is > 0 it is not dirty - if c.con.Minor() > 0 || c.patchDirty { - eq = v.Minor() == c.con.Minor() - if eq { - return true, nil - } - return false, fmt.Errorf("%s does not have same minor version as %s. Expected minor versions to match when constraint major version is 0", v, c.orig) - } - // ^ when the minor is 0 and minor > 0 is =0.0.z - if c.con.Minor() == 0 && v.Minor() > 0 { - return false, fmt.Errorf("%s does not have same minor version as %s", v, c.orig) - } - - // At this point the major is 0 and the minor is 0 and not dirty. The patch - // is not dirty so we need to check if they are equal. If they are not equal - eq = c.con.Patch() == v.Patch() - if eq { - return true, nil - } - return false, fmt.Errorf("%s does not equal %s. Expect version and constraint to equal when major and minor versions are 0", v, c.orig) -} - -func isX(x string) bool { - switch x { - case "x", "*", "X": - return true - default: - return false - } -} - -func rewriteRange(i string) string { - m := constraintRangeRegex.FindAllStringSubmatch(i, -1) - if m == nil { - return i - } - o := i - for _, v := range m { - t := fmt.Sprintf(">= %s, <= %s ", v[1], v[11]) - o = strings.Replace(o, v[0], t, 1) - } - - return o -} diff --git a/vendor/github.com/Masterminds/semver/v3/doc.go b/vendor/github.com/Masterminds/semver/v3/doc.go deleted file mode 100644 index 74f97caa57..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/doc.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. - -Specifically it provides the ability to: - - - Parse semantic versions - - Sort semantic versions - - Check if a semantic version fits within a set of constraints - - Optionally work with a `v` prefix - -# Parsing Semantic Versions - -There are two functions that can parse semantic versions. The `StrictNewVersion` -function only parses valid version 2 semantic versions as outlined in the -specification. The `NewVersion` function attempts to coerce a version into a -semantic version and parse it. For example, if there is a leading v or a version -listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid -semantic version (e.g., 1.2.0). In both cases a `Version` object is returned -that can be sorted, compared, and used in constraints. - -When parsing a version an optional error can be returned if there is an issue -parsing the version. For example, - - v, err := semver.NewVersion("1.2.3-beta.1+b345") - -The version object has methods to get the parts of the version, compare it to -other versions, convert the version back into a string, and get the original -string. For more details please see the documentation -at https://godoc.org/github.com/Masterminds/semver. - -# Sorting Semantic Versions - -A set of versions can be sorted using the `sort` package from the standard library. -For example, - - raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} - vs := make([]*semver.Version, len(raw)) - for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v - } - - sort.Sort(semver.Collection(vs)) - -# Checking Version Constraints and Comparing Versions - -There are two methods for comparing versions. One uses comparison methods on -`Version` instances and the other is using Constraints. There are some important -differences to notes between these two methods of comparison. - - 1. When two versions are compared using functions such as `Compare`, `LessThan`, - and others it will follow the specification and always include prereleases - within the comparison. It will provide an answer valid with the comparison - spec section at https://semver.org/#spec-item-11 - 2. When constraint checking is used for checks or validation it will follow a - different set of rules that are common for ranges with tools like npm/js - and Rust/Cargo. This includes considering prereleases to be invalid if the - ranges does not include on. If you want to have it include pre-releases a - simple solution is to include `-0` in your range. - 3. Constraint ranges can have some complex rules including the shorthard use of - ~ and ^. For more details on those see the options below. - -There are differences between the two methods or checking versions because the -comparison methods on `Version` follow the specification while comparison ranges -are not part of the specification. Different packages and tools have taken it -upon themselves to come up with range rules. This has resulted in differences. -For example, npm/js and Cargo/Rust follow similar patterns which PHP has a -different pattern for ^. The comparison features in this package follow the -npm/js and Cargo/Rust lead because applications using it have followed similar -patters with their versions. - -Checking a version against version constraints is one of the most featureful -parts of the package. - - c, err := semver.NewConstraint(">= 1.2.3") - if err != nil { - // Handle constraint not being parsable. - } - - v, err := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parsable. - } - // Check if the version meets the constraints. The a variable will be true. - a := c.Check(v) - -# Basic Comparisons - -There are two elements to the comparisons. First, a comparison string is a list -of comma or space separated AND comparisons. These are then separated by || (OR) -comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a -comparison that's greater than or equal to 1.2 and less than 3.0.0 or is -greater than or equal to 4.2.3. This can also be written as -`">= 1.2, < 3.0.0 || >= 4.2.3"` - -The basic comparisons are: - - - `=`: equal (aliased to no operator) - - `!=`: not equal - - `>`: greater than - - `<`: less than - - `>=`: greater than or equal to - - `<=`: less than or equal to - -# Hyphen Range Comparisons - -There are multiple methods to handle ranges and the first is hyphens ranges. -These look like: - - - `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` - - `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` - -# Wildcards In Comparisons - -The `x`, `X`, and `*` characters can be used as a wildcard character. This works -for all comparison operators. When used on the `=` operator it falls -back to the tilde operation. For example, - - - `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - - `>= 1.2.x` is equivalent to `>= 1.2.0` - - `<= 2.x` is equivalent to `<= 3` - - `*` is equivalent to `>= 0.0.0` - -Tilde Range Comparisons (Patch) - -The tilde (`~`) comparison operator is for patch level ranges when a minor -version is specified and major level changes when the minor number is missing. -For example, - - - `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0` - - `~1` is equivalent to `>= 1, < 2` - - `~2.3` is equivalent to `>= 2.3 < 2.4` - - `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - - `~1.x` is equivalent to `>= 1 < 2` - -Caret Range Comparisons (Major) - -The caret (`^`) comparison operator is for major level changes once a stable -(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts -as the API stability level. This is useful when comparisons of API versions as a -major change is API breaking. For example, - - - `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` - - `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` - - `^2.3` is equivalent to `>= 2.3, < 3` - - `^2.x` is equivalent to `>= 2.0.0, < 3` - - `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` - - `^0.2` is equivalent to `>=0.2.0 <0.3.0` - - `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` - - `^0.0` is equivalent to `>=0.0.0 <0.1.0` - - `^0` is equivalent to `>=0.0.0 <1.0.0` - -# Validation - -In addition to testing a version against a constraint, a version can be validated -against a constraint. When validation fails a slice of errors containing why a -version didn't meet the constraint is returned. For example, - - c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") - if err != nil { - // Handle constraint not being parseable. - } - - v, _ := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - - // Validate a version against a constraint. - a, msgs := c.Validate(v) - // a is false - for _, m := range msgs { - fmt.Println(m) - - // Loops over the errors which would read - // "1.3 is greater than 1.2.3" - // "1.3 is less than 1.4" - } -*/ -package semver diff --git a/vendor/github.com/Masterminds/semver/v3/version.go b/vendor/github.com/Masterminds/semver/v3/version.go deleted file mode 100644 index 7c4bed3347..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/version.go +++ /dev/null @@ -1,639 +0,0 @@ -package semver - -import ( - "bytes" - "database/sql/driver" - "encoding/json" - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -// The compiled version of the regex created at init() is cached here so it -// only needs to be created once. -var versionRegex *regexp.Regexp - -var ( - // ErrInvalidSemVer is returned a version is found to be invalid when - // being parsed. - ErrInvalidSemVer = errors.New("Invalid Semantic Version") - - // ErrEmptyString is returned when an empty string is passed in for parsing. - ErrEmptyString = errors.New("Version string empty") - - // ErrInvalidCharacters is returned when invalid characters are found as - // part of a version - ErrInvalidCharacters = errors.New("Invalid characters in version") - - // ErrSegmentStartsZero is returned when a version segment starts with 0. - // This is invalid in SemVer. - ErrSegmentStartsZero = errors.New("Version segment starts with 0") - - // ErrInvalidMetadata is returned when the metadata is an invalid format - ErrInvalidMetadata = errors.New("Invalid Metadata string") - - // ErrInvalidPrerelease is returned when the pre-release is an invalid format - ErrInvalidPrerelease = errors.New("Invalid Prerelease string") -) - -// semVerRegex is the regular expression used to parse a semantic version. -const semVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + - `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` - -// Version represents a single semantic version. -type Version struct { - major, minor, patch uint64 - pre string - metadata string - original string -} - -func init() { - versionRegex = regexp.MustCompile("^" + semVerRegex + "$") -} - -const ( - num string = "0123456789" - allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num -) - -// StrictNewVersion parses a given version and returns an instance of Version or -// an error if unable to parse the version. Only parses valid semantic versions. -// Performs checking that can find errors within the version. -// If you want to coerce a version such as 1 or 1.2 and parse it as the 1.x -// releases of semver did, use the NewVersion() function. -func StrictNewVersion(v string) (*Version, error) { - // Parsing here does not use RegEx in order to increase performance and reduce - // allocations. - - if len(v) == 0 { - return nil, ErrEmptyString - } - - // Split the parts into [0]major, [1]minor, and [2]patch,prerelease,build - parts := strings.SplitN(v, ".", 3) - if len(parts) != 3 { - return nil, ErrInvalidSemVer - } - - sv := &Version{ - original: v, - } - - // check for prerelease or build metadata - var extra []string - if strings.ContainsAny(parts[2], "-+") { - // Start with the build metadata first as it needs to be on the right - extra = strings.SplitN(parts[2], "+", 2) - if len(extra) > 1 { - // build metadata found - sv.metadata = extra[1] - parts[2] = extra[0] - } - - extra = strings.SplitN(parts[2], "-", 2) - if len(extra) > 1 { - // prerelease found - sv.pre = extra[1] - parts[2] = extra[0] - } - } - - // Validate the number segments are valid. This includes only having positive - // numbers and no leading 0's. - for _, p := range parts { - if !containsOnly(p, num) { - return nil, ErrInvalidCharacters - } - - if len(p) > 1 && p[0] == '0' { - return nil, ErrSegmentStartsZero - } - } - - // Extract the major, minor, and patch elements onto the returned Version - var err error - sv.major, err = strconv.ParseUint(parts[0], 10, 64) - if err != nil { - return nil, err - } - - sv.minor, err = strconv.ParseUint(parts[1], 10, 64) - if err != nil { - return nil, err - } - - sv.patch, err = strconv.ParseUint(parts[2], 10, 64) - if err != nil { - return nil, err - } - - // No prerelease or build metadata found so returning now as a fastpath. - if sv.pre == "" && sv.metadata == "" { - return sv, nil - } - - if sv.pre != "" { - if err = validatePrerelease(sv.pre); err != nil { - return nil, err - } - } - - if sv.metadata != "" { - if err = validateMetadata(sv.metadata); err != nil { - return nil, err - } - } - - return sv, nil -} - -// NewVersion parses a given version and returns an instance of Version or -// an error if unable to parse the version. If the version is SemVer-ish it -// attempts to convert it to SemVer. If you want to validate it was a strict -// semantic version at parse time see StrictNewVersion(). -func NewVersion(v string) (*Version, error) { - m := versionRegex.FindStringSubmatch(v) - if m == nil { - return nil, ErrInvalidSemVer - } - - sv := &Version{ - metadata: m[8], - pre: m[5], - original: v, - } - - var err error - sv.major, err = strconv.ParseUint(m[1], 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - - if m[2] != "" { - sv.minor, err = strconv.ParseUint(strings.TrimPrefix(m[2], "."), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - } else { - sv.minor = 0 - } - - if m[3] != "" { - sv.patch, err = strconv.ParseUint(strings.TrimPrefix(m[3], "."), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - } else { - sv.patch = 0 - } - - // Perform some basic due diligence on the extra parts to ensure they are - // valid. - - if sv.pre != "" { - if err = validatePrerelease(sv.pre); err != nil { - return nil, err - } - } - - if sv.metadata != "" { - if err = validateMetadata(sv.metadata); err != nil { - return nil, err - } - } - - return sv, nil -} - -// New creates a new instance of Version with each of the parts passed in as -// arguments instead of parsing a version string. -func New(major, minor, patch uint64, pre, metadata string) *Version { - v := Version{ - major: major, - minor: minor, - patch: patch, - pre: pre, - metadata: metadata, - original: "", - } - - v.original = v.String() - - return &v -} - -// MustParse parses a given version and panics on error. -func MustParse(v string) *Version { - sv, err := NewVersion(v) - if err != nil { - panic(err) - } - return sv -} - -// String converts a Version object to a string. -// Note, if the original version contained a leading v this version will not. -// See the Original() method to retrieve the original value. Semantic Versions -// don't contain a leading v per the spec. Instead it's optional on -// implementation. -func (v Version) String() string { - var buf bytes.Buffer - - fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch) - if v.pre != "" { - fmt.Fprintf(&buf, "-%s", v.pre) - } - if v.metadata != "" { - fmt.Fprintf(&buf, "+%s", v.metadata) - } - - return buf.String() -} - -// Original returns the original value passed in to be parsed. -func (v *Version) Original() string { - return v.original -} - -// Major returns the major version. -func (v Version) Major() uint64 { - return v.major -} - -// Minor returns the minor version. -func (v Version) Minor() uint64 { - return v.minor -} - -// Patch returns the patch version. -func (v Version) Patch() uint64 { - return v.patch -} - -// Prerelease returns the pre-release version. -func (v Version) Prerelease() string { - return v.pre -} - -// Metadata returns the metadata on the version. -func (v Version) Metadata() string { - return v.metadata -} - -// originalVPrefix returns the original 'v' prefix if any. -func (v Version) originalVPrefix() string { - // Note, only lowercase v is supported as a prefix by the parser. - if v.original != "" && v.original[:1] == "v" { - return v.original[:1] - } - return "" -} - -// IncPatch produces the next patch version. -// If the current version does not have prerelease/metadata information, -// it unsets metadata and prerelease values, increments patch number. -// If the current version has any of prerelease or metadata information, -// it unsets both values and keeps current patch value -func (v Version) IncPatch() Version { - vNext := v - // according to http://semver.org/#spec-item-9 - // Pre-release versions have a lower precedence than the associated normal version. - // according to http://semver.org/#spec-item-10 - // Build metadata SHOULD be ignored when determining version precedence. - if v.pre != "" { - vNext.metadata = "" - vNext.pre = "" - } else { - vNext.metadata = "" - vNext.pre = "" - vNext.patch = v.patch + 1 - } - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// IncMinor produces the next minor version. -// Sets patch to 0. -// Increments minor number. -// Unsets metadata. -// Unsets prerelease status. -func (v Version) IncMinor() Version { - vNext := v - vNext.metadata = "" - vNext.pre = "" - vNext.patch = 0 - vNext.minor = v.minor + 1 - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// IncMajor produces the next major version. -// Sets patch to 0. -// Sets minor to 0. -// Increments major number. -// Unsets metadata. -// Unsets prerelease status. -func (v Version) IncMajor() Version { - vNext := v - vNext.metadata = "" - vNext.pre = "" - vNext.patch = 0 - vNext.minor = 0 - vNext.major = v.major + 1 - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// SetPrerelease defines the prerelease value. -// Value must not include the required 'hyphen' prefix. -func (v Version) SetPrerelease(prerelease string) (Version, error) { - vNext := v - if len(prerelease) > 0 { - if err := validatePrerelease(prerelease); err != nil { - return vNext, err - } - } - vNext.pre = prerelease - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext, nil -} - -// SetMetadata defines metadata value. -// Value must not include the required 'plus' prefix. -func (v Version) SetMetadata(metadata string) (Version, error) { - vNext := v - if len(metadata) > 0 { - if err := validateMetadata(metadata); err != nil { - return vNext, err - } - } - vNext.metadata = metadata - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext, nil -} - -// LessThan tests if one version is less than another one. -func (v *Version) LessThan(o *Version) bool { - return v.Compare(o) < 0 -} - -// GreaterThan tests if one version is greater than another one. -func (v *Version) GreaterThan(o *Version) bool { - return v.Compare(o) > 0 -} - -// Equal tests if two versions are equal to each other. -// Note, versions can be equal with different metadata since metadata -// is not considered part of the comparable version. -func (v *Version) Equal(o *Version) bool { - return v.Compare(o) == 0 -} - -// Compare compares this version to another one. It returns -1, 0, or 1 if -// the version smaller, equal, or larger than the other version. -// -// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is -// lower than the version without a prerelease. Compare always takes into account -// prereleases. If you want to work with ranges using typical range syntaxes that -// skip prereleases if the range is not looking for them use constraints. -func (v *Version) Compare(o *Version) int { - // Compare the major, minor, and patch version for differences. If a - // difference is found return the comparison. - if d := compareSegment(v.Major(), o.Major()); d != 0 { - return d - } - if d := compareSegment(v.Minor(), o.Minor()); d != 0 { - return d - } - if d := compareSegment(v.Patch(), o.Patch()); d != 0 { - return d - } - - // At this point the major, minor, and patch versions are the same. - ps := v.pre - po := o.Prerelease() - - if ps == "" && po == "" { - return 0 - } - if ps == "" { - return 1 - } - if po == "" { - return -1 - } - - return comparePrerelease(ps, po) -} - -// UnmarshalJSON implements JSON.Unmarshaler interface. -func (v *Version) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - temp, err := NewVersion(s) - if err != nil { - return err - } - v.major = temp.major - v.minor = temp.minor - v.patch = temp.patch - v.pre = temp.pre - v.metadata = temp.metadata - v.original = temp.original - return nil -} - -// MarshalJSON implements JSON.Marshaler interface. -func (v Version) MarshalJSON() ([]byte, error) { - return json.Marshal(v.String()) -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (v *Version) UnmarshalText(text []byte) error { - temp, err := NewVersion(string(text)) - if err != nil { - return err - } - - *v = *temp - - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (v Version) MarshalText() ([]byte, error) { - return []byte(v.String()), nil -} - -// Scan implements the SQL.Scanner interface. -func (v *Version) Scan(value interface{}) error { - var s string - s, _ = value.(string) - temp, err := NewVersion(s) - if err != nil { - return err - } - v.major = temp.major - v.minor = temp.minor - v.patch = temp.patch - v.pre = temp.pre - v.metadata = temp.metadata - v.original = temp.original - return nil -} - -// Value implements the Driver.Valuer interface. -func (v Version) Value() (driver.Value, error) { - return v.String(), nil -} - -func compareSegment(v, o uint64) int { - if v < o { - return -1 - } - if v > o { - return 1 - } - - return 0 -} - -func comparePrerelease(v, o string) int { - // split the prelease versions by their part. The separator, per the spec, - // is a . - sparts := strings.Split(v, ".") - oparts := strings.Split(o, ".") - - // Find the longer length of the parts to know how many loop iterations to - // go through. - slen := len(sparts) - olen := len(oparts) - - l := slen - if olen > slen { - l = olen - } - - // Iterate over each part of the prereleases to compare the differences. - for i := 0; i < l; i++ { - // Since the lentgh of the parts can be different we need to create - // a placeholder. This is to avoid out of bounds issues. - stemp := "" - if i < slen { - stemp = sparts[i] - } - - otemp := "" - if i < olen { - otemp = oparts[i] - } - - d := comparePrePart(stemp, otemp) - if d != 0 { - return d - } - } - - // Reaching here means two versions are of equal value but have different - // metadata (the part following a +). They are not identical in string form - // but the version comparison finds them to be equal. - return 0 -} - -func comparePrePart(s, o string) int { - // Fastpath if they are equal - if s == o { - return 0 - } - - // When s or o are empty we can use the other in an attempt to determine - // the response. - if s == "" { - if o != "" { - return -1 - } - return 1 - } - - if o == "" { - if s != "" { - return 1 - } - return -1 - } - - // When comparing strings "99" is greater than "103". To handle - // cases like this we need to detect numbers and compare them. According - // to the semver spec, numbers are always positive. If there is a - at the - // start like -99 this is to be evaluated as an alphanum. numbers always - // have precedence over alphanum. Parsing as Uints because negative numbers - // are ignored. - - oi, n1 := strconv.ParseUint(o, 10, 64) - si, n2 := strconv.ParseUint(s, 10, 64) - - // The case where both are strings compare the strings - if n1 != nil && n2 != nil { - if s > o { - return 1 - } - return -1 - } else if n1 != nil { - // o is a string and s is a number - return -1 - } else if n2 != nil { - // s is a string and o is a number - return 1 - } - // Both are numbers - if si > oi { - return 1 - } - return -1 -} - -// Like strings.ContainsAny but does an only instead of any. -func containsOnly(s string, comp string) bool { - return strings.IndexFunc(s, func(r rune) bool { - return !strings.ContainsRune(comp, r) - }) == -1 -} - -// From the spec, "Identifiers MUST comprise only -// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. -// Numeric identifiers MUST NOT include leading zeroes.". These segments can -// be dot separated. -func validatePrerelease(p string) error { - eparts := strings.Split(p, ".") - for _, p := range eparts { - if containsOnly(p, num) { - if len(p) > 1 && p[0] == '0' { - return ErrSegmentStartsZero - } - } else if !containsOnly(p, allowed) { - return ErrInvalidPrerelease - } - } - - return nil -} - -// From the spec, "Build metadata MAY be denoted by -// appending a plus sign and a series of dot separated identifiers immediately -// following the patch or pre-release version. Identifiers MUST comprise only -// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty." -func validateMetadata(m string) error { - eparts := strings.Split(m, ".") - for _, p := range eparts { - if !containsOnly(p, allowed) { - return ErrInvalidMetadata - } - } - return nil -} diff --git a/vendor/github.com/Masterminds/sprig/v3/.gitignore b/vendor/github.com/Masterminds/sprig/v3/.gitignore deleted file mode 100644 index 5e3002f88f..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -/.glide diff --git a/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md b/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md deleted file mode 100644 index 2ce45dd4ec..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md +++ /dev/null @@ -1,383 +0,0 @@ -# Changelog - -## Release 3.2.3 (2022-11-29) - -### Changed - -- Updated docs (thanks @book987 @aJetHorn @neelayu @pellizzetti @apricote @SaigyoujiYuyuko233 @AlekSi) -- #348: Updated huandu/xstrings which fixed a snake case bug (thanks @yxxhero) -- #353: Updated masterminds/semver which included bug fixes -- #354: Updated golang.org/x/crypto which included bug fixes - -## Release 3.2.2 (2021-02-04) - -This is a re-release of 3.2.1 to satisfy something with the Go module system. - -## Release 3.2.1 (2021-02-04) - -### Changed - -- Upgraded `Masterminds/goutils` to `v1.1.1`. see the [Security Advisory](https://github.com/Masterminds/goutils/security/advisories/GHSA-xg2h-wx96-xgxr) - -## Release 3.2.0 (2020-12-14) - -### Added - -- #211: Added randInt function (thanks @kochurovro) -- #223: Added fromJson and mustFromJson functions (thanks @mholt) -- #242: Added a bcrypt function (thanks @robbiet480) -- #253: Added randBytes function (thanks @MikaelSmith) -- #254: Added dig function for dicts (thanks @nyarly) -- #257: Added regexQuoteMeta for quoting regex metadata (thanks @rheaton) -- #261: Added filepath functions osBase, osDir, osExt, osClean, osIsAbs (thanks @zugl) -- #268: Added and and all functions for testing conditions (thanks @phuslu) -- #181: Added float64 arithmetic addf, add1f, subf, divf, mulf, maxf, and minf - (thanks @andrewmostello) -- #265: Added chunk function to split array into smaller arrays (thanks @karelbilek) -- #270: Extend certificate functions to handle non-RSA keys + add support for - ed25519 keys (thanks @misberner) - -### Changed - -- Removed testing and support for Go 1.12. ed25519 support requires Go 1.13 or newer -- Using semver 3.1.1 and mergo 0.3.11 - -### Fixed - -- #249: Fix htmlDateInZone example (thanks @spawnia) - -NOTE: The dependency github.com/imdario/mergo reverted the breaking change in -0.3.9 via 0.3.10 release. - -## Release 3.1.0 (2020-04-16) - -NOTE: The dependency github.com/imdario/mergo made a behavior change in 0.3.9 -that impacts sprig functionality. Do not use sprig with a version newer than 0.3.8. - -### Added - -- #225: Added support for generating htpasswd hash (thanks @rustycl0ck) -- #224: Added duration filter (thanks @frebib) -- #205: Added `seq` function (thanks @thadc23) - -### Changed - -- #203: Unlambda functions with correct signature (thanks @muesli) -- #236: Updated the license formatting for GitHub display purposes -- #238: Updated package dependency versions. Note, mergo not updated to 0.3.9 - as it causes a breaking change for sprig. That issue is tracked at - https://github.com/imdario/mergo/issues/139 - -### Fixed - -- #229: Fix `seq` example in docs (thanks @kalmant) - -## Release 3.0.2 (2019-12-13) - -### Fixed - -- #220: Updating to semver v3.0.3 to fix issue with <= ranges -- #218: fix typo elyptical->elliptic in ecdsa key description (thanks @laverya) - -## Release 3.0.1 (2019-12-08) - -### Fixed - -- #212: Updated semver fixing broken constraint checking with ^0.0 - -## Release 3.0.0 (2019-10-02) - -### Added - -- #187: Added durationRound function (thanks @yjp20) -- #189: Added numerous template functions that return errors rather than panic (thanks @nrvnrvn) -- #193: Added toRawJson support (thanks @Dean-Coakley) -- #197: Added get support to dicts (thanks @Dean-Coakley) - -### Changed - -- #186: Moving dependency management to Go modules -- #186: Updated semver to v3. This has changes in the way ^ is handled -- #194: Updated documentation on merging and how it copies. Added example using deepCopy -- #196: trunc now supports negative values (thanks @Dean-Coakley) - -## Release 2.22.0 (2019-10-02) - -### Added - -- #173: Added getHostByName function to resolve dns names to ips (thanks @fcgravalos) -- #195: Added deepCopy function for use with dicts - -### Changed - -- Updated merge and mergeOverwrite documentation to explain copying and how to - use deepCopy with it - -## Release 2.21.0 (2019-09-18) - -### Added - -- #122: Added encryptAES/decryptAES functions (thanks @n0madic) -- #128: Added toDecimal support (thanks @Dean-Coakley) -- #169: Added list contcat (thanks @astorath) -- #174: Added deepEqual function (thanks @bonifaido) -- #170: Added url parse and join functions (thanks @astorath) - -### Changed - -- #171: Updated glide config for Google UUID to v1 and to add ranges to semver and testify - -### Fixed - -- #172: Fix semver wildcard example (thanks @piepmatz) -- #175: Fix dateInZone doc example (thanks @s3than) - -## Release 2.20.0 (2019-06-18) - -### Added - -- #164: Adding function to get unix epoch for a time (@mattfarina) -- #166: Adding tests for date_in_zone (@mattfarina) - -### Changed - -- #144: Fix function comments based on best practices from Effective Go (@CodeLingoTeam) -- #150: Handles pointer type for time.Time in "htmlDate" (@mapreal19) -- #161, #157, #160, #153, #158, #156, #155, #159, #152 documentation updates (@badeadan) - -### Fixed - -## Release 2.19.0 (2019-03-02) - -IMPORTANT: This release reverts a change from 2.18.0 - -In the previous release (2.18), we prematurely merged a partial change to the crypto functions that led to creating two sets of crypto functions (I blame @technosophos -- since that's me). This release rolls back that change, and does what was originally intended: It alters the existing crypto functions to use secure random. - -We debated whether this classifies as a change worthy of major revision, but given the proximity to the last release, we have decided that treating 2.18 as a faulty release is the correct course of action. We apologize for any inconvenience. - -### Changed - -- Fix substr panic 35fb796 (Alexey igrychev) -- Remove extra period 1eb7729 (Matthew Lorimor) -- Make random string functions use crypto by default 6ceff26 (Matthew Lorimor) -- README edits/fixes/suggestions 08fe136 (Lauri Apple) - - -## Release 2.18.0 (2019-02-12) - -### Added - -- Added mergeOverwrite function -- cryptographic functions that use secure random (see fe1de12) - -### Changed - -- Improve documentation of regexMatch function, resolves #139 90b89ce (Jan Tagscherer) -- Handle has for nil list 9c10885 (Daniel Cohen) -- Document behaviour of mergeOverwrite fe0dbe9 (Lukas Rieder) -- doc: adds missing documentation. 4b871e6 (Fernandez Ludovic) -- Replace outdated goutils imports 01893d2 (Matthew Lorimor) -- Surface crypto secure random strings from goutils fe1de12 (Matthew Lorimor) -- Handle untyped nil values as paramters to string functions 2b2ec8f (Morten Torkildsen) - -### Fixed - -- Fix dict merge issue and provide mergeOverwrite .dst .src1 to overwrite from src -> dst 4c59c12 (Lukas Rieder) -- Fix substr var names and comments d581f80 (Dean Coakley) -- Fix substr documentation 2737203 (Dean Coakley) - -## Release 2.17.1 (2019-01-03) - -### Fixed - -The 2.17.0 release did not have a version pinned for xstrings, which caused compilation failures when xstrings < 1.2 was used. This adds the correct version string to glide.yaml. - -## Release 2.17.0 (2019-01-03) - -### Added - -- adds alder32sum function and test 6908fc2 (marshallford) -- Added kebabcase function ca331a1 (Ilyes512) - -### Changed - -- Update goutils to 1.1.0 4e1125d (Matt Butcher) - -### Fixed - -- Fix 'has' documentation e3f2a85 (dean-coakley) -- docs(dict): fix typo in pick example dc424f9 (Dustin Specker) -- fixes spelling errors... not sure how that happened 4cf188a (marshallford) - -## Release 2.16.0 (2018-08-13) - -### Added - -- add splitn function fccb0b0 (Helgi Þorbjörnsson) -- Add slice func df28ca7 (gongdo) -- Generate serial number a3bdffd (Cody Coons) -- Extract values of dict with values function df39312 (Lawrence Jones) - -### Changed - -- Modify panic message for list.slice ae38335 (gongdo) -- Minor improvement in code quality - Removed an unreachable piece of code at defaults.go#L26:6 - Resolve formatting issues. 5834241 (Abhishek Kashyap) -- Remove duplicated documentation 1d97af1 (Matthew Fisher) -- Test on go 1.11 49df809 (Helgi Þormar Þorbjörnsson) - -### Fixed - -- Fix file permissions c5f40b5 (gongdo) -- Fix example for buildCustomCert 7779e0d (Tin Lam) - -## Release 2.15.0 (2018-04-02) - -### Added - -- #68 and #69: Add json helpers to docs (thanks @arunvelsriram) -- #66: Add ternary function (thanks @binoculars) -- #67: Allow keys function to take multiple dicts (thanks @binoculars) -- #89: Added sha1sum to crypto function (thanks @benkeil) -- #81: Allow customizing Root CA that used by genSignedCert (thanks @chenzhiwei) -- #92: Add travis testing for go 1.10 -- #93: Adding appveyor config for windows testing - -### Changed - -- #90: Updating to more recent dependencies -- #73: replace satori/go.uuid with google/uuid (thanks @petterw) - -### Fixed - -- #76: Fixed documentation typos (thanks @Thiht) -- Fixed rounding issue on the `ago` function. Note, the removes support for Go 1.8 and older - -## Release 2.14.1 (2017-12-01) - -### Fixed - -- #60: Fix typo in function name documentation (thanks @neil-ca-moore) -- #61: Removing line with {{ due to blocking github pages genertion -- #64: Update the list functions to handle int, string, and other slices for compatibility - -## Release 2.14.0 (2017-10-06) - -This new version of Sprig adds a set of functions for generating and working with SSL certificates. - -- `genCA` generates an SSL Certificate Authority -- `genSelfSignedCert` generates an SSL self-signed certificate -- `genSignedCert` generates an SSL certificate and key based on a given CA - -## Release 2.13.0 (2017-09-18) - -This release adds new functions, including: - -- `regexMatch`, `regexFindAll`, `regexFind`, `regexReplaceAll`, `regexReplaceAllLiteral`, and `regexSplit` to work with regular expressions -- `floor`, `ceil`, and `round` math functions -- `toDate` converts a string to a date -- `nindent` is just like `indent` but also prepends a new line -- `ago` returns the time from `time.Now` - -### Added - -- #40: Added basic regex functionality (thanks @alanquillin) -- #41: Added ceil floor and round functions (thanks @alanquillin) -- #48: Added toDate function (thanks @andreynering) -- #50: Added nindent function (thanks @binoculars) -- #46: Added ago function (thanks @slayer) - -### Changed - -- #51: Updated godocs to include new string functions (thanks @curtisallen) -- #49: Added ability to merge multiple dicts (thanks @binoculars) - -## Release 2.12.0 (2017-05-17) - -- `snakecase`, `camelcase`, and `shuffle` are three new string functions -- `fail` allows you to bail out of a template render when conditions are not met - -## Release 2.11.0 (2017-05-02) - -- Added `toJson` and `toPrettyJson` -- Added `merge` -- Refactored documentation - -## Release 2.10.0 (2017-03-15) - -- Added `semver` and `semverCompare` for Semantic Versions -- `list` replaces `tuple` -- Fixed issue with `join` -- Added `first`, `last`, `intial`, `rest`, `prepend`, `append`, `toString`, `toStrings`, `sortAlpha`, `reverse`, `coalesce`, `pluck`, `pick`, `compact`, `keys`, `omit`, `uniq`, `has`, `without` - -## Release 2.9.0 (2017-02-23) - -- Added `splitList` to split a list -- Added crypto functions of `genPrivateKey` and `derivePassword` - -## Release 2.8.0 (2016-12-21) - -- Added access to several path functions (`base`, `dir`, `clean`, `ext`, and `abs`) -- Added functions for _mutating_ dictionaries (`set`, `unset`, `hasKey`) - -## Release 2.7.0 (2016-12-01) - -- Added `sha256sum` to generate a hash of an input -- Added functions to convert a numeric or string to `int`, `int64`, `float64` - -## Release 2.6.0 (2016-10-03) - -- Added a `uuidv4` template function for generating UUIDs inside of a template. - -## Release 2.5.0 (2016-08-19) - -- New `trimSuffix`, `trimPrefix`, `hasSuffix`, and `hasPrefix` functions -- New aliases have been added for a few functions that didn't follow the naming conventions (`trimAll` and `abbrevBoth`) -- `trimall` and `abbrevboth` (notice the case) are deprecated and will be removed in 3.0.0 - -## Release 2.4.0 (2016-08-16) - -- Adds two functions: `until` and `untilStep` - -## Release 2.3.0 (2016-06-21) - -- cat: Concatenate strings with whitespace separators. -- replace: Replace parts of a string: `replace " " "-" "Me First"` renders "Me-First" -- plural: Format plurals: `len "foo" | plural "one foo" "many foos"` renders "many foos" -- indent: Indent blocks of text in a way that is sensitive to "\n" characters. - -## Release 2.2.0 (2016-04-21) - -- Added a `genPrivateKey` function (Thanks @bacongobbler) - -## Release 2.1.0 (2016-03-30) - -- `default` now prints the default value when it does not receive a value down the pipeline. It is much safer now to do `{{.Foo | default "bar"}}`. -- Added accessors for "hermetic" functions. These return only functions that, when given the same input, produce the same output. - -## Release 2.0.0 (2016-03-29) - -Because we switched from `int` to `int64` as the return value for all integer math functions, the library's major version number has been incremented. - -- `min` complements `max` (formerly `biggest`) -- `empty` indicates that a value is the empty value for its type -- `tuple` creates a tuple inside of a template: `{{$t := tuple "a", "b" "c"}}` -- `dict` creates a dictionary inside of a template `{{$d := dict "key1" "val1" "key2" "val2"}}` -- Date formatters have been added for HTML dates (as used in `date` input fields) -- Integer math functions can convert from a number of types, including `string` (via `strconv.ParseInt`). - -## Release 1.2.0 (2016-02-01) - -- Added quote and squote -- Added b32enc and b32dec -- add now takes varargs -- biggest now takes varargs - -## Release 1.1.0 (2015-12-29) - -- Added #4: Added contains function. strings.Contains, but with the arguments - switched to simplify common pipelines. (thanks krancour) -- Added Travis-CI testing support - -## Release 1.0.0 (2015-12-23) - -- Initial release diff --git a/vendor/github.com/Masterminds/sprig/v3/LICENSE.txt b/vendor/github.com/Masterminds/sprig/v3/LICENSE.txt deleted file mode 100644 index f311b1eaaa..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013-2020 Masterminds - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/sprig/v3/Makefile b/vendor/github.com/Masterminds/sprig/v3/Makefile deleted file mode 100644 index 78d409cde2..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: test -test: - @echo "==> Running tests" - GO111MODULE=on go test -v - -.PHONY: test-cover -test-cover: - @echo "==> Running Tests with coverage" - GO111MODULE=on go test -cover . diff --git a/vendor/github.com/Masterminds/sprig/v3/README.md b/vendor/github.com/Masterminds/sprig/v3/README.md deleted file mode 100644 index 3e22c60e1a..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# Sprig: Template functions for Go templates - -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/Masterminds/sprig/v3) -[![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/sprig)](https://goreportcard.com/report/github.com/Masterminds/sprig) -[![Stability: Sustained](https://masterminds.github.io/stability/sustained.svg)](https://masterminds.github.io/stability/sustained.html) -[![](https://github.com/Masterminds/sprig/workflows/Tests/badge.svg)](https://github.com/Masterminds/sprig/actions) - -The Go language comes with a [built-in template -language](http://golang.org/pkg/text/template/), but not -very many template functions. Sprig is a library that provides more than 100 commonly -used template functions. - -It is inspired by the template functions found in -[Twig](http://twig.sensiolabs.org/documentation) and in various -JavaScript libraries, such as [underscore.js](http://underscorejs.org/). - -## IMPORTANT NOTES - -Sprig leverages [mergo](https://github.com/imdario/mergo) to handle merges. In -its v0.3.9 release, there was a behavior change that impacts merging template -functions in sprig. It is currently recommended to use v0.3.10 or later of that package. -Using v0.3.9 will cause sprig tests to fail. - -## Package Versions - -There are two active major versions of the `sprig` package. - -* v3 is currently stable release series on the `master` branch. The Go API should - remain compatible with v2, the current stable version. Behavior change behind - some functions is the reason for the new major version. -* v2 is the previous stable release series. It has been more than three years since - the initial release of v2. You can read the documentation and see the code - on the [release-2](https://github.com/Masterminds/sprig/tree/release-2) branch. - Bug fixes to this major version will continue for some time. - -## Usage - -**Template developers**: Please use Sprig's [function documentation](http://masterminds.github.io/sprig/) for -detailed instructions and code snippets for the >100 template functions available. - -**Go developers**: If you'd like to include Sprig as a library in your program, -our API documentation is available [at GoDoc.org](http://godoc.org/github.com/Masterminds/sprig). - -For standard usage, read on. - -### Load the Sprig library - -To load the Sprig `FuncMap`: - -```go - -import ( - "github.com/Masterminds/sprig/v3" - "html/template" -) - -// This example illustrates that the FuncMap *must* be set before the -// templates themselves are loaded. -tpl := template.Must( - template.New("base").Funcs(sprig.FuncMap()).ParseGlob("*.html") -) - - -``` - -### Calling the functions inside of templates - -By convention, all functions are lowercase. This seems to follow the Go -idiom for template functions (as opposed to template methods, which are -TitleCase). For example, this: - -``` -{{ "hello!" | upper | repeat 5 }} -``` - -produces this: - -``` -HELLO!HELLO!HELLO!HELLO!HELLO! -``` - -## Principles Driving Our Function Selection - -We followed these principles to decide which functions to add and how to implement them: - -- Use template functions to build layout. The following - types of operations are within the domain of template functions: - - Formatting - - Layout - - Simple type conversions - - Utilities that assist in handling common formatting and layout needs (e.g. arithmetic) -- Template functions should not return errors unless there is no way to print - a sensible value. For example, converting a string to an integer should not - produce an error if conversion fails. Instead, it should display a default - value. -- Simple math is necessary for grid layouts, pagers, and so on. Complex math - (anything other than arithmetic) should be done outside of templates. -- Template functions only deal with the data passed into them. They never retrieve - data from a source. -- Finally, do not override core Go template functions. diff --git a/vendor/github.com/Masterminds/sprig/v3/crypto.go b/vendor/github.com/Masterminds/sprig/v3/crypto.go deleted file mode 100644 index 13a5cd5593..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/crypto.go +++ /dev/null @@ -1,653 +0,0 @@ -package sprig - -import ( - "bytes" - "crypto" - "crypto/aes" - "crypto/cipher" - "crypto/dsa" - "crypto/ecdsa" - "crypto/ed25519" - "crypto/elliptic" - "crypto/hmac" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "crypto/sha256" - "crypto/x509" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/base64" - "encoding/binary" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "hash/adler32" - "io" - "math/big" - "net" - "time" - - "strings" - - "github.com/google/uuid" - bcrypt_lib "golang.org/x/crypto/bcrypt" - "golang.org/x/crypto/scrypt" -) - -func sha256sum(input string) string { - hash := sha256.Sum256([]byte(input)) - return hex.EncodeToString(hash[:]) -} - -func sha1sum(input string) string { - hash := sha1.Sum([]byte(input)) - return hex.EncodeToString(hash[:]) -} - -func adler32sum(input string) string { - hash := adler32.Checksum([]byte(input)) - return fmt.Sprintf("%d", hash) -} - -func bcrypt(input string) string { - hash, err := bcrypt_lib.GenerateFromPassword([]byte(input), bcrypt_lib.DefaultCost) - if err != nil { - return fmt.Sprintf("failed to encrypt string with bcrypt: %s", err) - } - - return string(hash) -} - -func htpasswd(username string, password string) string { - if strings.Contains(username, ":") { - return fmt.Sprintf("invalid username: %s", username) - } - return fmt.Sprintf("%s:%s", username, bcrypt(password)) -} - -func randBytes(count int) (string, error) { - buf := make([]byte, count) - if _, err := rand.Read(buf); err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(buf), nil -} - -// uuidv4 provides a safe and secure UUID v4 implementation -func uuidv4() string { - return uuid.New().String() -} - -var masterPasswordSeed = "com.lyndir.masterpassword" - -var passwordTypeTemplates = map[string][][]byte{ - "maximum": {[]byte("anoxxxxxxxxxxxxxxxxx"), []byte("axxxxxxxxxxxxxxxxxno")}, - "long": {[]byte("CvcvnoCvcvCvcv"), []byte("CvcvCvcvnoCvcv"), []byte("CvcvCvcvCvcvno"), []byte("CvccnoCvcvCvcv"), []byte("CvccCvcvnoCvcv"), - []byte("CvccCvcvCvcvno"), []byte("CvcvnoCvccCvcv"), []byte("CvcvCvccnoCvcv"), []byte("CvcvCvccCvcvno"), []byte("CvcvnoCvcvCvcc"), - []byte("CvcvCvcvnoCvcc"), []byte("CvcvCvcvCvccno"), []byte("CvccnoCvccCvcv"), []byte("CvccCvccnoCvcv"), []byte("CvccCvccCvcvno"), - []byte("CvcvnoCvccCvcc"), []byte("CvcvCvccnoCvcc"), []byte("CvcvCvccCvccno"), []byte("CvccnoCvcvCvcc"), []byte("CvccCvcvnoCvcc"), - []byte("CvccCvcvCvccno")}, - "medium": {[]byte("CvcnoCvc"), []byte("CvcCvcno")}, - "short": {[]byte("Cvcn")}, - "basic": {[]byte("aaanaaan"), []byte("aannaaan"), []byte("aaannaaa")}, - "pin": {[]byte("nnnn")}, -} - -var templateCharacters = map[byte]string{ - 'V': "AEIOU", - 'C': "BCDFGHJKLMNPQRSTVWXYZ", - 'v': "aeiou", - 'c': "bcdfghjklmnpqrstvwxyz", - 'A': "AEIOUBCDFGHJKLMNPQRSTVWXYZ", - 'a': "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz", - 'n': "0123456789", - 'o': "@&%?,=[]_:-+*$#!'^~;()/.", - 'x': "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz0123456789!@#$%^&*()", -} - -func derivePassword(counter uint32, passwordType, password, user, site string) string { - var templates = passwordTypeTemplates[passwordType] - if templates == nil { - return fmt.Sprintf("cannot find password template %s", passwordType) - } - - var buffer bytes.Buffer - buffer.WriteString(masterPasswordSeed) - binary.Write(&buffer, binary.BigEndian, uint32(len(user))) - buffer.WriteString(user) - - salt := buffer.Bytes() - key, err := scrypt.Key([]byte(password), salt, 32768, 8, 2, 64) - if err != nil { - return fmt.Sprintf("failed to derive password: %s", err) - } - - buffer.Truncate(len(masterPasswordSeed)) - binary.Write(&buffer, binary.BigEndian, uint32(len(site))) - buffer.WriteString(site) - binary.Write(&buffer, binary.BigEndian, counter) - - var hmacv = hmac.New(sha256.New, key) - hmacv.Write(buffer.Bytes()) - var seed = hmacv.Sum(nil) - var temp = templates[int(seed[0])%len(templates)] - - buffer.Truncate(0) - for i, element := range temp { - passChars := templateCharacters[element] - passChar := passChars[int(seed[i+1])%len(passChars)] - buffer.WriteByte(passChar) - } - - return buffer.String() -} - -func generatePrivateKey(typ string) string { - var priv interface{} - var err error - switch typ { - case "", "rsa": - // good enough for government work - priv, err = rsa.GenerateKey(rand.Reader, 4096) - case "dsa": - key := new(dsa.PrivateKey) - // again, good enough for government work - if err = dsa.GenerateParameters(&key.Parameters, rand.Reader, dsa.L2048N256); err != nil { - return fmt.Sprintf("failed to generate dsa params: %s", err) - } - err = dsa.GenerateKey(key, rand.Reader) - priv = key - case "ecdsa": - // again, good enough for government work - priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - case "ed25519": - _, priv, err = ed25519.GenerateKey(rand.Reader) - default: - return "Unknown type " + typ - } - if err != nil { - return fmt.Sprintf("failed to generate private key: %s", err) - } - - return string(pem.EncodeToMemory(pemBlockForKey(priv))) -} - -// DSAKeyFormat stores the format for DSA keys. -// Used by pemBlockForKey -type DSAKeyFormat struct { - Version int - P, Q, G, Y, X *big.Int -} - -func pemBlockForKey(priv interface{}) *pem.Block { - switch k := priv.(type) { - case *rsa.PrivateKey: - return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)} - case *dsa.PrivateKey: - val := DSAKeyFormat{ - P: k.P, Q: k.Q, G: k.G, - Y: k.Y, X: k.X, - } - bytes, _ := asn1.Marshal(val) - return &pem.Block{Type: "DSA PRIVATE KEY", Bytes: bytes} - case *ecdsa.PrivateKey: - b, _ := x509.MarshalECPrivateKey(k) - return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b} - default: - // attempt PKCS#8 format for all other keys - b, err := x509.MarshalPKCS8PrivateKey(k) - if err != nil { - return nil - } - return &pem.Block{Type: "PRIVATE KEY", Bytes: b} - } -} - -func parsePrivateKeyPEM(pemBlock string) (crypto.PrivateKey, error) { - block, _ := pem.Decode([]byte(pemBlock)) - if block == nil { - return nil, errors.New("no PEM data in input") - } - - if block.Type == "PRIVATE KEY" { - priv, err := x509.ParsePKCS8PrivateKey(block.Bytes) - if err != nil { - return nil, fmt.Errorf("decoding PEM as PKCS#8: %s", err) - } - return priv, nil - } else if !strings.HasSuffix(block.Type, " PRIVATE KEY") { - return nil, fmt.Errorf("no private key data in PEM block of type %s", block.Type) - } - - switch block.Type[:len(block.Type)-12] { // strip " PRIVATE KEY" - case "RSA": - priv, err := x509.ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - return nil, fmt.Errorf("parsing RSA private key from PEM: %s", err) - } - return priv, nil - case "EC": - priv, err := x509.ParseECPrivateKey(block.Bytes) - if err != nil { - return nil, fmt.Errorf("parsing EC private key from PEM: %s", err) - } - return priv, nil - case "DSA": - var k DSAKeyFormat - _, err := asn1.Unmarshal(block.Bytes, &k) - if err != nil { - return nil, fmt.Errorf("parsing DSA private key from PEM: %s", err) - } - priv := &dsa.PrivateKey{ - PublicKey: dsa.PublicKey{ - Parameters: dsa.Parameters{ - P: k.P, Q: k.Q, G: k.G, - }, - Y: k.Y, - }, - X: k.X, - } - return priv, nil - default: - return nil, fmt.Errorf("invalid private key type %s", block.Type) - } -} - -func getPublicKey(priv crypto.PrivateKey) (crypto.PublicKey, error) { - switch k := priv.(type) { - case interface{ Public() crypto.PublicKey }: - return k.Public(), nil - case *dsa.PrivateKey: - return &k.PublicKey, nil - default: - return nil, fmt.Errorf("unable to get public key for type %T", priv) - } -} - -type certificate struct { - Cert string - Key string -} - -func buildCustomCertificate(b64cert string, b64key string) (certificate, error) { - crt := certificate{} - - cert, err := base64.StdEncoding.DecodeString(b64cert) - if err != nil { - return crt, errors.New("unable to decode base64 certificate") - } - - key, err := base64.StdEncoding.DecodeString(b64key) - if err != nil { - return crt, errors.New("unable to decode base64 private key") - } - - decodedCert, _ := pem.Decode(cert) - if decodedCert == nil { - return crt, errors.New("unable to decode certificate") - } - _, err = x509.ParseCertificate(decodedCert.Bytes) - if err != nil { - return crt, fmt.Errorf( - "error parsing certificate: decodedCert.Bytes: %s", - err, - ) - } - - _, err = parsePrivateKeyPEM(string(key)) - if err != nil { - return crt, fmt.Errorf( - "error parsing private key: %s", - err, - ) - } - - crt.Cert = string(cert) - crt.Key = string(key) - - return crt, nil -} - -func generateCertificateAuthority( - cn string, - daysValid int, -) (certificate, error) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return certificate{}, fmt.Errorf("error generating rsa key: %s", err) - } - - return generateCertificateAuthorityWithKeyInternal(cn, daysValid, priv) -} - -func generateCertificateAuthorityWithPEMKey( - cn string, - daysValid int, - privPEM string, -) (certificate, error) { - priv, err := parsePrivateKeyPEM(privPEM) - if err != nil { - return certificate{}, fmt.Errorf("parsing private key: %s", err) - } - return generateCertificateAuthorityWithKeyInternal(cn, daysValid, priv) -} - -func generateCertificateAuthorityWithKeyInternal( - cn string, - daysValid int, - priv crypto.PrivateKey, -) (certificate, error) { - ca := certificate{} - - template, err := getBaseCertTemplate(cn, nil, nil, daysValid) - if err != nil { - return ca, err - } - // Override KeyUsage and IsCA - template.KeyUsage = x509.KeyUsageKeyEncipherment | - x509.KeyUsageDigitalSignature | - x509.KeyUsageCertSign - template.IsCA = true - - ca.Cert, ca.Key, err = getCertAndKey(template, priv, template, priv) - - return ca, err -} - -func generateSelfSignedCertificate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, -) (certificate, error) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return certificate{}, fmt.Errorf("error generating rsa key: %s", err) - } - return generateSelfSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, priv) -} - -func generateSelfSignedCertificateWithPEMKey( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - privPEM string, -) (certificate, error) { - priv, err := parsePrivateKeyPEM(privPEM) - if err != nil { - return certificate{}, fmt.Errorf("parsing private key: %s", err) - } - return generateSelfSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, priv) -} - -func generateSelfSignedCertificateWithKeyInternal( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - priv crypto.PrivateKey, -) (certificate, error) { - cert := certificate{} - - template, err := getBaseCertTemplate(cn, ips, alternateDNS, daysValid) - if err != nil { - return cert, err - } - - cert.Cert, cert.Key, err = getCertAndKey(template, priv, template, priv) - - return cert, err -} - -func generateSignedCertificate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, -) (certificate, error) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return certificate{}, fmt.Errorf("error generating rsa key: %s", err) - } - return generateSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, ca, priv) -} - -func generateSignedCertificateWithPEMKey( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, - privPEM string, -) (certificate, error) { - priv, err := parsePrivateKeyPEM(privPEM) - if err != nil { - return certificate{}, fmt.Errorf("parsing private key: %s", err) - } - return generateSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, ca, priv) -} - -func generateSignedCertificateWithKeyInternal( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, - priv crypto.PrivateKey, -) (certificate, error) { - cert := certificate{} - - decodedSignerCert, _ := pem.Decode([]byte(ca.Cert)) - if decodedSignerCert == nil { - return cert, errors.New("unable to decode certificate") - } - signerCert, err := x509.ParseCertificate(decodedSignerCert.Bytes) - if err != nil { - return cert, fmt.Errorf( - "error parsing certificate: decodedSignerCert.Bytes: %s", - err, - ) - } - signerKey, err := parsePrivateKeyPEM(ca.Key) - if err != nil { - return cert, fmt.Errorf( - "error parsing private key: %s", - err, - ) - } - - template, err := getBaseCertTemplate(cn, ips, alternateDNS, daysValid) - if err != nil { - return cert, err - } - - cert.Cert, cert.Key, err = getCertAndKey( - template, - priv, - signerCert, - signerKey, - ) - - return cert, err -} - -func getCertAndKey( - template *x509.Certificate, - signeeKey crypto.PrivateKey, - parent *x509.Certificate, - signingKey crypto.PrivateKey, -) (string, string, error) { - signeePubKey, err := getPublicKey(signeeKey) - if err != nil { - return "", "", fmt.Errorf("error retrieving public key from signee key: %s", err) - } - derBytes, err := x509.CreateCertificate( - rand.Reader, - template, - parent, - signeePubKey, - signingKey, - ) - if err != nil { - return "", "", fmt.Errorf("error creating certificate: %s", err) - } - - certBuffer := bytes.Buffer{} - if err := pem.Encode( - &certBuffer, - &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}, - ); err != nil { - return "", "", fmt.Errorf("error pem-encoding certificate: %s", err) - } - - keyBuffer := bytes.Buffer{} - if err := pem.Encode( - &keyBuffer, - pemBlockForKey(signeeKey), - ); err != nil { - return "", "", fmt.Errorf("error pem-encoding key: %s", err) - } - - return certBuffer.String(), keyBuffer.String(), nil -} - -func getBaseCertTemplate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, -) (*x509.Certificate, error) { - ipAddresses, err := getNetIPs(ips) - if err != nil { - return nil, err - } - dnsNames, err := getAlternateDNSStrs(alternateDNS) - if err != nil { - return nil, err - } - serialNumberUpperBound := new(big.Int).Lsh(big.NewInt(1), 128) - serialNumber, err := rand.Int(rand.Reader, serialNumberUpperBound) - if err != nil { - return nil, err - } - return &x509.Certificate{ - SerialNumber: serialNumber, - Subject: pkix.Name{ - CommonName: cn, - }, - IPAddresses: ipAddresses, - DNSNames: dnsNames, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * time.Duration(daysValid)), - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, - ExtKeyUsage: []x509.ExtKeyUsage{ - x509.ExtKeyUsageServerAuth, - x509.ExtKeyUsageClientAuth, - }, - BasicConstraintsValid: true, - }, nil -} - -func getNetIPs(ips []interface{}) ([]net.IP, error) { - if ips == nil { - return []net.IP{}, nil - } - var ipStr string - var ok bool - var netIP net.IP - netIPs := make([]net.IP, len(ips)) - for i, ip := range ips { - ipStr, ok = ip.(string) - if !ok { - return nil, fmt.Errorf("error parsing ip: %v is not a string", ip) - } - netIP = net.ParseIP(ipStr) - if netIP == nil { - return nil, fmt.Errorf("error parsing ip: %s", ipStr) - } - netIPs[i] = netIP - } - return netIPs, nil -} - -func getAlternateDNSStrs(alternateDNS []interface{}) ([]string, error) { - if alternateDNS == nil { - return []string{}, nil - } - var dnsStr string - var ok bool - alternateDNSStrs := make([]string, len(alternateDNS)) - for i, dns := range alternateDNS { - dnsStr, ok = dns.(string) - if !ok { - return nil, fmt.Errorf( - "error processing alternate dns name: %v is not a string", - dns, - ) - } - alternateDNSStrs[i] = dnsStr - } - return alternateDNSStrs, nil -} - -func encryptAES(password string, plaintext string) (string, error) { - if plaintext == "" { - return "", nil - } - - key := make([]byte, 32) - copy(key, []byte(password)) - block, err := aes.NewCipher(key) - if err != nil { - return "", err - } - - content := []byte(plaintext) - blockSize := block.BlockSize() - padding := blockSize - len(content)%blockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - content = append(content, padtext...) - - ciphertext := make([]byte, aes.BlockSize+len(content)) - - iv := ciphertext[:aes.BlockSize] - if _, err := io.ReadFull(rand.Reader, iv); err != nil { - return "", err - } - - mode := cipher.NewCBCEncrypter(block, iv) - mode.CryptBlocks(ciphertext[aes.BlockSize:], content) - - return base64.StdEncoding.EncodeToString(ciphertext), nil -} - -func decryptAES(password string, crypt64 string) (string, error) { - if crypt64 == "" { - return "", nil - } - - key := make([]byte, 32) - copy(key, []byte(password)) - - crypt, err := base64.StdEncoding.DecodeString(crypt64) - if err != nil { - return "", err - } - - block, err := aes.NewCipher(key) - if err != nil { - return "", err - } - - iv := crypt[:aes.BlockSize] - crypt = crypt[aes.BlockSize:] - decrypted := make([]byte, len(crypt)) - mode := cipher.NewCBCDecrypter(block, iv) - mode.CryptBlocks(decrypted, crypt) - - return string(decrypted[:len(decrypted)-int(decrypted[len(decrypted)-1])]), nil -} diff --git a/vendor/github.com/Masterminds/sprig/v3/date.go b/vendor/github.com/Masterminds/sprig/v3/date.go deleted file mode 100644 index ed022ddaca..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/date.go +++ /dev/null @@ -1,152 +0,0 @@ -package sprig - -import ( - "strconv" - "time" -) - -// Given a format and a date, format the date string. -// -// Date can be a `time.Time` or an `int, int32, int64`. -// In the later case, it is treated as seconds since UNIX -// epoch. -func date(fmt string, date interface{}) string { - return dateInZone(fmt, date, "Local") -} - -func htmlDate(date interface{}) string { - return dateInZone("2006-01-02", date, "Local") -} - -func htmlDateInZone(date interface{}, zone string) string { - return dateInZone("2006-01-02", date, zone) -} - -func dateInZone(fmt string, date interface{}, zone string) string { - var t time.Time - switch date := date.(type) { - default: - t = time.Now() - case time.Time: - t = date - case *time.Time: - t = *date - case int64: - t = time.Unix(date, 0) - case int: - t = time.Unix(int64(date), 0) - case int32: - t = time.Unix(int64(date), 0) - } - - loc, err := time.LoadLocation(zone) - if err != nil { - loc, _ = time.LoadLocation("UTC") - } - - return t.In(loc).Format(fmt) -} - -func dateModify(fmt string, date time.Time) time.Time { - d, err := time.ParseDuration(fmt) - if err != nil { - return date - } - return date.Add(d) -} - -func mustDateModify(fmt string, date time.Time) (time.Time, error) { - d, err := time.ParseDuration(fmt) - if err != nil { - return time.Time{}, err - } - return date.Add(d), nil -} - -func dateAgo(date interface{}) string { - var t time.Time - - switch date := date.(type) { - default: - t = time.Now() - case time.Time: - t = date - case int64: - t = time.Unix(date, 0) - case int: - t = time.Unix(int64(date), 0) - } - // Drop resolution to seconds - duration := time.Since(t).Round(time.Second) - return duration.String() -} - -func duration(sec interface{}) string { - var n int64 - switch value := sec.(type) { - default: - n = 0 - case string: - n, _ = strconv.ParseInt(value, 10, 64) - case int64: - n = value - } - return (time.Duration(n) * time.Second).String() -} - -func durationRound(duration interface{}) string { - var d time.Duration - switch duration := duration.(type) { - default: - d = 0 - case string: - d, _ = time.ParseDuration(duration) - case int64: - d = time.Duration(duration) - case time.Time: - d = time.Since(duration) - } - - u := uint64(d) - neg := d < 0 - if neg { - u = -u - } - - var ( - year = uint64(time.Hour) * 24 * 365 - month = uint64(time.Hour) * 24 * 30 - day = uint64(time.Hour) * 24 - hour = uint64(time.Hour) - minute = uint64(time.Minute) - second = uint64(time.Second) - ) - switch { - case u > year: - return strconv.FormatUint(u/year, 10) + "y" - case u > month: - return strconv.FormatUint(u/month, 10) + "mo" - case u > day: - return strconv.FormatUint(u/day, 10) + "d" - case u > hour: - return strconv.FormatUint(u/hour, 10) + "h" - case u > minute: - return strconv.FormatUint(u/minute, 10) + "m" - case u > second: - return strconv.FormatUint(u/second, 10) + "s" - } - return "0s" -} - -func toDate(fmt, str string) time.Time { - t, _ := time.ParseInLocation(fmt, str, time.Local) - return t -} - -func mustToDate(fmt, str string) (time.Time, error) { - return time.ParseInLocation(fmt, str, time.Local) -} - -func unixEpoch(date time.Time) string { - return strconv.FormatInt(date.Unix(), 10) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/defaults.go b/vendor/github.com/Masterminds/sprig/v3/defaults.go deleted file mode 100644 index b9f979666d..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/defaults.go +++ /dev/null @@ -1,163 +0,0 @@ -package sprig - -import ( - "bytes" - "encoding/json" - "math/rand" - "reflect" - "strings" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -// dfault checks whether `given` is set, and returns default if not set. -// -// This returns `d` if `given` appears not to be set, and `given` otherwise. -// -// For numeric types 0 is unset. -// For strings, maps, arrays, and slices, len() = 0 is considered unset. -// For bool, false is unset. -// Structs are never considered unset. -// -// For everything else, including pointers, a nil value is unset. -func dfault(d interface{}, given ...interface{}) interface{} { - - if empty(given) || empty(given[0]) { - return d - } - return given[0] -} - -// empty returns true if the given value has the zero value for its type. -func empty(given interface{}) bool { - g := reflect.ValueOf(given) - if !g.IsValid() { - return true - } - - // Basically adapted from text/template.isTrue - switch g.Kind() { - default: - return g.IsNil() - case reflect.Array, reflect.Slice, reflect.Map, reflect.String: - return g.Len() == 0 - case reflect.Bool: - return !g.Bool() - case reflect.Complex64, reflect.Complex128: - return g.Complex() == 0 - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return g.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return g.Uint() == 0 - case reflect.Float32, reflect.Float64: - return g.Float() == 0 - case reflect.Struct: - return false - } -} - -// coalesce returns the first non-empty value. -func coalesce(v ...interface{}) interface{} { - for _, val := range v { - if !empty(val) { - return val - } - } - return nil -} - -// all returns true if empty(x) is false for all values x in the list. -// If the list is empty, return true. -func all(v ...interface{}) bool { - for _, val := range v { - if empty(val) { - return false - } - } - return true -} - -// any returns true if empty(x) is false for any x in the list. -// If the list is empty, return false. -func any(v ...interface{}) bool { - for _, val := range v { - if !empty(val) { - return true - } - } - return false -} - -// fromJson decodes JSON into a structured value, ignoring errors. -func fromJson(v string) interface{} { - output, _ := mustFromJson(v) - return output -} - -// mustFromJson decodes JSON into a structured value, returning errors. -func mustFromJson(v string) (interface{}, error) { - var output interface{} - err := json.Unmarshal([]byte(v), &output) - return output, err -} - -// toJson encodes an item into a JSON string -func toJson(v interface{}) string { - output, _ := json.Marshal(v) - return string(output) -} - -func mustToJson(v interface{}) (string, error) { - output, err := json.Marshal(v) - if err != nil { - return "", err - } - return string(output), nil -} - -// toPrettyJson encodes an item into a pretty (indented) JSON string -func toPrettyJson(v interface{}) string { - output, _ := json.MarshalIndent(v, "", " ") - return string(output) -} - -func mustToPrettyJson(v interface{}) (string, error) { - output, err := json.MarshalIndent(v, "", " ") - if err != nil { - return "", err - } - return string(output), nil -} - -// toRawJson encodes an item into a JSON string with no escaping of HTML characters. -func toRawJson(v interface{}) string { - output, err := mustToRawJson(v) - if err != nil { - panic(err) - } - return string(output) -} - -// mustToRawJson encodes an item into a JSON string with no escaping of HTML characters. -func mustToRawJson(v interface{}) (string, error) { - buf := new(bytes.Buffer) - enc := json.NewEncoder(buf) - enc.SetEscapeHTML(false) - err := enc.Encode(&v) - if err != nil { - return "", err - } - return strings.TrimSuffix(buf.String(), "\n"), nil -} - -// ternary returns the first value if the last value is true, otherwise returns the second value. -func ternary(vt interface{}, vf interface{}, v bool) interface{} { - if v { - return vt - } - - return vf -} diff --git a/vendor/github.com/Masterminds/sprig/v3/dict.go b/vendor/github.com/Masterminds/sprig/v3/dict.go deleted file mode 100644 index ade8896984..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/dict.go +++ /dev/null @@ -1,174 +0,0 @@ -package sprig - -import ( - "github.com/imdario/mergo" - "github.com/mitchellh/copystructure" -) - -func get(d map[string]interface{}, key string) interface{} { - if val, ok := d[key]; ok { - return val - } - return "" -} - -func set(d map[string]interface{}, key string, value interface{}) map[string]interface{} { - d[key] = value - return d -} - -func unset(d map[string]interface{}, key string) map[string]interface{} { - delete(d, key) - return d -} - -func hasKey(d map[string]interface{}, key string) bool { - _, ok := d[key] - return ok -} - -func pluck(key string, d ...map[string]interface{}) []interface{} { - res := []interface{}{} - for _, dict := range d { - if val, ok := dict[key]; ok { - res = append(res, val) - } - } - return res -} - -func keys(dicts ...map[string]interface{}) []string { - k := []string{} - for _, dict := range dicts { - for key := range dict { - k = append(k, key) - } - } - return k -} - -func pick(dict map[string]interface{}, keys ...string) map[string]interface{} { - res := map[string]interface{}{} - for _, k := range keys { - if v, ok := dict[k]; ok { - res[k] = v - } - } - return res -} - -func omit(dict map[string]interface{}, keys ...string) map[string]interface{} { - res := map[string]interface{}{} - - omit := make(map[string]bool, len(keys)) - for _, k := range keys { - omit[k] = true - } - - for k, v := range dict { - if _, ok := omit[k]; !ok { - res[k] = v - } - } - return res -} - -func dict(v ...interface{}) map[string]interface{} { - dict := map[string]interface{}{} - lenv := len(v) - for i := 0; i < lenv; i += 2 { - key := strval(v[i]) - if i+1 >= lenv { - dict[key] = "" - continue - } - dict[key] = v[i+1] - } - return dict -} - -func merge(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} { - for _, src := range srcs { - if err := mergo.Merge(&dst, src); err != nil { - // Swallow errors inside of a template. - return "" - } - } - return dst -} - -func mustMerge(dst map[string]interface{}, srcs ...map[string]interface{}) (interface{}, error) { - for _, src := range srcs { - if err := mergo.Merge(&dst, src); err != nil { - return nil, err - } - } - return dst, nil -} - -func mergeOverwrite(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} { - for _, src := range srcs { - if err := mergo.MergeWithOverwrite(&dst, src); err != nil { - // Swallow errors inside of a template. - return "" - } - } - return dst -} - -func mustMergeOverwrite(dst map[string]interface{}, srcs ...map[string]interface{}) (interface{}, error) { - for _, src := range srcs { - if err := mergo.MergeWithOverwrite(&dst, src); err != nil { - return nil, err - } - } - return dst, nil -} - -func values(dict map[string]interface{}) []interface{} { - values := []interface{}{} - for _, value := range dict { - values = append(values, value) - } - - return values -} - -func deepCopy(i interface{}) interface{} { - c, err := mustDeepCopy(i) - if err != nil { - panic("deepCopy error: " + err.Error()) - } - - return c -} - -func mustDeepCopy(i interface{}) (interface{}, error) { - return copystructure.Copy(i) -} - -func dig(ps ...interface{}) (interface{}, error) { - if len(ps) < 3 { - panic("dig needs at least three arguments") - } - dict := ps[len(ps)-1].(map[string]interface{}) - def := ps[len(ps)-2] - ks := make([]string, len(ps)-2) - for i := 0; i < len(ks); i++ { - ks[i] = ps[i].(string) - } - - return digFromDict(dict, def, ks) -} - -func digFromDict(dict map[string]interface{}, d interface{}, ks []string) (interface{}, error) { - k, ns := ks[0], ks[1:len(ks)] - step, has := dict[k] - if !has { - return d, nil - } - if len(ns) == 0 { - return step, nil - } - return digFromDict(step.(map[string]interface{}), d, ns) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/doc.go b/vendor/github.com/Masterminds/sprig/v3/doc.go deleted file mode 100644 index aabb9d4489..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Package sprig provides template functions for Go. - -This package contains a number of utility functions for working with data -inside of Go `html/template` and `text/template` files. - -To add these functions, use the `template.Funcs()` method: - - t := templates.New("foo").Funcs(sprig.FuncMap()) - -Note that you should add the function map before you parse any template files. - - In several cases, Sprig reverses the order of arguments from the way they - appear in the standard library. This is to make it easier to pipe - arguments into functions. - -See http://masterminds.github.io/sprig/ for more detailed documentation on each of the available functions. -*/ -package sprig diff --git a/vendor/github.com/Masterminds/sprig/v3/functions.go b/vendor/github.com/Masterminds/sprig/v3/functions.go deleted file mode 100644 index 57fcec1d9e..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/functions.go +++ /dev/null @@ -1,382 +0,0 @@ -package sprig - -import ( - "errors" - "html/template" - "math/rand" - "os" - "path" - "path/filepath" - "reflect" - "strconv" - "strings" - ttemplate "text/template" - "time" - - util "github.com/Masterminds/goutils" - "github.com/huandu/xstrings" - "github.com/shopspring/decimal" -) - -// FuncMap produces the function map. -// -// Use this to pass the functions into the template engine: -// -// tpl := template.New("foo").Funcs(sprig.FuncMap())) -// -func FuncMap() template.FuncMap { - return HtmlFuncMap() -} - -// HermeticTxtFuncMap returns a 'text/template'.FuncMap with only repeatable functions. -func HermeticTxtFuncMap() ttemplate.FuncMap { - r := TxtFuncMap() - for _, name := range nonhermeticFunctions { - delete(r, name) - } - return r -} - -// HermeticHtmlFuncMap returns an 'html/template'.Funcmap with only repeatable functions. -func HermeticHtmlFuncMap() template.FuncMap { - r := HtmlFuncMap() - for _, name := range nonhermeticFunctions { - delete(r, name) - } - return r -} - -// TxtFuncMap returns a 'text/template'.FuncMap -func TxtFuncMap() ttemplate.FuncMap { - return ttemplate.FuncMap(GenericFuncMap()) -} - -// HtmlFuncMap returns an 'html/template'.Funcmap -func HtmlFuncMap() template.FuncMap { - return template.FuncMap(GenericFuncMap()) -} - -// GenericFuncMap returns a copy of the basic function map as a map[string]interface{}. -func GenericFuncMap() map[string]interface{} { - gfm := make(map[string]interface{}, len(genericMap)) - for k, v := range genericMap { - gfm[k] = v - } - return gfm -} - -// These functions are not guaranteed to evaluate to the same result for given input, because they -// refer to the environment or global state. -var nonhermeticFunctions = []string{ - // Date functions - "date", - "date_in_zone", - "date_modify", - "now", - "htmlDate", - "htmlDateInZone", - "dateInZone", - "dateModify", - - // Strings - "randAlphaNum", - "randAlpha", - "randAscii", - "randNumeric", - "randBytes", - "uuidv4", - - // OS - "env", - "expandenv", - - // Network - "getHostByName", -} - -var genericMap = map[string]interface{}{ - "hello": func() string { return "Hello!" }, - - // Date functions - "ago": dateAgo, - "date": date, - "date_in_zone": dateInZone, - "date_modify": dateModify, - "dateInZone": dateInZone, - "dateModify": dateModify, - "duration": duration, - "durationRound": durationRound, - "htmlDate": htmlDate, - "htmlDateInZone": htmlDateInZone, - "must_date_modify": mustDateModify, - "mustDateModify": mustDateModify, - "mustToDate": mustToDate, - "now": time.Now, - "toDate": toDate, - "unixEpoch": unixEpoch, - - // Strings - "abbrev": abbrev, - "abbrevboth": abbrevboth, - "trunc": trunc, - "trim": strings.TrimSpace, - "upper": strings.ToUpper, - "lower": strings.ToLower, - "title": strings.Title, - "untitle": untitle, - "substr": substring, - // Switch order so that "foo" | repeat 5 - "repeat": func(count int, str string) string { return strings.Repeat(str, count) }, - // Deprecated: Use trimAll. - "trimall": func(a, b string) string { return strings.Trim(b, a) }, - // Switch order so that "$foo" | trimall "$" - "trimAll": func(a, b string) string { return strings.Trim(b, a) }, - "trimSuffix": func(a, b string) string { return strings.TrimSuffix(b, a) }, - "trimPrefix": func(a, b string) string { return strings.TrimPrefix(b, a) }, - "nospace": util.DeleteWhiteSpace, - "initials": initials, - "randAlphaNum": randAlphaNumeric, - "randAlpha": randAlpha, - "randAscii": randAscii, - "randNumeric": randNumeric, - "swapcase": util.SwapCase, - "shuffle": xstrings.Shuffle, - "snakecase": xstrings.ToSnakeCase, - "camelcase": xstrings.ToCamelCase, - "kebabcase": xstrings.ToKebabCase, - "wrap": func(l int, s string) string { return util.Wrap(s, l) }, - "wrapWith": func(l int, sep, str string) string { return util.WrapCustom(str, l, sep, true) }, - // Switch order so that "foobar" | contains "foo" - "contains": func(substr string, str string) bool { return strings.Contains(str, substr) }, - "hasPrefix": func(substr string, str string) bool { return strings.HasPrefix(str, substr) }, - "hasSuffix": func(substr string, str string) bool { return strings.HasSuffix(str, substr) }, - "quote": quote, - "squote": squote, - "cat": cat, - "indent": indent, - "nindent": nindent, - "replace": replace, - "plural": plural, - "sha1sum": sha1sum, - "sha256sum": sha256sum, - "adler32sum": adler32sum, - "toString": strval, - - // Wrap Atoi to stop errors. - "atoi": func(a string) int { i, _ := strconv.Atoi(a); return i }, - "int64": toInt64, - "int": toInt, - "float64": toFloat64, - "seq": seq, - "toDecimal": toDecimal, - - //"gt": func(a, b int) bool {return a > b}, - //"gte": func(a, b int) bool {return a >= b}, - //"lt": func(a, b int) bool {return a < b}, - //"lte": func(a, b int) bool {return a <= b}, - - // split "/" foo/bar returns map[int]string{0: foo, 1: bar} - "split": split, - "splitList": func(sep, orig string) []string { return strings.Split(orig, sep) }, - // splitn "/" foo/bar/fuu returns map[int]string{0: foo, 1: bar/fuu} - "splitn": splitn, - "toStrings": strslice, - - "until": until, - "untilStep": untilStep, - - // VERY basic arithmetic. - "add1": func(i interface{}) int64 { return toInt64(i) + 1 }, - "add": func(i ...interface{}) int64 { - var a int64 = 0 - for _, b := range i { - a += toInt64(b) - } - return a - }, - "sub": func(a, b interface{}) int64 { return toInt64(a) - toInt64(b) }, - "div": func(a, b interface{}) int64 { return toInt64(a) / toInt64(b) }, - "mod": func(a, b interface{}) int64 { return toInt64(a) % toInt64(b) }, - "mul": func(a interface{}, v ...interface{}) int64 { - val := toInt64(a) - for _, b := range v { - val = val * toInt64(b) - } - return val - }, - "randInt": func(min, max int) int { return rand.Intn(max-min) + min }, - "add1f": func(i interface{}) float64 { - return execDecimalOp(i, []interface{}{1}, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Add(d2) }) - }, - "addf": func(i ...interface{}) float64 { - a := interface{}(float64(0)) - return execDecimalOp(a, i, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Add(d2) }) - }, - "subf": func(a interface{}, v ...interface{}) float64 { - return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Sub(d2) }) - }, - "divf": func(a interface{}, v ...interface{}) float64 { - return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Div(d2) }) - }, - "mulf": func(a interface{}, v ...interface{}) float64 { - return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Mul(d2) }) - }, - "biggest": max, - "max": max, - "min": min, - "maxf": maxf, - "minf": minf, - "ceil": ceil, - "floor": floor, - "round": round, - - // string slices. Note that we reverse the order b/c that's better - // for template processing. - "join": join, - "sortAlpha": sortAlpha, - - // Defaults - "default": dfault, - "empty": empty, - "coalesce": coalesce, - "all": all, - "any": any, - "compact": compact, - "mustCompact": mustCompact, - "fromJson": fromJson, - "toJson": toJson, - "toPrettyJson": toPrettyJson, - "toRawJson": toRawJson, - "mustFromJson": mustFromJson, - "mustToJson": mustToJson, - "mustToPrettyJson": mustToPrettyJson, - "mustToRawJson": mustToRawJson, - "ternary": ternary, - "deepCopy": deepCopy, - "mustDeepCopy": mustDeepCopy, - - // Reflection - "typeOf": typeOf, - "typeIs": typeIs, - "typeIsLike": typeIsLike, - "kindOf": kindOf, - "kindIs": kindIs, - "deepEqual": reflect.DeepEqual, - - // OS: - "env": os.Getenv, - "expandenv": os.ExpandEnv, - - // Network: - "getHostByName": getHostByName, - - // Paths: - "base": path.Base, - "dir": path.Dir, - "clean": path.Clean, - "ext": path.Ext, - "isAbs": path.IsAbs, - - // Filepaths: - "osBase": filepath.Base, - "osClean": filepath.Clean, - "osDir": filepath.Dir, - "osExt": filepath.Ext, - "osIsAbs": filepath.IsAbs, - - // Encoding: - "b64enc": base64encode, - "b64dec": base64decode, - "b32enc": base32encode, - "b32dec": base32decode, - - // Data Structures: - "tuple": list, // FIXME: with the addition of append/prepend these are no longer immutable. - "list": list, - "dict": dict, - "get": get, - "set": set, - "unset": unset, - "hasKey": hasKey, - "pluck": pluck, - "keys": keys, - "pick": pick, - "omit": omit, - "merge": merge, - "mergeOverwrite": mergeOverwrite, - "mustMerge": mustMerge, - "mustMergeOverwrite": mustMergeOverwrite, - "values": values, - - "append": push, "push": push, - "mustAppend": mustPush, "mustPush": mustPush, - "prepend": prepend, - "mustPrepend": mustPrepend, - "first": first, - "mustFirst": mustFirst, - "rest": rest, - "mustRest": mustRest, - "last": last, - "mustLast": mustLast, - "initial": initial, - "mustInitial": mustInitial, - "reverse": reverse, - "mustReverse": mustReverse, - "uniq": uniq, - "mustUniq": mustUniq, - "without": without, - "mustWithout": mustWithout, - "has": has, - "mustHas": mustHas, - "slice": slice, - "mustSlice": mustSlice, - "concat": concat, - "dig": dig, - "chunk": chunk, - "mustChunk": mustChunk, - - // Crypto: - "bcrypt": bcrypt, - "htpasswd": htpasswd, - "genPrivateKey": generatePrivateKey, - "derivePassword": derivePassword, - "buildCustomCert": buildCustomCertificate, - "genCA": generateCertificateAuthority, - "genCAWithKey": generateCertificateAuthorityWithPEMKey, - "genSelfSignedCert": generateSelfSignedCertificate, - "genSelfSignedCertWithKey": generateSelfSignedCertificateWithPEMKey, - "genSignedCert": generateSignedCertificate, - "genSignedCertWithKey": generateSignedCertificateWithPEMKey, - "encryptAES": encryptAES, - "decryptAES": decryptAES, - "randBytes": randBytes, - - // UUIDs: - "uuidv4": uuidv4, - - // SemVer: - "semver": semver, - "semverCompare": semverCompare, - - // Flow Control: - "fail": func(msg string) (string, error) { return "", errors.New(msg) }, - - // Regex - "regexMatch": regexMatch, - "mustRegexMatch": mustRegexMatch, - "regexFindAll": regexFindAll, - "mustRegexFindAll": mustRegexFindAll, - "regexFind": regexFind, - "mustRegexFind": mustRegexFind, - "regexReplaceAll": regexReplaceAll, - "mustRegexReplaceAll": mustRegexReplaceAll, - "regexReplaceAllLiteral": regexReplaceAllLiteral, - "mustRegexReplaceAllLiteral": mustRegexReplaceAllLiteral, - "regexSplit": regexSplit, - "mustRegexSplit": mustRegexSplit, - "regexQuoteMeta": regexQuoteMeta, - - // URLs: - "urlParse": urlParse, - "urlJoin": urlJoin, -} diff --git a/vendor/github.com/Masterminds/sprig/v3/list.go b/vendor/github.com/Masterminds/sprig/v3/list.go deleted file mode 100644 index ca0fbb7893..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/list.go +++ /dev/null @@ -1,464 +0,0 @@ -package sprig - -import ( - "fmt" - "math" - "reflect" - "sort" -) - -// Reflection is used in these functions so that slices and arrays of strings, -// ints, and other types not implementing []interface{} can be worked with. -// For example, this is useful if you need to work on the output of regexs. - -func list(v ...interface{}) []interface{} { - return v -} - -func push(list interface{}, v interface{}) []interface{} { - l, err := mustPush(list, v) - if err != nil { - panic(err) - } - - return l -} - -func mustPush(list interface{}, v interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[i] = l2.Index(i).Interface() - } - - return append(nl, v), nil - - default: - return nil, fmt.Errorf("Cannot push on type %s", tp) - } -} - -func prepend(list interface{}, v interface{}) []interface{} { - l, err := mustPrepend(list, v) - if err != nil { - panic(err) - } - - return l -} - -func mustPrepend(list interface{}, v interface{}) ([]interface{}, error) { - //return append([]interface{}{v}, list...) - - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[i] = l2.Index(i).Interface() - } - - return append([]interface{}{v}, nl...), nil - - default: - return nil, fmt.Errorf("Cannot prepend on type %s", tp) - } -} - -func chunk(size int, list interface{}) [][]interface{} { - l, err := mustChunk(size, list) - if err != nil { - panic(err) - } - - return l -} - -func mustChunk(size int, list interface{}) ([][]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - - cs := int(math.Floor(float64(l-1)/float64(size)) + 1) - nl := make([][]interface{}, cs) - - for i := 0; i < cs; i++ { - clen := size - if i == cs-1 { - clen = int(math.Floor(math.Mod(float64(l), float64(size)))) - if clen == 0 { - clen = size - } - } - - nl[i] = make([]interface{}, clen) - - for j := 0; j < clen; j++ { - ix := i*size + j - nl[i][j] = l2.Index(ix).Interface() - } - } - - return nl, nil - - default: - return nil, fmt.Errorf("Cannot chunk type %s", tp) - } -} - -func last(list interface{}) interface{} { - l, err := mustLast(list) - if err != nil { - panic(err) - } - - return l -} - -func mustLast(list interface{}) (interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - return l2.Index(l - 1).Interface(), nil - default: - return nil, fmt.Errorf("Cannot find last on type %s", tp) - } -} - -func first(list interface{}) interface{} { - l, err := mustFirst(list) - if err != nil { - panic(err) - } - - return l -} - -func mustFirst(list interface{}) (interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - return l2.Index(0).Interface(), nil - default: - return nil, fmt.Errorf("Cannot find first on type %s", tp) - } -} - -func rest(list interface{}) []interface{} { - l, err := mustRest(list) - if err != nil { - panic(err) - } - - return l -} - -func mustRest(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - nl := make([]interface{}, l-1) - for i := 1; i < l; i++ { - nl[i-1] = l2.Index(i).Interface() - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot find rest on type %s", tp) - } -} - -func initial(list interface{}) []interface{} { - l, err := mustInitial(list) - if err != nil { - panic(err) - } - - return l -} - -func mustInitial(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - nl := make([]interface{}, l-1) - for i := 0; i < l-1; i++ { - nl[i] = l2.Index(i).Interface() - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot find initial on type %s", tp) - } -} - -func sortAlpha(list interface{}) []string { - k := reflect.Indirect(reflect.ValueOf(list)).Kind() - switch k { - case reflect.Slice, reflect.Array: - a := strslice(list) - s := sort.StringSlice(a) - s.Sort() - return s - } - return []string{strval(list)} -} - -func reverse(v interface{}) []interface{} { - l, err := mustReverse(v) - if err != nil { - panic(err) - } - - return l -} - -func mustReverse(v interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(v).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(v) - - l := l2.Len() - // We do not sort in place because the incoming array should not be altered. - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[l-i-1] = l2.Index(i).Interface() - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot find reverse on type %s", tp) - } -} - -func compact(list interface{}) []interface{} { - l, err := mustCompact(list) - if err != nil { - panic(err) - } - - return l -} - -func mustCompact(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !empty(item) { - nl = append(nl, item) - } - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot compact on type %s", tp) - } -} - -func uniq(list interface{}) []interface{} { - l, err := mustUniq(list) - if err != nil { - panic(err) - } - - return l -} - -func mustUniq(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - dest := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !inList(dest, item) { - dest = append(dest, item) - } - } - - return dest, nil - default: - return nil, fmt.Errorf("Cannot find uniq on type %s", tp) - } -} - -func inList(haystack []interface{}, needle interface{}) bool { - for _, h := range haystack { - if reflect.DeepEqual(needle, h) { - return true - } - } - return false -} - -func without(list interface{}, omit ...interface{}) []interface{} { - l, err := mustWithout(list, omit...) - if err != nil { - panic(err) - } - - return l -} - -func mustWithout(list interface{}, omit ...interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - res := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !inList(omit, item) { - res = append(res, item) - } - } - - return res, nil - default: - return nil, fmt.Errorf("Cannot find without on type %s", tp) - } -} - -func has(needle interface{}, haystack interface{}) bool { - l, err := mustHas(needle, haystack) - if err != nil { - panic(err) - } - - return l -} - -func mustHas(needle interface{}, haystack interface{}) (bool, error) { - if haystack == nil { - return false, nil - } - tp := reflect.TypeOf(haystack).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(haystack) - var item interface{} - l := l2.Len() - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if reflect.DeepEqual(needle, item) { - return true, nil - } - } - - return false, nil - default: - return false, fmt.Errorf("Cannot find has on type %s", tp) - } -} - -// $list := [1, 2, 3, 4, 5] -// slice $list -> list[0:5] = list[:] -// slice $list 0 3 -> list[0:3] = list[:3] -// slice $list 3 5 -> list[3:5] -// slice $list 3 -> list[3:5] = list[3:] -func slice(list interface{}, indices ...interface{}) interface{} { - l, err := mustSlice(list, indices...) - if err != nil { - panic(err) - } - - return l -} - -func mustSlice(list interface{}, indices ...interface{}) (interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - var start, end int - if len(indices) > 0 { - start = toInt(indices[0]) - } - if len(indices) < 2 { - end = l - } else { - end = toInt(indices[1]) - } - - return l2.Slice(start, end).Interface(), nil - default: - return nil, fmt.Errorf("list should be type of slice or array but %s", tp) - } -} - -func concat(lists ...interface{}) interface{} { - var res []interface{} - for _, list := range lists { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - for i := 0; i < l2.Len(); i++ { - res = append(res, l2.Index(i).Interface()) - } - default: - panic(fmt.Sprintf("Cannot concat type %s as list", tp)) - } - } - return res -} diff --git a/vendor/github.com/Masterminds/sprig/v3/network.go b/vendor/github.com/Masterminds/sprig/v3/network.go deleted file mode 100644 index 108d78a946..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/network.go +++ /dev/null @@ -1,12 +0,0 @@ -package sprig - -import ( - "math/rand" - "net" -) - -func getHostByName(name string) string { - addrs, _ := net.LookupHost(name) - //TODO: add error handing when release v3 comes out - return addrs[rand.Intn(len(addrs))] -} diff --git a/vendor/github.com/Masterminds/sprig/v3/numeric.go b/vendor/github.com/Masterminds/sprig/v3/numeric.go deleted file mode 100644 index f68e4182ee..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/numeric.go +++ /dev/null @@ -1,186 +0,0 @@ -package sprig - -import ( - "fmt" - "math" - "strconv" - "strings" - - "github.com/spf13/cast" - "github.com/shopspring/decimal" -) - -// toFloat64 converts 64-bit floats -func toFloat64(v interface{}) float64 { - return cast.ToFloat64(v) -} - -func toInt(v interface{}) int { - return cast.ToInt(v) -} - -// toInt64 converts integer types to 64-bit integers -func toInt64(v interface{}) int64 { - return cast.ToInt64(v) -} - -func max(a interface{}, i ...interface{}) int64 { - aa := toInt64(a) - for _, b := range i { - bb := toInt64(b) - if bb > aa { - aa = bb - } - } - return aa -} - -func maxf(a interface{}, i ...interface{}) float64 { - aa := toFloat64(a) - for _, b := range i { - bb := toFloat64(b) - aa = math.Max(aa, bb) - } - return aa -} - -func min(a interface{}, i ...interface{}) int64 { - aa := toInt64(a) - for _, b := range i { - bb := toInt64(b) - if bb < aa { - aa = bb - } - } - return aa -} - -func minf(a interface{}, i ...interface{}) float64 { - aa := toFloat64(a) - for _, b := range i { - bb := toFloat64(b) - aa = math.Min(aa, bb) - } - return aa -} - -func until(count int) []int { - step := 1 - if count < 0 { - step = -1 - } - return untilStep(0, count, step) -} - -func untilStep(start, stop, step int) []int { - v := []int{} - - if stop < start { - if step >= 0 { - return v - } - for i := start; i > stop; i += step { - v = append(v, i) - } - return v - } - - if step <= 0 { - return v - } - for i := start; i < stop; i += step { - v = append(v, i) - } - return v -} - -func floor(a interface{}) float64 { - aa := toFloat64(a) - return math.Floor(aa) -} - -func ceil(a interface{}) float64 { - aa := toFloat64(a) - return math.Ceil(aa) -} - -func round(a interface{}, p int, rOpt ...float64) float64 { - roundOn := .5 - if len(rOpt) > 0 { - roundOn = rOpt[0] - } - val := toFloat64(a) - places := toFloat64(p) - - var round float64 - pow := math.Pow(10, places) - digit := pow * val - _, div := math.Modf(digit) - if div >= roundOn { - round = math.Ceil(digit) - } else { - round = math.Floor(digit) - } - return round / pow -} - -// converts unix octal to decimal -func toDecimal(v interface{}) int64 { - result, err := strconv.ParseInt(fmt.Sprint(v), 8, 64) - if err != nil { - return 0 - } - return result -} - -func seq(params ...int) string { - increment := 1 - switch len(params) { - case 0: - return "" - case 1: - start := 1 - end := params[0] - if end < start { - increment = -1 - } - return intArrayToString(untilStep(start, end+increment, increment), " ") - case 3: - start := params[0] - end := params[2] - step := params[1] - if end < start { - increment = -1 - if step > 0 { - return "" - } - } - return intArrayToString(untilStep(start, end+increment, step), " ") - case 2: - start := params[0] - end := params[1] - step := 1 - if end < start { - step = -1 - } - return intArrayToString(untilStep(start, end+step, step), " ") - default: - return "" - } -} - -func intArrayToString(slice []int, delimeter string) string { - return strings.Trim(strings.Join(strings.Fields(fmt.Sprint(slice)), delimeter), "[]") -} - -// performs a float and subsequent decimal.Decimal conversion on inputs, -// and iterates through a and b executing the mathmetical operation f -func execDecimalOp(a interface{}, b []interface{}, f func(d1, d2 decimal.Decimal) decimal.Decimal) float64 { - prt := decimal.NewFromFloat(toFloat64(a)) - for _, x := range b { - dx := decimal.NewFromFloat(toFloat64(x)) - prt = f(prt, dx) - } - rslt, _ := prt.Float64() - return rslt -} diff --git a/vendor/github.com/Masterminds/sprig/v3/reflect.go b/vendor/github.com/Masterminds/sprig/v3/reflect.go deleted file mode 100644 index 8a65c132f0..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/reflect.go +++ /dev/null @@ -1,28 +0,0 @@ -package sprig - -import ( - "fmt" - "reflect" -) - -// typeIs returns true if the src is the type named in target. -func typeIs(target string, src interface{}) bool { - return target == typeOf(src) -} - -func typeIsLike(target string, src interface{}) bool { - t := typeOf(src) - return target == t || "*"+target == t -} - -func typeOf(src interface{}) string { - return fmt.Sprintf("%T", src) -} - -func kindIs(target string, src interface{}) bool { - return target == kindOf(src) -} - -func kindOf(src interface{}) string { - return reflect.ValueOf(src).Kind().String() -} diff --git a/vendor/github.com/Masterminds/sprig/v3/regex.go b/vendor/github.com/Masterminds/sprig/v3/regex.go deleted file mode 100644 index fab5510189..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/regex.go +++ /dev/null @@ -1,83 +0,0 @@ -package sprig - -import ( - "regexp" -) - -func regexMatch(regex string, s string) bool { - match, _ := regexp.MatchString(regex, s) - return match -} - -func mustRegexMatch(regex string, s string) (bool, error) { - return regexp.MatchString(regex, s) -} - -func regexFindAll(regex string, s string, n int) []string { - r := regexp.MustCompile(regex) - return r.FindAllString(s, n) -} - -func mustRegexFindAll(regex string, s string, n int) ([]string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return []string{}, err - } - return r.FindAllString(s, n), nil -} - -func regexFind(regex string, s string) string { - r := regexp.MustCompile(regex) - return r.FindString(s) -} - -func mustRegexFind(regex string, s string) (string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return "", err - } - return r.FindString(s), nil -} - -func regexReplaceAll(regex string, s string, repl string) string { - r := regexp.MustCompile(regex) - return r.ReplaceAllString(s, repl) -} - -func mustRegexReplaceAll(regex string, s string, repl string) (string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return "", err - } - return r.ReplaceAllString(s, repl), nil -} - -func regexReplaceAllLiteral(regex string, s string, repl string) string { - r := regexp.MustCompile(regex) - return r.ReplaceAllLiteralString(s, repl) -} - -func mustRegexReplaceAllLiteral(regex string, s string, repl string) (string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return "", err - } - return r.ReplaceAllLiteralString(s, repl), nil -} - -func regexSplit(regex string, s string, n int) []string { - r := regexp.MustCompile(regex) - return r.Split(s, n) -} - -func mustRegexSplit(regex string, s string, n int) ([]string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return []string{}, err - } - return r.Split(s, n), nil -} - -func regexQuoteMeta(s string) string { - return regexp.QuoteMeta(s) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/semver.go b/vendor/github.com/Masterminds/sprig/v3/semver.go deleted file mode 100644 index 3fbe08aa63..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/semver.go +++ /dev/null @@ -1,23 +0,0 @@ -package sprig - -import ( - sv2 "github.com/Masterminds/semver/v3" -) - -func semverCompare(constraint, version string) (bool, error) { - c, err := sv2.NewConstraint(constraint) - if err != nil { - return false, err - } - - v, err := sv2.NewVersion(version) - if err != nil { - return false, err - } - - return c.Check(v), nil -} - -func semver(version string) (*sv2.Version, error) { - return sv2.NewVersion(version) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/strings.go b/vendor/github.com/Masterminds/sprig/v3/strings.go deleted file mode 100644 index e0ae628c84..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/strings.go +++ /dev/null @@ -1,236 +0,0 @@ -package sprig - -import ( - "encoding/base32" - "encoding/base64" - "fmt" - "reflect" - "strconv" - "strings" - - util "github.com/Masterminds/goutils" -) - -func base64encode(v string) string { - return base64.StdEncoding.EncodeToString([]byte(v)) -} - -func base64decode(v string) string { - data, err := base64.StdEncoding.DecodeString(v) - if err != nil { - return err.Error() - } - return string(data) -} - -func base32encode(v string) string { - return base32.StdEncoding.EncodeToString([]byte(v)) -} - -func base32decode(v string) string { - data, err := base32.StdEncoding.DecodeString(v) - if err != nil { - return err.Error() - } - return string(data) -} - -func abbrev(width int, s string) string { - if width < 4 { - return s - } - r, _ := util.Abbreviate(s, width) - return r -} - -func abbrevboth(left, right int, s string) string { - if right < 4 || left > 0 && right < 7 { - return s - } - r, _ := util.AbbreviateFull(s, left, right) - return r -} -func initials(s string) string { - // Wrap this just to eliminate the var args, which templates don't do well. - return util.Initials(s) -} - -func randAlphaNumeric(count int) string { - // It is not possible, it appears, to actually generate an error here. - r, _ := util.CryptoRandomAlphaNumeric(count) - return r -} - -func randAlpha(count int) string { - r, _ := util.CryptoRandomAlphabetic(count) - return r -} - -func randAscii(count int) string { - r, _ := util.CryptoRandomAscii(count) - return r -} - -func randNumeric(count int) string { - r, _ := util.CryptoRandomNumeric(count) - return r -} - -func untitle(str string) string { - return util.Uncapitalize(str) -} - -func quote(str ...interface{}) string { - out := make([]string, 0, len(str)) - for _, s := range str { - if s != nil { - out = append(out, fmt.Sprintf("%q", strval(s))) - } - } - return strings.Join(out, " ") -} - -func squote(str ...interface{}) string { - out := make([]string, 0, len(str)) - for _, s := range str { - if s != nil { - out = append(out, fmt.Sprintf("'%v'", s)) - } - } - return strings.Join(out, " ") -} - -func cat(v ...interface{}) string { - v = removeNilElements(v) - r := strings.TrimSpace(strings.Repeat("%v ", len(v))) - return fmt.Sprintf(r, v...) -} - -func indent(spaces int, v string) string { - pad := strings.Repeat(" ", spaces) - return pad + strings.Replace(v, "\n", "\n"+pad, -1) -} - -func nindent(spaces int, v string) string { - return "\n" + indent(spaces, v) -} - -func replace(old, new, src string) string { - return strings.Replace(src, old, new, -1) -} - -func plural(one, many string, count int) string { - if count == 1 { - return one - } - return many -} - -func strslice(v interface{}) []string { - switch v := v.(type) { - case []string: - return v - case []interface{}: - b := make([]string, 0, len(v)) - for _, s := range v { - if s != nil { - b = append(b, strval(s)) - } - } - return b - default: - val := reflect.ValueOf(v) - switch val.Kind() { - case reflect.Array, reflect.Slice: - l := val.Len() - b := make([]string, 0, l) - for i := 0; i < l; i++ { - value := val.Index(i).Interface() - if value != nil { - b = append(b, strval(value)) - } - } - return b - default: - if v == nil { - return []string{} - } - - return []string{strval(v)} - } - } -} - -func removeNilElements(v []interface{}) []interface{} { - newSlice := make([]interface{}, 0, len(v)) - for _, i := range v { - if i != nil { - newSlice = append(newSlice, i) - } - } - return newSlice -} - -func strval(v interface{}) string { - switch v := v.(type) { - case string: - return v - case []byte: - return string(v) - case error: - return v.Error() - case fmt.Stringer: - return v.String() - default: - return fmt.Sprintf("%v", v) - } -} - -func trunc(c int, s string) string { - if c < 0 && len(s)+c > 0 { - return s[len(s)+c:] - } - if c >= 0 && len(s) > c { - return s[:c] - } - return s -} - -func join(sep string, v interface{}) string { - return strings.Join(strslice(v), sep) -} - -func split(sep, orig string) map[string]string { - parts := strings.Split(orig, sep) - res := make(map[string]string, len(parts)) - for i, v := range parts { - res["_"+strconv.Itoa(i)] = v - } - return res -} - -func splitn(sep string, n int, orig string) map[string]string { - parts := strings.SplitN(orig, sep, n) - res := make(map[string]string, len(parts)) - for i, v := range parts { - res["_"+strconv.Itoa(i)] = v - } - return res -} - -// substring creates a substring of the given string. -// -// If start is < 0, this calls string[:end]. -// -// If start is >= 0 and end < 0 or end bigger than s length, this calls string[start:] -// -// Otherwise, this calls string[start, end]. -func substring(start, end int, s string) string { - if start < 0 { - return s[:end] - } - if end < 0 || end > len(s) { - return s[start:] - } - return s[start:end] -} diff --git a/vendor/github.com/Masterminds/sprig/v3/url.go b/vendor/github.com/Masterminds/sprig/v3/url.go deleted file mode 100644 index b8e120e19b..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/url.go +++ /dev/null @@ -1,66 +0,0 @@ -package sprig - -import ( - "fmt" - "net/url" - "reflect" -) - -func dictGetOrEmpty(dict map[string]interface{}, key string) string { - value, ok := dict[key] - if !ok { - return "" - } - tp := reflect.TypeOf(value).Kind() - if tp != reflect.String { - panic(fmt.Sprintf("unable to parse %s key, must be of type string, but %s found", key, tp.String())) - } - return reflect.ValueOf(value).String() -} - -// parses given URL to return dict object -func urlParse(v string) map[string]interface{} { - dict := map[string]interface{}{} - parsedURL, err := url.Parse(v) - if err != nil { - panic(fmt.Sprintf("unable to parse url: %s", err)) - } - dict["scheme"] = parsedURL.Scheme - dict["host"] = parsedURL.Host - dict["hostname"] = parsedURL.Hostname() - dict["path"] = parsedURL.Path - dict["query"] = parsedURL.RawQuery - dict["opaque"] = parsedURL.Opaque - dict["fragment"] = parsedURL.Fragment - if parsedURL.User != nil { - dict["userinfo"] = parsedURL.User.String() - } else { - dict["userinfo"] = "" - } - - return dict -} - -// join given dict to URL string -func urlJoin(d map[string]interface{}) string { - resURL := url.URL{ - Scheme: dictGetOrEmpty(d, "scheme"), - Host: dictGetOrEmpty(d, "host"), - Path: dictGetOrEmpty(d, "path"), - RawQuery: dictGetOrEmpty(d, "query"), - Opaque: dictGetOrEmpty(d, "opaque"), - Fragment: dictGetOrEmpty(d, "fragment"), - } - userinfo := dictGetOrEmpty(d, "userinfo") - var user *url.Userinfo - if userinfo != "" { - tempURL, err := url.Parse(fmt.Sprintf("proto://%s@host", userinfo)) - if err != nil { - panic(fmt.Sprintf("unable to parse userinfo in dict: %s", err)) - } - user = tempURL.User - } - - resURL.User = user - return resURL.String() -} diff --git a/vendor/github.com/Masterminds/squirrel/.gitignore b/vendor/github.com/Masterminds/squirrel/.gitignore deleted file mode 100644 index 4a0699f0b7..0000000000 --- a/vendor/github.com/Masterminds/squirrel/.gitignore +++ /dev/null @@ -1 +0,0 @@ -squirrel.test \ No newline at end of file diff --git a/vendor/github.com/Masterminds/squirrel/.travis.yml b/vendor/github.com/Masterminds/squirrel/.travis.yml deleted file mode 100644 index 7bb6da4878..0000000000 --- a/vendor/github.com/Masterminds/squirrel/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: go - -go: - - 1.11.x - - 1.12.x - - 1.13.x - -services: - - mysql - - postgresql - -# Setting sudo access to false will let Travis CI use containers rather than -# VMs to run the tests. For more details see: -# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ -# - http://docs.travis-ci.com/user/workers/standard-infrastructure/ -sudo: false - -before_script: - - mysql -e 'CREATE DATABASE squirrel;' - - psql -c 'CREATE DATABASE squirrel;' -U postgres - -script: - - go test - - cd integration - - go test -args -driver sqlite3 - - go test -args -driver mysql -dataSource travis@/squirrel - - go test -args -driver postgres -dataSource 'postgres://postgres@localhost/squirrel?sslmode=disable' - -notifications: - irc: "irc.freenode.net#masterminds" diff --git a/vendor/github.com/Masterminds/squirrel/LICENSE b/vendor/github.com/Masterminds/squirrel/LICENSE deleted file mode 100644 index b459007fd8..0000000000 --- a/vendor/github.com/Masterminds/squirrel/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -MIT License - -Squirrel: The Masterminds -Copyright (c) 2014-2015, Lann Martin. Copyright (C) 2015-2016, Google. Copyright (C) 2015, Matt Farina and Matt Butcher. - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/Masterminds/squirrel/README.md b/vendor/github.com/Masterminds/squirrel/README.md deleted file mode 100644 index 1d37f282f1..0000000000 --- a/vendor/github.com/Masterminds/squirrel/README.md +++ /dev/null @@ -1,142 +0,0 @@ -[![Stability: Maintenance](https://masterminds.github.io/stability/maintenance.svg)](https://masterminds.github.io/stability/maintenance.html) -### Squirrel is "complete". -Bug fixes will still be merged (slowly). Bug reports are welcome, but I will not necessarily respond to them. If another fork (or substantially similar project) actively improves on what Squirrel does, let me know and I may link to it here. - - -# Squirrel - fluent SQL generator for Go - -```go -import "github.com/Masterminds/squirrel" -``` - - -[![GoDoc](https://godoc.org/github.com/Masterminds/squirrel?status.png)](https://godoc.org/github.com/Masterminds/squirrel) -[![Build Status](https://api.travis-ci.org/Masterminds/squirrel.svg?branch=master)](https://travis-ci.org/Masterminds/squirrel) - -**Squirrel is not an ORM.** For an application of Squirrel, check out -[structable, a table-struct mapper](https://github.com/Masterminds/structable) - - -Squirrel helps you build SQL queries from composable parts: - -```go -import sq "github.com/Masterminds/squirrel" - -users := sq.Select("*").From("users").Join("emails USING (email_id)") - -active := users.Where(sq.Eq{"deleted_at": nil}) - -sql, args, err := active.ToSql() - -sql == "SELECT * FROM users JOIN emails USING (email_id) WHERE deleted_at IS NULL" -``` - -```go -sql, args, err := sq. - Insert("users").Columns("name", "age"). - Values("moe", 13).Values("larry", sq.Expr("? + 5", 12)). - ToSql() - -sql == "INSERT INTO users (name,age) VALUES (?,?),(?,? + 5)" -``` - -Squirrel can also execute queries directly: - -```go -stooges := users.Where(sq.Eq{"username": []string{"moe", "larry", "curly", "shemp"}}) -three_stooges := stooges.Limit(3) -rows, err := three_stooges.RunWith(db).Query() - -// Behaves like: -rows, err := db.Query("SELECT * FROM users WHERE username IN (?,?,?,?) LIMIT 3", - "moe", "larry", "curly", "shemp") -``` - -Squirrel makes conditional query building a breeze: - -```go -if len(q) > 0 { - users = users.Where("name LIKE ?", fmt.Sprint("%", q, "%")) -} -``` - -Squirrel wants to make your life easier: - -```go -// StmtCache caches Prepared Stmts for you -dbCache := sq.NewStmtCache(db) - -// StatementBuilder keeps your syntax neat -mydb := sq.StatementBuilder.RunWith(dbCache) -select_users := mydb.Select("*").From("users") -``` - -Squirrel loves PostgreSQL: - -```go -psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar) - -// You use question marks for placeholders... -sql, _, _ := psql.Select("*").From("elephants").Where("name IN (?,?)", "Dumbo", "Verna").ToSql() - -/// ...squirrel replaces them using PlaceholderFormat. -sql == "SELECT * FROM elephants WHERE name IN ($1,$2)" - - -/// You can retrieve id ... -query := sq.Insert("nodes"). - Columns("uuid", "type", "data"). - Values(node.Uuid, node.Type, node.Data). - Suffix("RETURNING \"id\""). - RunWith(m.db). - PlaceholderFormat(sq.Dollar) - -query.QueryRow().Scan(&node.id) -``` - -You can escape question marks by inserting two question marks: - -```sql -SELECT * FROM nodes WHERE meta->'format' ??| array[?,?] -``` - -will generate with the Dollar Placeholder: - -```sql -SELECT * FROM nodes WHERE meta->'format' ?| array[$1,$2] -``` - -## FAQ - -* **How can I build an IN query on composite keys / tuples, e.g. `WHERE (col1, col2) IN ((1,2),(3,4))`? ([#104](https://github.com/Masterminds/squirrel/issues/104))** - - Squirrel does not explicitly support tuples, but you can get the same effect with e.g.: - - ```go - sq.Or{ - sq.Eq{"col1": 1, "col2": 2}, - sq.Eq{"col1": 3, "col2": 4}} - ``` - - ```sql - WHERE (col1 = 1 AND col2 = 2) OR (col1 = 3 AND col2 = 4) - ``` - - (which should produce the same query plan as the tuple version) - -* **Why doesn't `Eq{"mynumber": []uint8{1,2,3}}` turn into an `IN` query? ([#114](https://github.com/Masterminds/squirrel/issues/114))** - - Values of type `[]byte` are handled specially by `database/sql`. In Go, [`byte` is just an alias of `uint8`](https://golang.org/pkg/builtin/#byte), so there is no way to distinguish `[]uint8` from `[]byte`. - -* **Some features are poorly documented!** - - This isn't a frequent complaints section! - -* **Some features are poorly documented?** - - Yes. The tests should be considered a part of the documentation; take a look at those for ideas on how to express more complex queries. - -## License - -Squirrel is released under the -[MIT License](http://www.opensource.org/licenses/MIT). diff --git a/vendor/github.com/Masterminds/squirrel/case.go b/vendor/github.com/Masterminds/squirrel/case.go deleted file mode 100644 index 299e14b9d4..0000000000 --- a/vendor/github.com/Masterminds/squirrel/case.go +++ /dev/null @@ -1,128 +0,0 @@ -package squirrel - -import ( - "bytes" - "errors" - - "github.com/lann/builder" -) - -func init() { - builder.Register(CaseBuilder{}, caseData{}) -} - -// sqlizerBuffer is a helper that allows to write many Sqlizers one by one -// without constant checks for errors that may come from Sqlizer -type sqlizerBuffer struct { - bytes.Buffer - args []interface{} - err error -} - -// WriteSql converts Sqlizer to SQL strings and writes it to buffer -func (b *sqlizerBuffer) WriteSql(item Sqlizer) { - if b.err != nil { - return - } - - var str string - var args []interface{} - str, args, b.err = nestedToSql(item) - - if b.err != nil { - return - } - - b.WriteString(str) - b.WriteByte(' ') - b.args = append(b.args, args...) -} - -func (b *sqlizerBuffer) ToSql() (string, []interface{}, error) { - return b.String(), b.args, b.err -} - -// whenPart is a helper structure to describe SQLs "WHEN ... THEN ..." expression -type whenPart struct { - when Sqlizer - then Sqlizer -} - -func newWhenPart(when interface{}, then interface{}) whenPart { - return whenPart{newPart(when), newPart(then)} -} - -// caseData holds all the data required to build a CASE SQL construct -type caseData struct { - What Sqlizer - WhenParts []whenPart - Else Sqlizer -} - -// ToSql implements Sqlizer -func (d *caseData) ToSql() (sqlStr string, args []interface{}, err error) { - if len(d.WhenParts) == 0 { - err = errors.New("case expression must contain at lease one WHEN clause") - - return - } - - sql := sqlizerBuffer{} - - sql.WriteString("CASE ") - if d.What != nil { - sql.WriteSql(d.What) - } - - for _, p := range d.WhenParts { - sql.WriteString("WHEN ") - sql.WriteSql(p.when) - sql.WriteString("THEN ") - sql.WriteSql(p.then) - } - - if d.Else != nil { - sql.WriteString("ELSE ") - sql.WriteSql(d.Else) - } - - sql.WriteString("END") - - return sql.ToSql() -} - -// CaseBuilder builds SQL CASE construct which could be used as parts of queries. -type CaseBuilder builder.Builder - -// ToSql builds the query into a SQL string and bound args. -func (b CaseBuilder) ToSql() (string, []interface{}, error) { - data := builder.GetStruct(b).(caseData) - return data.ToSql() -} - -// MustSql builds the query into a SQL string and bound args. -// It panics if there are any errors. -func (b CaseBuilder) MustSql() (string, []interface{}) { - sql, args, err := b.ToSql() - if err != nil { - panic(err) - } - return sql, args -} - -// what sets optional value for CASE construct "CASE [value] ..." -func (b CaseBuilder) what(expr interface{}) CaseBuilder { - return builder.Set(b, "What", newPart(expr)).(CaseBuilder) -} - -// When adds "WHEN ... THEN ..." part to CASE construct -func (b CaseBuilder) When(when interface{}, then interface{}) CaseBuilder { - // TODO: performance hint: replace slice of WhenPart with just slice of parts - // where even indices of the slice belong to "when"s and odd indices belong to "then"s - return builder.Append(b, "WhenParts", newWhenPart(when, then)).(CaseBuilder) -} - -// What sets optional "ELSE ..." part for CASE construct -func (b CaseBuilder) Else(expr interface{}) CaseBuilder { - return builder.Set(b, "Else", newPart(expr)).(CaseBuilder) -} diff --git a/vendor/github.com/Masterminds/squirrel/delete.go b/vendor/github.com/Masterminds/squirrel/delete.go deleted file mode 100644 index f3f31e63ef..0000000000 --- a/vendor/github.com/Masterminds/squirrel/delete.go +++ /dev/null @@ -1,191 +0,0 @@ -package squirrel - -import ( - "bytes" - "database/sql" - "fmt" - "strings" - - "github.com/lann/builder" -) - -type deleteData struct { - PlaceholderFormat PlaceholderFormat - RunWith BaseRunner - Prefixes []Sqlizer - From string - WhereParts []Sqlizer - OrderBys []string - Limit string - Offset string - Suffixes []Sqlizer -} - -func (d *deleteData) Exec() (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return ExecWith(d.RunWith, d) -} - -func (d *deleteData) ToSql() (sqlStr string, args []interface{}, err error) { - if len(d.From) == 0 { - err = fmt.Errorf("delete statements must specify a From table") - return - } - - sql := &bytes.Buffer{} - - if len(d.Prefixes) > 0 { - args, err = appendToSql(d.Prefixes, sql, " ", args) - if err != nil { - return - } - - sql.WriteString(" ") - } - - sql.WriteString("DELETE FROM ") - sql.WriteString(d.From) - - if len(d.WhereParts) > 0 { - sql.WriteString(" WHERE ") - args, err = appendToSql(d.WhereParts, sql, " AND ", args) - if err != nil { - return - } - } - - if len(d.OrderBys) > 0 { - sql.WriteString(" ORDER BY ") - sql.WriteString(strings.Join(d.OrderBys, ", ")) - } - - if len(d.Limit) > 0 { - sql.WriteString(" LIMIT ") - sql.WriteString(d.Limit) - } - - if len(d.Offset) > 0 { - sql.WriteString(" OFFSET ") - sql.WriteString(d.Offset) - } - - if len(d.Suffixes) > 0 { - sql.WriteString(" ") - args, err = appendToSql(d.Suffixes, sql, " ", args) - if err != nil { - return - } - } - - sqlStr, err = d.PlaceholderFormat.ReplacePlaceholders(sql.String()) - return -} - -// Builder - -// DeleteBuilder builds SQL DELETE statements. -type DeleteBuilder builder.Builder - -func init() { - builder.Register(DeleteBuilder{}, deleteData{}) -} - -// Format methods - -// PlaceholderFormat sets PlaceholderFormat (e.g. Question or Dollar) for the -// query. -func (b DeleteBuilder) PlaceholderFormat(f PlaceholderFormat) DeleteBuilder { - return builder.Set(b, "PlaceholderFormat", f).(DeleteBuilder) -} - -// Runner methods - -// RunWith sets a Runner (like database/sql.DB) to be used with e.g. Exec. -func (b DeleteBuilder) RunWith(runner BaseRunner) DeleteBuilder { - return setRunWith(b, runner).(DeleteBuilder) -} - -// Exec builds and Execs the query with the Runner set by RunWith. -func (b DeleteBuilder) Exec() (sql.Result, error) { - data := builder.GetStruct(b).(deleteData) - return data.Exec() -} - -// SQL methods - -// ToSql builds the query into a SQL string and bound args. -func (b DeleteBuilder) ToSql() (string, []interface{}, error) { - data := builder.GetStruct(b).(deleteData) - return data.ToSql() -} - -// MustSql builds the query into a SQL string and bound args. -// It panics if there are any errors. -func (b DeleteBuilder) MustSql() (string, []interface{}) { - sql, args, err := b.ToSql() - if err != nil { - panic(err) - } - return sql, args -} - -// Prefix adds an expression to the beginning of the query -func (b DeleteBuilder) Prefix(sql string, args ...interface{}) DeleteBuilder { - return b.PrefixExpr(Expr(sql, args...)) -} - -// PrefixExpr adds an expression to the very beginning of the query -func (b DeleteBuilder) PrefixExpr(expr Sqlizer) DeleteBuilder { - return builder.Append(b, "Prefixes", expr).(DeleteBuilder) -} - -// From sets the table to be deleted from. -func (b DeleteBuilder) From(from string) DeleteBuilder { - return builder.Set(b, "From", from).(DeleteBuilder) -} - -// Where adds WHERE expressions to the query. -// -// See SelectBuilder.Where for more information. -func (b DeleteBuilder) Where(pred interface{}, args ...interface{}) DeleteBuilder { - return builder.Append(b, "WhereParts", newWherePart(pred, args...)).(DeleteBuilder) -} - -// OrderBy adds ORDER BY expressions to the query. -func (b DeleteBuilder) OrderBy(orderBys ...string) DeleteBuilder { - return builder.Extend(b, "OrderBys", orderBys).(DeleteBuilder) -} - -// Limit sets a LIMIT clause on the query. -func (b DeleteBuilder) Limit(limit uint64) DeleteBuilder { - return builder.Set(b, "Limit", fmt.Sprintf("%d", limit)).(DeleteBuilder) -} - -// Offset sets a OFFSET clause on the query. -func (b DeleteBuilder) Offset(offset uint64) DeleteBuilder { - return builder.Set(b, "Offset", fmt.Sprintf("%d", offset)).(DeleteBuilder) -} - -// Suffix adds an expression to the end of the query -func (b DeleteBuilder) Suffix(sql string, args ...interface{}) DeleteBuilder { - return b.SuffixExpr(Expr(sql, args...)) -} - -// SuffixExpr adds an expression to the end of the query -func (b DeleteBuilder) SuffixExpr(expr Sqlizer) DeleteBuilder { - return builder.Append(b, "Suffixes", expr).(DeleteBuilder) -} - -func (b DeleteBuilder) Query() (*sql.Rows, error) { - data := builder.GetStruct(b).(deleteData) - return data.Query() -} - -func (d *deleteData) Query() (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return QueryWith(d.RunWith, d) -} diff --git a/vendor/github.com/Masterminds/squirrel/delete_ctx.go b/vendor/github.com/Masterminds/squirrel/delete_ctx.go deleted file mode 100644 index de83c55df3..0000000000 --- a/vendor/github.com/Masterminds/squirrel/delete_ctx.go +++ /dev/null @@ -1,69 +0,0 @@ -// +build go1.8 - -package squirrel - -import ( - "context" - "database/sql" - - "github.com/lann/builder" -) - -func (d *deleteData) ExecContext(ctx context.Context) (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(ExecerContext) - if !ok { - return nil, NoContextSupport - } - return ExecContextWith(ctx, ctxRunner, d) -} - -func (d *deleteData) QueryContext(ctx context.Context) (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(QueryerContext) - if !ok { - return nil, NoContextSupport - } - return QueryContextWith(ctx, ctxRunner, d) -} - -func (d *deleteData) QueryRowContext(ctx context.Context) RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRowerContext) - if !ok { - if _, ok := d.RunWith.(QueryerContext); !ok { - return &Row{err: RunnerNotQueryRunner} - } - return &Row{err: NoContextSupport} - } - return QueryRowContextWith(ctx, queryRower, d) -} - -// ExecContext builds and ExecContexts the query with the Runner set by RunWith. -func (b DeleteBuilder) ExecContext(ctx context.Context) (sql.Result, error) { - data := builder.GetStruct(b).(deleteData) - return data.ExecContext(ctx) -} - -// QueryContext builds and QueryContexts the query with the Runner set by RunWith. -func (b DeleteBuilder) QueryContext(ctx context.Context) (*sql.Rows, error) { - data := builder.GetStruct(b).(deleteData) - return data.QueryContext(ctx) -} - -// QueryRowContext builds and QueryRowContexts the query with the Runner set by RunWith. -func (b DeleteBuilder) QueryRowContext(ctx context.Context) RowScanner { - data := builder.GetStruct(b).(deleteData) - return data.QueryRowContext(ctx) -} - -// ScanContext is a shortcut for QueryRowContext().Scan. -func (b DeleteBuilder) ScanContext(ctx context.Context, dest ...interface{}) error { - return b.QueryRowContext(ctx).Scan(dest...) -} diff --git a/vendor/github.com/Masterminds/squirrel/expr.go b/vendor/github.com/Masterminds/squirrel/expr.go deleted file mode 100644 index eba1b4579e..0000000000 --- a/vendor/github.com/Masterminds/squirrel/expr.go +++ /dev/null @@ -1,419 +0,0 @@ -package squirrel - -import ( - "bytes" - "database/sql/driver" - "fmt" - "reflect" - "sort" - "strings" -) - -const ( - // Portable true/false literals. - sqlTrue = "(1=1)" - sqlFalse = "(1=0)" -) - -type expr struct { - sql string - args []interface{} -} - -// Expr builds an expression from a SQL fragment and arguments. -// -// Ex: -// Expr("FROM_UNIXTIME(?)", t) -func Expr(sql string, args ...interface{}) Sqlizer { - return expr{sql: sql, args: args} -} - -func (e expr) ToSql() (sql string, args []interface{}, err error) { - simple := true - for _, arg := range e.args { - if _, ok := arg.(Sqlizer); ok { - simple = false - } - } - if simple { - return e.sql, e.args, nil - } - - buf := &bytes.Buffer{} - ap := e.args - sp := e.sql - - var isql string - var iargs []interface{} - - for err == nil && len(ap) > 0 && len(sp) > 0 { - i := strings.Index(sp, "?") - if i < 0 { - // no more placeholders - break - } - if len(sp) > i+1 && sp[i+1:i+2] == "?" { - // escaped "??"; append it and step past - buf.WriteString(sp[:i+2]) - sp = sp[i+2:] - continue - } - - if as, ok := ap[0].(Sqlizer); ok { - // sqlizer argument; expand it and append the result - isql, iargs, err = as.ToSql() - buf.WriteString(sp[:i]) - buf.WriteString(isql) - args = append(args, iargs...) - } else { - // normal argument; append it and the placeholder - buf.WriteString(sp[:i+1]) - args = append(args, ap[0]) - } - - // step past the argument and placeholder - ap = ap[1:] - sp = sp[i+1:] - } - - // append the remaining sql and arguments - buf.WriteString(sp) - return buf.String(), append(args, ap...), err -} - -type concatExpr []interface{} - -func (ce concatExpr) ToSql() (sql string, args []interface{}, err error) { - for _, part := range ce { - switch p := part.(type) { - case string: - sql += p - case Sqlizer: - pSql, pArgs, err := p.ToSql() - if err != nil { - return "", nil, err - } - sql += pSql - args = append(args, pArgs...) - default: - return "", nil, fmt.Errorf("%#v is not a string or Sqlizer", part) - } - } - return -} - -// ConcatExpr builds an expression by concatenating strings and other expressions. -// -// Ex: -// name_expr := Expr("CONCAT(?, ' ', ?)", firstName, lastName) -// ConcatExpr("COALESCE(full_name,", name_expr, ")") -func ConcatExpr(parts ...interface{}) concatExpr { - return concatExpr(parts) -} - -// aliasExpr helps to alias part of SQL query generated with underlying "expr" -type aliasExpr struct { - expr Sqlizer - alias string -} - -// Alias allows to define alias for column in SelectBuilder. Useful when column is -// defined as complex expression like IF or CASE -// Ex: -// .Column(Alias(caseStmt, "case_column")) -func Alias(expr Sqlizer, alias string) aliasExpr { - return aliasExpr{expr, alias} -} - -func (e aliasExpr) ToSql() (sql string, args []interface{}, err error) { - sql, args, err = e.expr.ToSql() - if err == nil { - sql = fmt.Sprintf("(%s) AS %s", sql, e.alias) - } - return -} - -// Eq is syntactic sugar for use with Where/Having/Set methods. -type Eq map[string]interface{} - -func (eq Eq) toSQL(useNotOpr bool) (sql string, args []interface{}, err error) { - if len(eq) == 0 { - // Empty Sql{} evaluates to true. - sql = sqlTrue - return - } - - var ( - exprs []string - equalOpr = "=" - inOpr = "IN" - nullOpr = "IS" - inEmptyExpr = sqlFalse - ) - - if useNotOpr { - equalOpr = "<>" - inOpr = "NOT IN" - nullOpr = "IS NOT" - inEmptyExpr = sqlTrue - } - - sortedKeys := getSortedKeys(eq) - for _, key := range sortedKeys { - var expr string - val := eq[key] - - switch v := val.(type) { - case driver.Valuer: - if val, err = v.Value(); err != nil { - return - } - } - - r := reflect.ValueOf(val) - if r.Kind() == reflect.Ptr { - if r.IsNil() { - val = nil - } else { - val = r.Elem().Interface() - } - } - - if val == nil { - expr = fmt.Sprintf("%s %s NULL", key, nullOpr) - } else { - if isListType(val) { - valVal := reflect.ValueOf(val) - if valVal.Len() == 0 { - expr = inEmptyExpr - if args == nil { - args = []interface{}{} - } - } else { - for i := 0; i < valVal.Len(); i++ { - args = append(args, valVal.Index(i).Interface()) - } - expr = fmt.Sprintf("%s %s (%s)", key, inOpr, Placeholders(valVal.Len())) - } - } else { - expr = fmt.Sprintf("%s %s ?", key, equalOpr) - args = append(args, val) - } - } - exprs = append(exprs, expr) - } - sql = strings.Join(exprs, " AND ") - return -} - -func (eq Eq) ToSql() (sql string, args []interface{}, err error) { - return eq.toSQL(false) -} - -// NotEq is syntactic sugar for use with Where/Having/Set methods. -// Ex: -// .Where(NotEq{"id": 1}) == "id <> 1" -type NotEq Eq - -func (neq NotEq) ToSql() (sql string, args []interface{}, err error) { - return Eq(neq).toSQL(true) -} - -// Like is syntactic sugar for use with LIKE conditions. -// Ex: -// .Where(Like{"name": "%irrel"}) -type Like map[string]interface{} - -func (lk Like) toSql(opr string) (sql string, args []interface{}, err error) { - var exprs []string - for key, val := range lk { - expr := "" - - switch v := val.(type) { - case driver.Valuer: - if val, err = v.Value(); err != nil { - return - } - } - - if val == nil { - err = fmt.Errorf("cannot use null with like operators") - return - } else { - if isListType(val) { - err = fmt.Errorf("cannot use array or slice with like operators") - return - } else { - expr = fmt.Sprintf("%s %s ?", key, opr) - args = append(args, val) - } - } - exprs = append(exprs, expr) - } - sql = strings.Join(exprs, " AND ") - return -} - -func (lk Like) ToSql() (sql string, args []interface{}, err error) { - return lk.toSql("LIKE") -} - -// NotLike is syntactic sugar for use with LIKE conditions. -// Ex: -// .Where(NotLike{"name": "%irrel"}) -type NotLike Like - -func (nlk NotLike) ToSql() (sql string, args []interface{}, err error) { - return Like(nlk).toSql("NOT LIKE") -} - -// ILike is syntactic sugar for use with ILIKE conditions. -// Ex: -// .Where(ILike{"name": "sq%"}) -type ILike Like - -func (ilk ILike) ToSql() (sql string, args []interface{}, err error) { - return Like(ilk).toSql("ILIKE") -} - -// NotILike is syntactic sugar for use with ILIKE conditions. -// Ex: -// .Where(NotILike{"name": "sq%"}) -type NotILike Like - -func (nilk NotILike) ToSql() (sql string, args []interface{}, err error) { - return Like(nilk).toSql("NOT ILIKE") -} - -// Lt is syntactic sugar for use with Where/Having/Set methods. -// Ex: -// .Where(Lt{"id": 1}) -type Lt map[string]interface{} - -func (lt Lt) toSql(opposite, orEq bool) (sql string, args []interface{}, err error) { - var ( - exprs []string - opr = "<" - ) - - if opposite { - opr = ">" - } - - if orEq { - opr = fmt.Sprintf("%s%s", opr, "=") - } - - sortedKeys := getSortedKeys(lt) - for _, key := range sortedKeys { - var expr string - val := lt[key] - - switch v := val.(type) { - case driver.Valuer: - if val, err = v.Value(); err != nil { - return - } - } - - if val == nil { - err = fmt.Errorf("cannot use null with less than or greater than operators") - return - } - if isListType(val) { - err = fmt.Errorf("cannot use array or slice with less than or greater than operators") - return - } - expr = fmt.Sprintf("%s %s ?", key, opr) - args = append(args, val) - - exprs = append(exprs, expr) - } - sql = strings.Join(exprs, " AND ") - return -} - -func (lt Lt) ToSql() (sql string, args []interface{}, err error) { - return lt.toSql(false, false) -} - -// LtOrEq is syntactic sugar for use with Where/Having/Set methods. -// Ex: -// .Where(LtOrEq{"id": 1}) == "id <= 1" -type LtOrEq Lt - -func (ltOrEq LtOrEq) ToSql() (sql string, args []interface{}, err error) { - return Lt(ltOrEq).toSql(false, true) -} - -// Gt is syntactic sugar for use with Where/Having/Set methods. -// Ex: -// .Where(Gt{"id": 1}) == "id > 1" -type Gt Lt - -func (gt Gt) ToSql() (sql string, args []interface{}, err error) { - return Lt(gt).toSql(true, false) -} - -// GtOrEq is syntactic sugar for use with Where/Having/Set methods. -// Ex: -// .Where(GtOrEq{"id": 1}) == "id >= 1" -type GtOrEq Lt - -func (gtOrEq GtOrEq) ToSql() (sql string, args []interface{}, err error) { - return Lt(gtOrEq).toSql(true, true) -} - -type conj []Sqlizer - -func (c conj) join(sep, defaultExpr string) (sql string, args []interface{}, err error) { - if len(c) == 0 { - return defaultExpr, []interface{}{}, nil - } - var sqlParts []string - for _, sqlizer := range c { - partSQL, partArgs, err := nestedToSql(sqlizer) - if err != nil { - return "", nil, err - } - if partSQL != "" { - sqlParts = append(sqlParts, partSQL) - args = append(args, partArgs...) - } - } - if len(sqlParts) > 0 { - sql = fmt.Sprintf("(%s)", strings.Join(sqlParts, sep)) - } - return -} - -// And conjunction Sqlizers -type And conj - -func (a And) ToSql() (string, []interface{}, error) { - return conj(a).join(" AND ", sqlTrue) -} - -// Or conjunction Sqlizers -type Or conj - -func (o Or) ToSql() (string, []interface{}, error) { - return conj(o).join(" OR ", sqlFalse) -} - -func getSortedKeys(exp map[string]interface{}) []string { - sortedKeys := make([]string, 0, len(exp)) - for k := range exp { - sortedKeys = append(sortedKeys, k) - } - sort.Strings(sortedKeys) - return sortedKeys -} - -func isListType(val interface{}) bool { - if driver.IsValue(val) { - return false - } - valVal := reflect.ValueOf(val) - return valVal.Kind() == reflect.Array || valVal.Kind() == reflect.Slice -} diff --git a/vendor/github.com/Masterminds/squirrel/insert.go b/vendor/github.com/Masterminds/squirrel/insert.go deleted file mode 100644 index c23a57935b..0000000000 --- a/vendor/github.com/Masterminds/squirrel/insert.go +++ /dev/null @@ -1,298 +0,0 @@ -package squirrel - -import ( - "bytes" - "database/sql" - "errors" - "fmt" - "io" - "sort" - "strings" - - "github.com/lann/builder" -) - -type insertData struct { - PlaceholderFormat PlaceholderFormat - RunWith BaseRunner - Prefixes []Sqlizer - StatementKeyword string - Options []string - Into string - Columns []string - Values [][]interface{} - Suffixes []Sqlizer - Select *SelectBuilder -} - -func (d *insertData) Exec() (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return ExecWith(d.RunWith, d) -} - -func (d *insertData) Query() (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return QueryWith(d.RunWith, d) -} - -func (d *insertData) QueryRow() RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRower) - if !ok { - return &Row{err: RunnerNotQueryRunner} - } - return QueryRowWith(queryRower, d) -} - -func (d *insertData) ToSql() (sqlStr string, args []interface{}, err error) { - if len(d.Into) == 0 { - err = errors.New("insert statements must specify a table") - return - } - if len(d.Values) == 0 && d.Select == nil { - err = errors.New("insert statements must have at least one set of values or select clause") - return - } - - sql := &bytes.Buffer{} - - if len(d.Prefixes) > 0 { - args, err = appendToSql(d.Prefixes, sql, " ", args) - if err != nil { - return - } - - sql.WriteString(" ") - } - - if d.StatementKeyword == "" { - sql.WriteString("INSERT ") - } else { - sql.WriteString(d.StatementKeyword) - sql.WriteString(" ") - } - - if len(d.Options) > 0 { - sql.WriteString(strings.Join(d.Options, " ")) - sql.WriteString(" ") - } - - sql.WriteString("INTO ") - sql.WriteString(d.Into) - sql.WriteString(" ") - - if len(d.Columns) > 0 { - sql.WriteString("(") - sql.WriteString(strings.Join(d.Columns, ",")) - sql.WriteString(") ") - } - - if d.Select != nil { - args, err = d.appendSelectToSQL(sql, args) - } else { - args, err = d.appendValuesToSQL(sql, args) - } - if err != nil { - return - } - - if len(d.Suffixes) > 0 { - sql.WriteString(" ") - args, err = appendToSql(d.Suffixes, sql, " ", args) - if err != nil { - return - } - } - - sqlStr, err = d.PlaceholderFormat.ReplacePlaceholders(sql.String()) - return -} - -func (d *insertData) appendValuesToSQL(w io.Writer, args []interface{}) ([]interface{}, error) { - if len(d.Values) == 0 { - return args, errors.New("values for insert statements are not set") - } - - io.WriteString(w, "VALUES ") - - valuesStrings := make([]string, len(d.Values)) - for r, row := range d.Values { - valueStrings := make([]string, len(row)) - for v, val := range row { - if vs, ok := val.(Sqlizer); ok { - vsql, vargs, err := vs.ToSql() - if err != nil { - return nil, err - } - valueStrings[v] = vsql - args = append(args, vargs...) - } else { - valueStrings[v] = "?" - args = append(args, val) - } - } - valuesStrings[r] = fmt.Sprintf("(%s)", strings.Join(valueStrings, ",")) - } - - io.WriteString(w, strings.Join(valuesStrings, ",")) - - return args, nil -} - -func (d *insertData) appendSelectToSQL(w io.Writer, args []interface{}) ([]interface{}, error) { - if d.Select == nil { - return args, errors.New("select clause for insert statements are not set") - } - - selectClause, sArgs, err := d.Select.ToSql() - if err != nil { - return args, err - } - - io.WriteString(w, selectClause) - args = append(args, sArgs...) - - return args, nil -} - -// Builder - -// InsertBuilder builds SQL INSERT statements. -type InsertBuilder builder.Builder - -func init() { - builder.Register(InsertBuilder{}, insertData{}) -} - -// Format methods - -// PlaceholderFormat sets PlaceholderFormat (e.g. Question or Dollar) for the -// query. -func (b InsertBuilder) PlaceholderFormat(f PlaceholderFormat) InsertBuilder { - return builder.Set(b, "PlaceholderFormat", f).(InsertBuilder) -} - -// Runner methods - -// RunWith sets a Runner (like database/sql.DB) to be used with e.g. Exec. -func (b InsertBuilder) RunWith(runner BaseRunner) InsertBuilder { - return setRunWith(b, runner).(InsertBuilder) -} - -// Exec builds and Execs the query with the Runner set by RunWith. -func (b InsertBuilder) Exec() (sql.Result, error) { - data := builder.GetStruct(b).(insertData) - return data.Exec() -} - -// Query builds and Querys the query with the Runner set by RunWith. -func (b InsertBuilder) Query() (*sql.Rows, error) { - data := builder.GetStruct(b).(insertData) - return data.Query() -} - -// QueryRow builds and QueryRows the query with the Runner set by RunWith. -func (b InsertBuilder) QueryRow() RowScanner { - data := builder.GetStruct(b).(insertData) - return data.QueryRow() -} - -// Scan is a shortcut for QueryRow().Scan. -func (b InsertBuilder) Scan(dest ...interface{}) error { - return b.QueryRow().Scan(dest...) -} - -// SQL methods - -// ToSql builds the query into a SQL string and bound args. -func (b InsertBuilder) ToSql() (string, []interface{}, error) { - data := builder.GetStruct(b).(insertData) - return data.ToSql() -} - -// MustSql builds the query into a SQL string and bound args. -// It panics if there are any errors. -func (b InsertBuilder) MustSql() (string, []interface{}) { - sql, args, err := b.ToSql() - if err != nil { - panic(err) - } - return sql, args -} - -// Prefix adds an expression to the beginning of the query -func (b InsertBuilder) Prefix(sql string, args ...interface{}) InsertBuilder { - return b.PrefixExpr(Expr(sql, args...)) -} - -// PrefixExpr adds an expression to the very beginning of the query -func (b InsertBuilder) PrefixExpr(expr Sqlizer) InsertBuilder { - return builder.Append(b, "Prefixes", expr).(InsertBuilder) -} - -// Options adds keyword options before the INTO clause of the query. -func (b InsertBuilder) Options(options ...string) InsertBuilder { - return builder.Extend(b, "Options", options).(InsertBuilder) -} - -// Into sets the INTO clause of the query. -func (b InsertBuilder) Into(from string) InsertBuilder { - return builder.Set(b, "Into", from).(InsertBuilder) -} - -// Columns adds insert columns to the query. -func (b InsertBuilder) Columns(columns ...string) InsertBuilder { - return builder.Extend(b, "Columns", columns).(InsertBuilder) -} - -// Values adds a single row's values to the query. -func (b InsertBuilder) Values(values ...interface{}) InsertBuilder { - return builder.Append(b, "Values", values).(InsertBuilder) -} - -// Suffix adds an expression to the end of the query -func (b InsertBuilder) Suffix(sql string, args ...interface{}) InsertBuilder { - return b.SuffixExpr(Expr(sql, args...)) -} - -// SuffixExpr adds an expression to the end of the query -func (b InsertBuilder) SuffixExpr(expr Sqlizer) InsertBuilder { - return builder.Append(b, "Suffixes", expr).(InsertBuilder) -} - -// SetMap set columns and values for insert builder from a map of column name and value -// note that it will reset all previous columns and values was set if any -func (b InsertBuilder) SetMap(clauses map[string]interface{}) InsertBuilder { - // Keep the columns in a consistent order by sorting the column key string. - cols := make([]string, 0, len(clauses)) - for col := range clauses { - cols = append(cols, col) - } - sort.Strings(cols) - - vals := make([]interface{}, 0, len(clauses)) - for _, col := range cols { - vals = append(vals, clauses[col]) - } - - b = builder.Set(b, "Columns", cols).(InsertBuilder) - b = builder.Set(b, "Values", [][]interface{}{vals}).(InsertBuilder) - - return b -} - -// Select set Select clause for insert query -// If Values and Select are used, then Select has higher priority -func (b InsertBuilder) Select(sb SelectBuilder) InsertBuilder { - return builder.Set(b, "Select", &sb).(InsertBuilder) -} - -func (b InsertBuilder) statementKeyword(keyword string) InsertBuilder { - return builder.Set(b, "StatementKeyword", keyword).(InsertBuilder) -} diff --git a/vendor/github.com/Masterminds/squirrel/insert_ctx.go b/vendor/github.com/Masterminds/squirrel/insert_ctx.go deleted file mode 100644 index 4541c2fed3..0000000000 --- a/vendor/github.com/Masterminds/squirrel/insert_ctx.go +++ /dev/null @@ -1,69 +0,0 @@ -// +build go1.8 - -package squirrel - -import ( - "context" - "database/sql" - - "github.com/lann/builder" -) - -func (d *insertData) ExecContext(ctx context.Context) (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(ExecerContext) - if !ok { - return nil, NoContextSupport - } - return ExecContextWith(ctx, ctxRunner, d) -} - -func (d *insertData) QueryContext(ctx context.Context) (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(QueryerContext) - if !ok { - return nil, NoContextSupport - } - return QueryContextWith(ctx, ctxRunner, d) -} - -func (d *insertData) QueryRowContext(ctx context.Context) RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRowerContext) - if !ok { - if _, ok := d.RunWith.(QueryerContext); !ok { - return &Row{err: RunnerNotQueryRunner} - } - return &Row{err: NoContextSupport} - } - return QueryRowContextWith(ctx, queryRower, d) -} - -// ExecContext builds and ExecContexts the query with the Runner set by RunWith. -func (b InsertBuilder) ExecContext(ctx context.Context) (sql.Result, error) { - data := builder.GetStruct(b).(insertData) - return data.ExecContext(ctx) -} - -// QueryContext builds and QueryContexts the query with the Runner set by RunWith. -func (b InsertBuilder) QueryContext(ctx context.Context) (*sql.Rows, error) { - data := builder.GetStruct(b).(insertData) - return data.QueryContext(ctx) -} - -// QueryRowContext builds and QueryRowContexts the query with the Runner set by RunWith. -func (b InsertBuilder) QueryRowContext(ctx context.Context) RowScanner { - data := builder.GetStruct(b).(insertData) - return data.QueryRowContext(ctx) -} - -// ScanContext is a shortcut for QueryRowContext().Scan. -func (b InsertBuilder) ScanContext(ctx context.Context, dest ...interface{}) error { - return b.QueryRowContext(ctx).Scan(dest...) -} diff --git a/vendor/github.com/Masterminds/squirrel/part.go b/vendor/github.com/Masterminds/squirrel/part.go deleted file mode 100644 index c58f68f1a4..0000000000 --- a/vendor/github.com/Masterminds/squirrel/part.go +++ /dev/null @@ -1,63 +0,0 @@ -package squirrel - -import ( - "fmt" - "io" -) - -type part struct { - pred interface{} - args []interface{} -} - -func newPart(pred interface{}, args ...interface{}) Sqlizer { - return &part{pred, args} -} - -func (p part) ToSql() (sql string, args []interface{}, err error) { - switch pred := p.pred.(type) { - case nil: - // no-op - case Sqlizer: - sql, args, err = nestedToSql(pred) - case string: - sql = pred - args = p.args - default: - err = fmt.Errorf("expected string or Sqlizer, not %T", pred) - } - return -} - -func nestedToSql(s Sqlizer) (string, []interface{}, error) { - if raw, ok := s.(rawSqlizer); ok { - return raw.toSqlRaw() - } else { - return s.ToSql() - } -} - -func appendToSql(parts []Sqlizer, w io.Writer, sep string, args []interface{}) ([]interface{}, error) { - for i, p := range parts { - partSql, partArgs, err := nestedToSql(p) - if err != nil { - return nil, err - } else if len(partSql) == 0 { - continue - } - - if i > 0 { - _, err := io.WriteString(w, sep) - if err != nil { - return nil, err - } - } - - _, err = io.WriteString(w, partSql) - if err != nil { - return nil, err - } - args = append(args, partArgs...) - } - return args, nil -} diff --git a/vendor/github.com/Masterminds/squirrel/placeholder.go b/vendor/github.com/Masterminds/squirrel/placeholder.go deleted file mode 100644 index 8e97a6c62d..0000000000 --- a/vendor/github.com/Masterminds/squirrel/placeholder.go +++ /dev/null @@ -1,114 +0,0 @@ -package squirrel - -import ( - "bytes" - "fmt" - "strings" -) - -// PlaceholderFormat is the interface that wraps the ReplacePlaceholders method. -// -// ReplacePlaceholders takes a SQL statement and replaces each question mark -// placeholder with a (possibly different) SQL placeholder. -type PlaceholderFormat interface { - ReplacePlaceholders(sql string) (string, error) -} - -type placeholderDebugger interface { - debugPlaceholder() string -} - -var ( - // Question is a PlaceholderFormat instance that leaves placeholders as - // question marks. - Question = questionFormat{} - - // Dollar is a PlaceholderFormat instance that replaces placeholders with - // dollar-prefixed positional placeholders (e.g. $1, $2, $3). - Dollar = dollarFormat{} - - // Colon is a PlaceholderFormat instance that replaces placeholders with - // colon-prefixed positional placeholders (e.g. :1, :2, :3). - Colon = colonFormat{} - - // AtP is a PlaceholderFormat instance that replaces placeholders with - // "@p"-prefixed positional placeholders (e.g. @p1, @p2, @p3). - AtP = atpFormat{} -) - -type questionFormat struct{} - -func (questionFormat) ReplacePlaceholders(sql string) (string, error) { - return sql, nil -} - -func (questionFormat) debugPlaceholder() string { - return "?" -} - -type dollarFormat struct{} - -func (dollarFormat) ReplacePlaceholders(sql string) (string, error) { - return replacePositionalPlaceholders(sql, "$") -} - -func (dollarFormat) debugPlaceholder() string { - return "$" -} - -type colonFormat struct{} - -func (colonFormat) ReplacePlaceholders(sql string) (string, error) { - return replacePositionalPlaceholders(sql, ":") -} - -func (colonFormat) debugPlaceholder() string { - return ":" -} - -type atpFormat struct{} - -func (atpFormat) ReplacePlaceholders(sql string) (string, error) { - return replacePositionalPlaceholders(sql, "@p") -} - -func (atpFormat) debugPlaceholder() string { - return "@p" -} - -// Placeholders returns a string with count ? placeholders joined with commas. -func Placeholders(count int) string { - if count < 1 { - return "" - } - - return strings.Repeat(",?", count)[1:] -} - -func replacePositionalPlaceholders(sql, prefix string) (string, error) { - buf := &bytes.Buffer{} - i := 0 - for { - p := strings.Index(sql, "?") - if p == -1 { - break - } - - if len(sql[p:]) > 1 && sql[p:p+2] == "??" { // escape ?? => ? - buf.WriteString(sql[:p]) - buf.WriteString("?") - if len(sql[p:]) == 1 { - break - } - sql = sql[p+2:] - } else { - i++ - buf.WriteString(sql[:p]) - fmt.Fprintf(buf, "%s%d", prefix, i) - sql = sql[p+1:] - } - } - - buf.WriteString(sql) - return buf.String(), nil -} diff --git a/vendor/github.com/Masterminds/squirrel/row.go b/vendor/github.com/Masterminds/squirrel/row.go deleted file mode 100644 index 74ffda92bd..0000000000 --- a/vendor/github.com/Masterminds/squirrel/row.go +++ /dev/null @@ -1,22 +0,0 @@ -package squirrel - -// RowScanner is the interface that wraps the Scan method. -// -// Scan behaves like database/sql.Row.Scan. -type RowScanner interface { - Scan(...interface{}) error -} - -// Row wraps database/sql.Row to let squirrel return new errors on Scan. -type Row struct { - RowScanner - err error -} - -// Scan returns Row.err or calls RowScanner.Scan. -func (r *Row) Scan(dest ...interface{}) error { - if r.err != nil { - return r.err - } - return r.RowScanner.Scan(dest...) -} diff --git a/vendor/github.com/Masterminds/squirrel/select.go b/vendor/github.com/Masterminds/squirrel/select.go deleted file mode 100644 index d55ce4c740..0000000000 --- a/vendor/github.com/Masterminds/squirrel/select.go +++ /dev/null @@ -1,403 +0,0 @@ -package squirrel - -import ( - "bytes" - "database/sql" - "fmt" - "strings" - - "github.com/lann/builder" -) - -type selectData struct { - PlaceholderFormat PlaceholderFormat - RunWith BaseRunner - Prefixes []Sqlizer - Options []string - Columns []Sqlizer - From Sqlizer - Joins []Sqlizer - WhereParts []Sqlizer - GroupBys []string - HavingParts []Sqlizer - OrderByParts []Sqlizer - Limit string - Offset string - Suffixes []Sqlizer -} - -func (d *selectData) Exec() (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return ExecWith(d.RunWith, d) -} - -func (d *selectData) Query() (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return QueryWith(d.RunWith, d) -} - -func (d *selectData) QueryRow() RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRower) - if !ok { - return &Row{err: RunnerNotQueryRunner} - } - return QueryRowWith(queryRower, d) -} - -func (d *selectData) ToSql() (sqlStr string, args []interface{}, err error) { - sqlStr, args, err = d.toSqlRaw() - if err != nil { - return - } - - sqlStr, err = d.PlaceholderFormat.ReplacePlaceholders(sqlStr) - return -} - -func (d *selectData) toSqlRaw() (sqlStr string, args []interface{}, err error) { - if len(d.Columns) == 0 { - err = fmt.Errorf("select statements must have at least one result column") - return - } - - sql := &bytes.Buffer{} - - if len(d.Prefixes) > 0 { - args, err = appendToSql(d.Prefixes, sql, " ", args) - if err != nil { - return - } - - sql.WriteString(" ") - } - - sql.WriteString("SELECT ") - - if len(d.Options) > 0 { - sql.WriteString(strings.Join(d.Options, " ")) - sql.WriteString(" ") - } - - if len(d.Columns) > 0 { - args, err = appendToSql(d.Columns, sql, ", ", args) - if err != nil { - return - } - } - - if d.From != nil { - sql.WriteString(" FROM ") - args, err = appendToSql([]Sqlizer{d.From}, sql, "", args) - if err != nil { - return - } - } - - if len(d.Joins) > 0 { - sql.WriteString(" ") - args, err = appendToSql(d.Joins, sql, " ", args) - if err != nil { - return - } - } - - if len(d.WhereParts) > 0 { - sql.WriteString(" WHERE ") - args, err = appendToSql(d.WhereParts, sql, " AND ", args) - if err != nil { - return - } - } - - if len(d.GroupBys) > 0 { - sql.WriteString(" GROUP BY ") - sql.WriteString(strings.Join(d.GroupBys, ", ")) - } - - if len(d.HavingParts) > 0 { - sql.WriteString(" HAVING ") - args, err = appendToSql(d.HavingParts, sql, " AND ", args) - if err != nil { - return - } - } - - if len(d.OrderByParts) > 0 { - sql.WriteString(" ORDER BY ") - args, err = appendToSql(d.OrderByParts, sql, ", ", args) - if err != nil { - return - } - } - - if len(d.Limit) > 0 { - sql.WriteString(" LIMIT ") - sql.WriteString(d.Limit) - } - - if len(d.Offset) > 0 { - sql.WriteString(" OFFSET ") - sql.WriteString(d.Offset) - } - - if len(d.Suffixes) > 0 { - sql.WriteString(" ") - - args, err = appendToSql(d.Suffixes, sql, " ", args) - if err != nil { - return - } - } - - sqlStr = sql.String() - return -} - -// Builder - -// SelectBuilder builds SQL SELECT statements. -type SelectBuilder builder.Builder - -func init() { - builder.Register(SelectBuilder{}, selectData{}) -} - -// Format methods - -// PlaceholderFormat sets PlaceholderFormat (e.g. Question or Dollar) for the -// query. -func (b SelectBuilder) PlaceholderFormat(f PlaceholderFormat) SelectBuilder { - return builder.Set(b, "PlaceholderFormat", f).(SelectBuilder) -} - -// Runner methods - -// RunWith sets a Runner (like database/sql.DB) to be used with e.g. Exec. -// For most cases runner will be a database connection. -// -// Internally we use this to mock out the database connection for testing. -func (b SelectBuilder) RunWith(runner BaseRunner) SelectBuilder { - return setRunWith(b, runner).(SelectBuilder) -} - -// Exec builds and Execs the query with the Runner set by RunWith. -func (b SelectBuilder) Exec() (sql.Result, error) { - data := builder.GetStruct(b).(selectData) - return data.Exec() -} - -// Query builds and Querys the query with the Runner set by RunWith. -func (b SelectBuilder) Query() (*sql.Rows, error) { - data := builder.GetStruct(b).(selectData) - return data.Query() -} - -// QueryRow builds and QueryRows the query with the Runner set by RunWith. -func (b SelectBuilder) QueryRow() RowScanner { - data := builder.GetStruct(b).(selectData) - return data.QueryRow() -} - -// Scan is a shortcut for QueryRow().Scan. -func (b SelectBuilder) Scan(dest ...interface{}) error { - return b.QueryRow().Scan(dest...) -} - -// SQL methods - -// ToSql builds the query into a SQL string and bound args. -func (b SelectBuilder) ToSql() (string, []interface{}, error) { - data := builder.GetStruct(b).(selectData) - return data.ToSql() -} - -func (b SelectBuilder) toSqlRaw() (string, []interface{}, error) { - data := builder.GetStruct(b).(selectData) - return data.toSqlRaw() -} - -// MustSql builds the query into a SQL string and bound args. -// It panics if there are any errors. -func (b SelectBuilder) MustSql() (string, []interface{}) { - sql, args, err := b.ToSql() - if err != nil { - panic(err) - } - return sql, args -} - -// Prefix adds an expression to the beginning of the query -func (b SelectBuilder) Prefix(sql string, args ...interface{}) SelectBuilder { - return b.PrefixExpr(Expr(sql, args...)) -} - -// PrefixExpr adds an expression to the very beginning of the query -func (b SelectBuilder) PrefixExpr(expr Sqlizer) SelectBuilder { - return builder.Append(b, "Prefixes", expr).(SelectBuilder) -} - -// Distinct adds a DISTINCT clause to the query. -func (b SelectBuilder) Distinct() SelectBuilder { - return b.Options("DISTINCT") -} - -// Options adds select option to the query -func (b SelectBuilder) Options(options ...string) SelectBuilder { - return builder.Extend(b, "Options", options).(SelectBuilder) -} - -// Columns adds result columns to the query. -func (b SelectBuilder) Columns(columns ...string) SelectBuilder { - parts := make([]interface{}, 0, len(columns)) - for _, str := range columns { - parts = append(parts, newPart(str)) - } - return builder.Extend(b, "Columns", parts).(SelectBuilder) -} - -// RemoveColumns remove all columns from query. -// Must add a new column with Column or Columns methods, otherwise -// return a error. -func (b SelectBuilder) RemoveColumns() SelectBuilder { - return builder.Delete(b, "Columns").(SelectBuilder) -} - -// Column adds a result column to the query. -// Unlike Columns, Column accepts args which will be bound to placeholders in -// the columns string, for example: -// Column("IF(col IN ("+squirrel.Placeholders(3)+"), 1, 0) as col", 1, 2, 3) -func (b SelectBuilder) Column(column interface{}, args ...interface{}) SelectBuilder { - return builder.Append(b, "Columns", newPart(column, args...)).(SelectBuilder) -} - -// From sets the FROM clause of the query. -func (b SelectBuilder) From(from string) SelectBuilder { - return builder.Set(b, "From", newPart(from)).(SelectBuilder) -} - -// FromSelect sets a subquery into the FROM clause of the query. -func (b SelectBuilder) FromSelect(from SelectBuilder, alias string) SelectBuilder { - // Prevent misnumbered parameters in nested selects (#183). - from = from.PlaceholderFormat(Question) - return builder.Set(b, "From", Alias(from, alias)).(SelectBuilder) -} - -// JoinClause adds a join clause to the query. -func (b SelectBuilder) JoinClause(pred interface{}, args ...interface{}) SelectBuilder { - return builder.Append(b, "Joins", newPart(pred, args...)).(SelectBuilder) -} - -// Join adds a JOIN clause to the query. -func (b SelectBuilder) Join(join string, rest ...interface{}) SelectBuilder { - return b.JoinClause("JOIN "+join, rest...) -} - -// LeftJoin adds a LEFT JOIN clause to the query. -func (b SelectBuilder) LeftJoin(join string, rest ...interface{}) SelectBuilder { - return b.JoinClause("LEFT JOIN "+join, rest...) -} - -// RightJoin adds a RIGHT JOIN clause to the query. -func (b SelectBuilder) RightJoin(join string, rest ...interface{}) SelectBuilder { - return b.JoinClause("RIGHT JOIN "+join, rest...) -} - -// InnerJoin adds a INNER JOIN clause to the query. -func (b SelectBuilder) InnerJoin(join string, rest ...interface{}) SelectBuilder { - return b.JoinClause("INNER JOIN "+join, rest...) -} - -// CrossJoin adds a CROSS JOIN clause to the query. -func (b SelectBuilder) CrossJoin(join string, rest ...interface{}) SelectBuilder { - return b.JoinClause("CROSS JOIN "+join, rest...) -} - -// Where adds an expression to the WHERE clause of the query. -// -// Expressions are ANDed together in the generated SQL. -// -// Where accepts several types for its pred argument: -// -// nil OR "" - ignored. -// -// string - SQL expression. -// If the expression has SQL placeholders then a set of arguments must be passed -// as well, one for each placeholder. -// -// map[string]interface{} OR Eq - map of SQL expressions to values. Each key is -// transformed into an expression like " = ?", with the corresponding value -// bound to the placeholder. If the value is nil, the expression will be " -// IS NULL". If the value is an array or slice, the expression will be " IN -// (?,?,...)", with one placeholder for each item in the value. These expressions -// are ANDed together. -// -// Where will panic if pred isn't any of the above types. -func (b SelectBuilder) Where(pred interface{}, args ...interface{}) SelectBuilder { - if pred == nil || pred == "" { - return b - } - return builder.Append(b, "WhereParts", newWherePart(pred, args...)).(SelectBuilder) -} - -// GroupBy adds GROUP BY expressions to the query. -func (b SelectBuilder) GroupBy(groupBys ...string) SelectBuilder { - return builder.Extend(b, "GroupBys", groupBys).(SelectBuilder) -} - -// Having adds an expression to the HAVING clause of the query. -// -// See Where. -func (b SelectBuilder) Having(pred interface{}, rest ...interface{}) SelectBuilder { - return builder.Append(b, "HavingParts", newWherePart(pred, rest...)).(SelectBuilder) -} - -// OrderByClause adds ORDER BY clause to the query. -func (b SelectBuilder) OrderByClause(pred interface{}, args ...interface{}) SelectBuilder { - return builder.Append(b, "OrderByParts", newPart(pred, args...)).(SelectBuilder) -} - -// OrderBy adds ORDER BY expressions to the query. -func (b SelectBuilder) OrderBy(orderBys ...string) SelectBuilder { - for _, orderBy := range orderBys { - b = b.OrderByClause(orderBy) - } - - return b -} - -// Limit sets a LIMIT clause on the query. -func (b SelectBuilder) Limit(limit uint64) SelectBuilder { - return builder.Set(b, "Limit", fmt.Sprintf("%d", limit)).(SelectBuilder) -} - -// Limit ALL allows to access all records with limit -func (b SelectBuilder) RemoveLimit() SelectBuilder { - return builder.Delete(b, "Limit").(SelectBuilder) -} - -// Offset sets a OFFSET clause on the query. -func (b SelectBuilder) Offset(offset uint64) SelectBuilder { - return builder.Set(b, "Offset", fmt.Sprintf("%d", offset)).(SelectBuilder) -} - -// RemoveOffset removes OFFSET clause. -func (b SelectBuilder) RemoveOffset() SelectBuilder { - return builder.Delete(b, "Offset").(SelectBuilder) -} - -// Suffix adds an expression to the end of the query -func (b SelectBuilder) Suffix(sql string, args ...interface{}) SelectBuilder { - return b.SuffixExpr(Expr(sql, args...)) -} - -// SuffixExpr adds an expression to the end of the query -func (b SelectBuilder) SuffixExpr(expr Sqlizer) SelectBuilder { - return builder.Append(b, "Suffixes", expr).(SelectBuilder) -} diff --git a/vendor/github.com/Masterminds/squirrel/select_ctx.go b/vendor/github.com/Masterminds/squirrel/select_ctx.go deleted file mode 100644 index 4c42c13f47..0000000000 --- a/vendor/github.com/Masterminds/squirrel/select_ctx.go +++ /dev/null @@ -1,69 +0,0 @@ -// +build go1.8 - -package squirrel - -import ( - "context" - "database/sql" - - "github.com/lann/builder" -) - -func (d *selectData) ExecContext(ctx context.Context) (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(ExecerContext) - if !ok { - return nil, NoContextSupport - } - return ExecContextWith(ctx, ctxRunner, d) -} - -func (d *selectData) QueryContext(ctx context.Context) (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(QueryerContext) - if !ok { - return nil, NoContextSupport - } - return QueryContextWith(ctx, ctxRunner, d) -} - -func (d *selectData) QueryRowContext(ctx context.Context) RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRowerContext) - if !ok { - if _, ok := d.RunWith.(QueryerContext); !ok { - return &Row{err: RunnerNotQueryRunner} - } - return &Row{err: NoContextSupport} - } - return QueryRowContextWith(ctx, queryRower, d) -} - -// ExecContext builds and ExecContexts the query with the Runner set by RunWith. -func (b SelectBuilder) ExecContext(ctx context.Context) (sql.Result, error) { - data := builder.GetStruct(b).(selectData) - return data.ExecContext(ctx) -} - -// QueryContext builds and QueryContexts the query with the Runner set by RunWith. -func (b SelectBuilder) QueryContext(ctx context.Context) (*sql.Rows, error) { - data := builder.GetStruct(b).(selectData) - return data.QueryContext(ctx) -} - -// QueryRowContext builds and QueryRowContexts the query with the Runner set by RunWith. -func (b SelectBuilder) QueryRowContext(ctx context.Context) RowScanner { - data := builder.GetStruct(b).(selectData) - return data.QueryRowContext(ctx) -} - -// ScanContext is a shortcut for QueryRowContext().Scan. -func (b SelectBuilder) ScanContext(ctx context.Context, dest ...interface{}) error { - return b.QueryRowContext(ctx).Scan(dest...) -} diff --git a/vendor/github.com/Masterminds/squirrel/squirrel.go b/vendor/github.com/Masterminds/squirrel/squirrel.go deleted file mode 100644 index 46d456eb62..0000000000 --- a/vendor/github.com/Masterminds/squirrel/squirrel.go +++ /dev/null @@ -1,183 +0,0 @@ -// Package squirrel provides a fluent SQL generator. -// -// See https://github.com/Masterminds/squirrel for examples. -package squirrel - -import ( - "bytes" - "database/sql" - "fmt" - "strings" - - "github.com/lann/builder" -) - -// Sqlizer is the interface that wraps the ToSql method. -// -// ToSql returns a SQL representation of the Sqlizer, along with a slice of args -// as passed to e.g. database/sql.Exec. It can also return an error. -type Sqlizer interface { - ToSql() (string, []interface{}, error) -} - -// rawSqlizer is expected to do what Sqlizer does, but without finalizing placeholders. -// This is useful for nested queries. -type rawSqlizer interface { - toSqlRaw() (string, []interface{}, error) -} - -// Execer is the interface that wraps the Exec method. -// -// Exec executes the given query as implemented by database/sql.Exec. -type Execer interface { - Exec(query string, args ...interface{}) (sql.Result, error) -} - -// Queryer is the interface that wraps the Query method. -// -// Query executes the given query as implemented by database/sql.Query. -type Queryer interface { - Query(query string, args ...interface{}) (*sql.Rows, error) -} - -// QueryRower is the interface that wraps the QueryRow method. -// -// QueryRow executes the given query as implemented by database/sql.QueryRow. -type QueryRower interface { - QueryRow(query string, args ...interface{}) RowScanner -} - -// BaseRunner groups the Execer and Queryer interfaces. -type BaseRunner interface { - Execer - Queryer -} - -// Runner groups the Execer, Queryer, and QueryRower interfaces. -type Runner interface { - Execer - Queryer - QueryRower -} - -// WrapStdSql wraps a type implementing the standard SQL interface with methods that -// squirrel expects. -func WrapStdSql(stdSql StdSql) Runner { - return &stdsqlRunner{stdSql} -} - -// StdSql encompasses the standard methods of the *sql.DB type, and other types that -// wrap these methods. -type StdSql interface { - Query(string, ...interface{}) (*sql.Rows, error) - QueryRow(string, ...interface{}) *sql.Row - Exec(string, ...interface{}) (sql.Result, error) -} - -type stdsqlRunner struct { - StdSql -} - -func (r *stdsqlRunner) QueryRow(query string, args ...interface{}) RowScanner { - return r.StdSql.QueryRow(query, args...) -} - -func setRunWith(b interface{}, runner BaseRunner) interface{} { - switch r := runner.(type) { - case StdSqlCtx: - runner = WrapStdSqlCtx(r) - case StdSql: - runner = WrapStdSql(r) - } - return builder.Set(b, "RunWith", runner) -} - -// RunnerNotSet is returned by methods that need a Runner if it isn't set. -var RunnerNotSet = fmt.Errorf("cannot run; no Runner set (RunWith)") - -// RunnerNotQueryRunner is returned by QueryRow if the RunWith value doesn't implement QueryRower. -var RunnerNotQueryRunner = fmt.Errorf("cannot QueryRow; Runner is not a QueryRower") - -// ExecWith Execs the SQL returned by s with db. -func ExecWith(db Execer, s Sqlizer) (res sql.Result, err error) { - query, args, err := s.ToSql() - if err != nil { - return - } - return db.Exec(query, args...) -} - -// QueryWith Querys the SQL returned by s with db. -func QueryWith(db Queryer, s Sqlizer) (rows *sql.Rows, err error) { - query, args, err := s.ToSql() - if err != nil { - return - } - return db.Query(query, args...) -} - -// QueryRowWith QueryRows the SQL returned by s with db. -func QueryRowWith(db QueryRower, s Sqlizer) RowScanner { - query, args, err := s.ToSql() - return &Row{RowScanner: db.QueryRow(query, args...), err: err} -} - -// DebugSqlizer calls ToSql on s and shows the approximate SQL to be executed -// -// If ToSql returns an error, the result of this method will look like: -// "[ToSql error: %s]" or "[DebugSqlizer error: %s]" -// -// IMPORTANT: As its name suggests, this function should only be used for -// debugging. While the string result *might* be valid SQL, this function does -// not try very hard to ensure it. Additionally, executing the output of this -// function with any untrusted user input is certainly insecure. -func DebugSqlizer(s Sqlizer) string { - sql, args, err := s.ToSql() - if err != nil { - return fmt.Sprintf("[ToSql error: %s]", err) - } - - var placeholder string - downCast, ok := s.(placeholderDebugger) - if !ok { - placeholder = "?" - } else { - placeholder = downCast.debugPlaceholder() - } - // TODO: dedupe this with placeholder.go - buf := &bytes.Buffer{} - i := 0 - for { - p := strings.Index(sql, placeholder) - if p == -1 { - break - } - if len(sql[p:]) > 1 && sql[p:p+2] == "??" { // escape ?? => ? - buf.WriteString(sql[:p]) - buf.WriteString("?") - if len(sql[p:]) == 1 { - break - } - sql = sql[p+2:] - } else { - if i+1 > len(args) { - return fmt.Sprintf( - "[DebugSqlizer error: too many placeholders in %#v for %d args]", - sql, len(args)) - } - buf.WriteString(sql[:p]) - fmt.Fprintf(buf, "'%v'", args[i]) - // advance our sql string "cursor" beyond the arg we placed - sql = sql[p+1:] - i++ - } - } - if i < len(args) { - return fmt.Sprintf( - "[DebugSqlizer error: not enough placeholders in %#v for %d args]", - sql, len(args)) - } - // "append" any remaning sql that won't need interpolating - buf.WriteString(sql) - return buf.String() -} diff --git a/vendor/github.com/Masterminds/squirrel/squirrel_ctx.go b/vendor/github.com/Masterminds/squirrel/squirrel_ctx.go deleted file mode 100644 index c20148ad33..0000000000 --- a/vendor/github.com/Masterminds/squirrel/squirrel_ctx.go +++ /dev/null @@ -1,93 +0,0 @@ -// +build go1.8 - -package squirrel - -import ( - "context" - "database/sql" - "errors" -) - -// NoContextSupport is returned if a db doesn't support Context. -var NoContextSupport = errors.New("DB does not support Context") - -// ExecerContext is the interface that wraps the ExecContext method. -// -// Exec executes the given query as implemented by database/sql.ExecContext. -type ExecerContext interface { - ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) -} - -// QueryerContext is the interface that wraps the QueryContext method. -// -// QueryContext executes the given query as implemented by database/sql.QueryContext. -type QueryerContext interface { - QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) -} - -// QueryRowerContext is the interface that wraps the QueryRowContext method. -// -// QueryRowContext executes the given query as implemented by database/sql.QueryRowContext. -type QueryRowerContext interface { - QueryRowContext(ctx context.Context, query string, args ...interface{}) RowScanner -} - -// RunnerContext groups the Runner interface, along with the Context versions of each of -// its methods -type RunnerContext interface { - Runner - QueryerContext - QueryRowerContext - ExecerContext -} - -// WrapStdSqlCtx wraps a type implementing the standard SQL interface plus the context -// versions of the methods with methods that squirrel expects. -func WrapStdSqlCtx(stdSqlCtx StdSqlCtx) RunnerContext { - return &stdsqlCtxRunner{stdSqlCtx} -} - -// StdSqlCtx encompasses the standard methods of the *sql.DB type, along with the Context -// versions of those methods, and other types that wrap these methods. -type StdSqlCtx interface { - StdSql - QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) - QueryRowContext(context.Context, string, ...interface{}) *sql.Row - ExecContext(context.Context, string, ...interface{}) (sql.Result, error) -} - -type stdsqlCtxRunner struct { - StdSqlCtx -} - -func (r *stdsqlCtxRunner) QueryRow(query string, args ...interface{}) RowScanner { - return r.StdSqlCtx.QueryRow(query, args...) -} - -func (r *stdsqlCtxRunner) QueryRowContext(ctx context.Context, query string, args ...interface{}) RowScanner { - return r.StdSqlCtx.QueryRowContext(ctx, query, args...) -} - -// ExecContextWith ExecContexts the SQL returned by s with db. -func ExecContextWith(ctx context.Context, db ExecerContext, s Sqlizer) (res sql.Result, err error) { - query, args, err := s.ToSql() - if err != nil { - return - } - return db.ExecContext(ctx, query, args...) -} - -// QueryContextWith QueryContexts the SQL returned by s with db. -func QueryContextWith(ctx context.Context, db QueryerContext, s Sqlizer) (rows *sql.Rows, err error) { - query, args, err := s.ToSql() - if err != nil { - return - } - return db.QueryContext(ctx, query, args...) -} - -// QueryRowContextWith QueryRowContexts the SQL returned by s with db. -func QueryRowContextWith(ctx context.Context, db QueryRowerContext, s Sqlizer) RowScanner { - query, args, err := s.ToSql() - return &Row{RowScanner: db.QueryRowContext(ctx, query, args...), err: err} -} diff --git a/vendor/github.com/Masterminds/squirrel/statement.go b/vendor/github.com/Masterminds/squirrel/statement.go deleted file mode 100644 index 9420c67f8e..0000000000 --- a/vendor/github.com/Masterminds/squirrel/statement.go +++ /dev/null @@ -1,104 +0,0 @@ -package squirrel - -import "github.com/lann/builder" - -// StatementBuilderType is the type of StatementBuilder. -type StatementBuilderType builder.Builder - -// Select returns a SelectBuilder for this StatementBuilderType. -func (b StatementBuilderType) Select(columns ...string) SelectBuilder { - return SelectBuilder(b).Columns(columns...) -} - -// Insert returns a InsertBuilder for this StatementBuilderType. -func (b StatementBuilderType) Insert(into string) InsertBuilder { - return InsertBuilder(b).Into(into) -} - -// Replace returns a InsertBuilder for this StatementBuilderType with the -// statement keyword set to "REPLACE". -func (b StatementBuilderType) Replace(into string) InsertBuilder { - return InsertBuilder(b).statementKeyword("REPLACE").Into(into) -} - -// Update returns a UpdateBuilder for this StatementBuilderType. -func (b StatementBuilderType) Update(table string) UpdateBuilder { - return UpdateBuilder(b).Table(table) -} - -// Delete returns a DeleteBuilder for this StatementBuilderType. -func (b StatementBuilderType) Delete(from string) DeleteBuilder { - return DeleteBuilder(b).From(from) -} - -// PlaceholderFormat sets the PlaceholderFormat field for any child builders. -func (b StatementBuilderType) PlaceholderFormat(f PlaceholderFormat) StatementBuilderType { - return builder.Set(b, "PlaceholderFormat", f).(StatementBuilderType) -} - -// RunWith sets the RunWith field for any child builders. -func (b StatementBuilderType) RunWith(runner BaseRunner) StatementBuilderType { - return setRunWith(b, runner).(StatementBuilderType) -} - -// Where adds WHERE expressions to the query. -// -// See SelectBuilder.Where for more information. -func (b StatementBuilderType) Where(pred interface{}, args ...interface{}) StatementBuilderType { - return builder.Append(b, "WhereParts", newWherePart(pred, args...)).(StatementBuilderType) -} - -// StatementBuilder is a parent builder for other builders, e.g. SelectBuilder. -var StatementBuilder = StatementBuilderType(builder.EmptyBuilder).PlaceholderFormat(Question) - -// Select returns a new SelectBuilder, optionally setting some result columns. -// -// See SelectBuilder.Columns. -func Select(columns ...string) SelectBuilder { - return StatementBuilder.Select(columns...) -} - -// Insert returns a new InsertBuilder with the given table name. -// -// See InsertBuilder.Into. -func Insert(into string) InsertBuilder { - return StatementBuilder.Insert(into) -} - -// Replace returns a new InsertBuilder with the statement keyword set to -// "REPLACE" and with the given table name. -// -// See InsertBuilder.Into. -func Replace(into string) InsertBuilder { - return StatementBuilder.Replace(into) -} - -// Update returns a new UpdateBuilder with the given table name. -// -// See UpdateBuilder.Table. -func Update(table string) UpdateBuilder { - return StatementBuilder.Update(table) -} - -// Delete returns a new DeleteBuilder with the given table name. -// -// See DeleteBuilder.Table. -func Delete(from string) DeleteBuilder { - return StatementBuilder.Delete(from) -} - -// Case returns a new CaseBuilder -// "what" represents case value -func Case(what ...interface{}) CaseBuilder { - b := CaseBuilder(builder.EmptyBuilder) - - switch len(what) { - case 0: - case 1: - b = b.what(what[0]) - default: - b = b.what(newPart(what[0], what[1:]...)) - - } - return b -} diff --git a/vendor/github.com/Masterminds/squirrel/stmtcacher.go b/vendor/github.com/Masterminds/squirrel/stmtcacher.go deleted file mode 100644 index 5bf267a136..0000000000 --- a/vendor/github.com/Masterminds/squirrel/stmtcacher.go +++ /dev/null @@ -1,121 +0,0 @@ -package squirrel - -import ( - "database/sql" - "fmt" - "sync" -) - -// Prepareer is the interface that wraps the Prepare method. -// -// Prepare executes the given query as implemented by database/sql.Prepare. -type Preparer interface { - Prepare(query string) (*sql.Stmt, error) -} - -// DBProxy groups the Execer, Queryer, QueryRower, and Preparer interfaces. -type DBProxy interface { - Execer - Queryer - QueryRower - Preparer -} - -// NOTE: NewStmtCache is defined in stmtcacher_ctx.go (Go >= 1.8) or stmtcacher_noctx.go (Go < 1.8). - -// StmtCache wraps and delegates down to a Preparer type -// -// It also automatically prepares all statements sent to the underlying Preparer calls -// for Exec, Query and QueryRow and caches the returns *sql.Stmt using the provided -// query as the key. So that it can be automatically re-used. -type StmtCache struct { - prep Preparer - cache map[string]*sql.Stmt - mu sync.Mutex -} - -// Prepare delegates down to the underlying Preparer and caches the result -// using the provided query as a key -func (sc *StmtCache) Prepare(query string) (*sql.Stmt, error) { - sc.mu.Lock() - defer sc.mu.Unlock() - - stmt, ok := sc.cache[query] - if ok { - return stmt, nil - } - stmt, err := sc.prep.Prepare(query) - if err == nil { - sc.cache[query] = stmt - } - return stmt, err -} - -// Exec delegates down to the underlying Preparer using a prepared statement -func (sc *StmtCache) Exec(query string, args ...interface{}) (res sql.Result, err error) { - stmt, err := sc.Prepare(query) - if err != nil { - return - } - return stmt.Exec(args...) -} - -// Query delegates down to the underlying Preparer using a prepared statement -func (sc *StmtCache) Query(query string, args ...interface{}) (rows *sql.Rows, err error) { - stmt, err := sc.Prepare(query) - if err != nil { - return - } - return stmt.Query(args...) -} - -// QueryRow delegates down to the underlying Preparer using a prepared statement -func (sc *StmtCache) QueryRow(query string, args ...interface{}) RowScanner { - stmt, err := sc.Prepare(query) - if err != nil { - return &Row{err: err} - } - return stmt.QueryRow(args...) -} - -// Clear removes and closes all the currently cached prepared statements -func (sc *StmtCache) Clear() (err error) { - sc.mu.Lock() - defer sc.mu.Unlock() - - for key, stmt := range sc.cache { - delete(sc.cache, key) - - if stmt == nil { - continue - } - - if cerr := stmt.Close(); cerr != nil { - err = cerr - } - } - - if err != nil { - return fmt.Errorf("one or more Stmt.Close failed; last error: %v", err) - } - - return -} - -type DBProxyBeginner interface { - DBProxy - Begin() (*sql.Tx, error) -} - -type stmtCacheProxy struct { - DBProxy - db *sql.DB -} - -func NewStmtCacheProxy(db *sql.DB) DBProxyBeginner { - return &stmtCacheProxy{DBProxy: NewStmtCache(db), db: db} -} - -func (sp *stmtCacheProxy) Begin() (*sql.Tx, error) { - return sp.db.Begin() -} diff --git a/vendor/github.com/Masterminds/squirrel/stmtcacher_ctx.go b/vendor/github.com/Masterminds/squirrel/stmtcacher_ctx.go deleted file mode 100644 index 53603cf4c9..0000000000 --- a/vendor/github.com/Masterminds/squirrel/stmtcacher_ctx.go +++ /dev/null @@ -1,86 +0,0 @@ -// +build go1.8 - -package squirrel - -import ( - "context" - "database/sql" -) - -// PrepareerContext is the interface that wraps the Prepare and PrepareContext methods. -// -// Prepare executes the given query as implemented by database/sql.Prepare. -// PrepareContext executes the given query as implemented by database/sql.PrepareContext. -type PreparerContext interface { - Preparer - PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) -} - -// DBProxyContext groups the Execer, Queryer, QueryRower and PreparerContext interfaces. -type DBProxyContext interface { - Execer - Queryer - QueryRower - PreparerContext -} - -// NewStmtCache returns a *StmtCache wrapping a PreparerContext that caches Prepared Stmts. -// -// Stmts are cached based on the string value of their queries. -func NewStmtCache(prep PreparerContext) *StmtCache { - return &StmtCache{prep: prep, cache: make(map[string]*sql.Stmt)} -} - -// NewStmtCacher is deprecated -// -// Use NewStmtCache instead -func NewStmtCacher(prep PreparerContext) DBProxyContext { - return NewStmtCache(prep) -} - -// PrepareContext delegates down to the underlying PreparerContext and caches the result -// using the provided query as a key -func (sc *StmtCache) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { - ctxPrep, ok := sc.prep.(PreparerContext) - if !ok { - return nil, NoContextSupport - } - sc.mu.Lock() - defer sc.mu.Unlock() - stmt, ok := sc.cache[query] - if ok { - return stmt, nil - } - stmt, err := ctxPrep.PrepareContext(ctx, query) - if err == nil { - sc.cache[query] = stmt - } - return stmt, err -} - -// ExecContext delegates down to the underlying PreparerContext using a prepared statement -func (sc *StmtCache) ExecContext(ctx context.Context, query string, args ...interface{}) (res sql.Result, err error) { - stmt, err := sc.PrepareContext(ctx, query) - if err != nil { - return - } - return stmt.ExecContext(ctx, args...) -} - -// QueryContext delegates down to the underlying PreparerContext using a prepared statement -func (sc *StmtCache) QueryContext(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) { - stmt, err := sc.PrepareContext(ctx, query) - if err != nil { - return - } - return stmt.QueryContext(ctx, args...) -} - -// QueryRowContext delegates down to the underlying PreparerContext using a prepared statement -func (sc *StmtCache) QueryRowContext(ctx context.Context, query string, args ...interface{}) RowScanner { - stmt, err := sc.PrepareContext(ctx, query) - if err != nil { - return &Row{err: err} - } - return stmt.QueryRowContext(ctx, args...) -} diff --git a/vendor/github.com/Masterminds/squirrel/stmtcacher_noctx.go b/vendor/github.com/Masterminds/squirrel/stmtcacher_noctx.go deleted file mode 100644 index deac96777b..0000000000 --- a/vendor/github.com/Masterminds/squirrel/stmtcacher_noctx.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build !go1.8 - -package squirrel - -import ( - "database/sql" -) - -// NewStmtCacher returns a DBProxy wrapping prep that caches Prepared Stmts. -// -// Stmts are cached based on the string value of their queries. -func NewStmtCache(prep Preparer) *StmtCache { - return &StmtCacher{prep: prep, cache: make(map[string]*sql.Stmt)} -} - -// NewStmtCacher is deprecated -// -// Use NewStmtCache instead -func NewStmtCacher(prep Preparer) DBProxy { - return NewStmtCache(prep) -} diff --git a/vendor/github.com/Masterminds/squirrel/update.go b/vendor/github.com/Masterminds/squirrel/update.go deleted file mode 100644 index eb2a9c4dd9..0000000000 --- a/vendor/github.com/Masterminds/squirrel/update.go +++ /dev/null @@ -1,288 +0,0 @@ -package squirrel - -import ( - "bytes" - "database/sql" - "fmt" - "sort" - "strings" - - "github.com/lann/builder" -) - -type updateData struct { - PlaceholderFormat PlaceholderFormat - RunWith BaseRunner - Prefixes []Sqlizer - Table string - SetClauses []setClause - From Sqlizer - WhereParts []Sqlizer - OrderBys []string - Limit string - Offset string - Suffixes []Sqlizer -} - -type setClause struct { - column string - value interface{} -} - -func (d *updateData) Exec() (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return ExecWith(d.RunWith, d) -} - -func (d *updateData) Query() (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - return QueryWith(d.RunWith, d) -} - -func (d *updateData) QueryRow() RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRower) - if !ok { - return &Row{err: RunnerNotQueryRunner} - } - return QueryRowWith(queryRower, d) -} - -func (d *updateData) ToSql() (sqlStr string, args []interface{}, err error) { - if len(d.Table) == 0 { - err = fmt.Errorf("update statements must specify a table") - return - } - if len(d.SetClauses) == 0 { - err = fmt.Errorf("update statements must have at least one Set clause") - return - } - - sql := &bytes.Buffer{} - - if len(d.Prefixes) > 0 { - args, err = appendToSql(d.Prefixes, sql, " ", args) - if err != nil { - return - } - - sql.WriteString(" ") - } - - sql.WriteString("UPDATE ") - sql.WriteString(d.Table) - - sql.WriteString(" SET ") - setSqls := make([]string, len(d.SetClauses)) - for i, setClause := range d.SetClauses { - var valSql string - if vs, ok := setClause.value.(Sqlizer); ok { - vsql, vargs, err := vs.ToSql() - if err != nil { - return "", nil, err - } - if _, ok := vs.(SelectBuilder); ok { - valSql = fmt.Sprintf("(%s)", vsql) - } else { - valSql = vsql - } - args = append(args, vargs...) - } else { - valSql = "?" - args = append(args, setClause.value) - } - setSqls[i] = fmt.Sprintf("%s = %s", setClause.column, valSql) - } - sql.WriteString(strings.Join(setSqls, ", ")) - - if d.From != nil { - sql.WriteString(" FROM ") - args, err = appendToSql([]Sqlizer{d.From}, sql, "", args) - if err != nil { - return - } - } - - if len(d.WhereParts) > 0 { - sql.WriteString(" WHERE ") - args, err = appendToSql(d.WhereParts, sql, " AND ", args) - if err != nil { - return - } - } - - if len(d.OrderBys) > 0 { - sql.WriteString(" ORDER BY ") - sql.WriteString(strings.Join(d.OrderBys, ", ")) - } - - if len(d.Limit) > 0 { - sql.WriteString(" LIMIT ") - sql.WriteString(d.Limit) - } - - if len(d.Offset) > 0 { - sql.WriteString(" OFFSET ") - sql.WriteString(d.Offset) - } - - if len(d.Suffixes) > 0 { - sql.WriteString(" ") - args, err = appendToSql(d.Suffixes, sql, " ", args) - if err != nil { - return - } - } - - sqlStr, err = d.PlaceholderFormat.ReplacePlaceholders(sql.String()) - return -} - -// Builder - -// UpdateBuilder builds SQL UPDATE statements. -type UpdateBuilder builder.Builder - -func init() { - builder.Register(UpdateBuilder{}, updateData{}) -} - -// Format methods - -// PlaceholderFormat sets PlaceholderFormat (e.g. Question or Dollar) for the -// query. -func (b UpdateBuilder) PlaceholderFormat(f PlaceholderFormat) UpdateBuilder { - return builder.Set(b, "PlaceholderFormat", f).(UpdateBuilder) -} - -// Runner methods - -// RunWith sets a Runner (like database/sql.DB) to be used with e.g. Exec. -func (b UpdateBuilder) RunWith(runner BaseRunner) UpdateBuilder { - return setRunWith(b, runner).(UpdateBuilder) -} - -// Exec builds and Execs the query with the Runner set by RunWith. -func (b UpdateBuilder) Exec() (sql.Result, error) { - data := builder.GetStruct(b).(updateData) - return data.Exec() -} - -func (b UpdateBuilder) Query() (*sql.Rows, error) { - data := builder.GetStruct(b).(updateData) - return data.Query() -} - -func (b UpdateBuilder) QueryRow() RowScanner { - data := builder.GetStruct(b).(updateData) - return data.QueryRow() -} - -func (b UpdateBuilder) Scan(dest ...interface{}) error { - return b.QueryRow().Scan(dest...) -} - -// SQL methods - -// ToSql builds the query into a SQL string and bound args. -func (b UpdateBuilder) ToSql() (string, []interface{}, error) { - data := builder.GetStruct(b).(updateData) - return data.ToSql() -} - -// MustSql builds the query into a SQL string and bound args. -// It panics if there are any errors. -func (b UpdateBuilder) MustSql() (string, []interface{}) { - sql, args, err := b.ToSql() - if err != nil { - panic(err) - } - return sql, args -} - -// Prefix adds an expression to the beginning of the query -func (b UpdateBuilder) Prefix(sql string, args ...interface{}) UpdateBuilder { - return b.PrefixExpr(Expr(sql, args...)) -} - -// PrefixExpr adds an expression to the very beginning of the query -func (b UpdateBuilder) PrefixExpr(expr Sqlizer) UpdateBuilder { - return builder.Append(b, "Prefixes", expr).(UpdateBuilder) -} - -// Table sets the table to be updated. -func (b UpdateBuilder) Table(table string) UpdateBuilder { - return builder.Set(b, "Table", table).(UpdateBuilder) -} - -// Set adds SET clauses to the query. -func (b UpdateBuilder) Set(column string, value interface{}) UpdateBuilder { - return builder.Append(b, "SetClauses", setClause{column: column, value: value}).(UpdateBuilder) -} - -// SetMap is a convenience method which calls .Set for each key/value pair in clauses. -func (b UpdateBuilder) SetMap(clauses map[string]interface{}) UpdateBuilder { - keys := make([]string, len(clauses)) - i := 0 - for key := range clauses { - keys[i] = key - i++ - } - sort.Strings(keys) - for _, key := range keys { - val, _ := clauses[key] - b = b.Set(key, val) - } - return b -} - -// From adds FROM clause to the query -// FROM is valid construct in postgresql only. -func (b UpdateBuilder) From(from string) UpdateBuilder { - return builder.Set(b, "From", newPart(from)).(UpdateBuilder) -} - -// FromSelect sets a subquery into the FROM clause of the query. -func (b UpdateBuilder) FromSelect(from SelectBuilder, alias string) UpdateBuilder { - // Prevent misnumbered parameters in nested selects (#183). - from = from.PlaceholderFormat(Question) - return builder.Set(b, "From", Alias(from, alias)).(UpdateBuilder) -} - -// Where adds WHERE expressions to the query. -// -// See SelectBuilder.Where for more information. -func (b UpdateBuilder) Where(pred interface{}, args ...interface{}) UpdateBuilder { - return builder.Append(b, "WhereParts", newWherePart(pred, args...)).(UpdateBuilder) -} - -// OrderBy adds ORDER BY expressions to the query. -func (b UpdateBuilder) OrderBy(orderBys ...string) UpdateBuilder { - return builder.Extend(b, "OrderBys", orderBys).(UpdateBuilder) -} - -// Limit sets a LIMIT clause on the query. -func (b UpdateBuilder) Limit(limit uint64) UpdateBuilder { - return builder.Set(b, "Limit", fmt.Sprintf("%d", limit)).(UpdateBuilder) -} - -// Offset sets a OFFSET clause on the query. -func (b UpdateBuilder) Offset(offset uint64) UpdateBuilder { - return builder.Set(b, "Offset", fmt.Sprintf("%d", offset)).(UpdateBuilder) -} - -// Suffix adds an expression to the end of the query -func (b UpdateBuilder) Suffix(sql string, args ...interface{}) UpdateBuilder { - return b.SuffixExpr(Expr(sql, args...)) -} - -// SuffixExpr adds an expression to the end of the query -func (b UpdateBuilder) SuffixExpr(expr Sqlizer) UpdateBuilder { - return builder.Append(b, "Suffixes", expr).(UpdateBuilder) -} diff --git a/vendor/github.com/Masterminds/squirrel/update_ctx.go b/vendor/github.com/Masterminds/squirrel/update_ctx.go deleted file mode 100644 index ad479f96f4..0000000000 --- a/vendor/github.com/Masterminds/squirrel/update_ctx.go +++ /dev/null @@ -1,69 +0,0 @@ -// +build go1.8 - -package squirrel - -import ( - "context" - "database/sql" - - "github.com/lann/builder" -) - -func (d *updateData) ExecContext(ctx context.Context) (sql.Result, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(ExecerContext) - if !ok { - return nil, NoContextSupport - } - return ExecContextWith(ctx, ctxRunner, d) -} - -func (d *updateData) QueryContext(ctx context.Context) (*sql.Rows, error) { - if d.RunWith == nil { - return nil, RunnerNotSet - } - ctxRunner, ok := d.RunWith.(QueryerContext) - if !ok { - return nil, NoContextSupport - } - return QueryContextWith(ctx, ctxRunner, d) -} - -func (d *updateData) QueryRowContext(ctx context.Context) RowScanner { - if d.RunWith == nil { - return &Row{err: RunnerNotSet} - } - queryRower, ok := d.RunWith.(QueryRowerContext) - if !ok { - if _, ok := d.RunWith.(QueryerContext); !ok { - return &Row{err: RunnerNotQueryRunner} - } - return &Row{err: NoContextSupport} - } - return QueryRowContextWith(ctx, queryRower, d) -} - -// ExecContext builds and ExecContexts the query with the Runner set by RunWith. -func (b UpdateBuilder) ExecContext(ctx context.Context) (sql.Result, error) { - data := builder.GetStruct(b).(updateData) - return data.ExecContext(ctx) -} - -// QueryContext builds and QueryContexts the query with the Runner set by RunWith. -func (b UpdateBuilder) QueryContext(ctx context.Context) (*sql.Rows, error) { - data := builder.GetStruct(b).(updateData) - return data.QueryContext(ctx) -} - -// QueryRowContext builds and QueryRowContexts the query with the Runner set by RunWith. -func (b UpdateBuilder) QueryRowContext(ctx context.Context) RowScanner { - data := builder.GetStruct(b).(updateData) - return data.QueryRowContext(ctx) -} - -// ScanContext is a shortcut for QueryRowContext().Scan. -func (b UpdateBuilder) ScanContext(ctx context.Context, dest ...interface{}) error { - return b.QueryRowContext(ctx).Scan(dest...) -} diff --git a/vendor/github.com/Masterminds/squirrel/where.go b/vendor/github.com/Masterminds/squirrel/where.go deleted file mode 100644 index 976b63ace4..0000000000 --- a/vendor/github.com/Masterminds/squirrel/where.go +++ /dev/null @@ -1,30 +0,0 @@ -package squirrel - -import ( - "fmt" -) - -type wherePart part - -func newWherePart(pred interface{}, args ...interface{}) Sqlizer { - return &wherePart{pred: pred, args: args} -} - -func (p wherePart) ToSql() (sql string, args []interface{}, err error) { - switch pred := p.pred.(type) { - case nil: - // no-op - case rawSqlizer: - return pred.toSqlRaw() - case Sqlizer: - return pred.ToSql() - case map[string]interface{}: - return Eq(pred).ToSql() - case string: - sql = pred - args = p.args - default: - err = fmt.Errorf("expected string-keyed map or string, not %T", pred) - } - return -} diff --git a/vendor/github.com/Masterminds/vcs/.gitignore b/vendor/github.com/Masterminds/vcs/.gitignore deleted file mode 100644 index daf913b1b3..0000000000 --- a/vendor/github.com/Masterminds/vcs/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/Masterminds/vcs/.golangci.yml b/vendor/github.com/Masterminds/vcs/.golangci.yml deleted file mode 100644 index bd2463cfa4..0000000000 --- a/vendor/github.com/Masterminds/vcs/.golangci.yml +++ /dev/null @@ -1,24 +0,0 @@ -linters: - disable-all: true - enable: - - deadcode - - dupl - - gofmt - - goimports - - gosimple - - govet - - ineffassign - - nakedret - - revive - - structcheck - - unused - - varcheck - - staticcheck - -linters-settings: - gofmt: - simplify: true - goimports: - local-prefixes: helm.sh/helm/v3 - dupl: - threshold: 400 diff --git a/vendor/github.com/Masterminds/vcs/CHANGELOG.md b/vendor/github.com/Masterminds/vcs/CHANGELOG.md deleted file mode 100644 index aa797657db..0000000000 --- a/vendor/github.com/Masterminds/vcs/CHANGELOG.md +++ /dev/null @@ -1,204 +0,0 @@ -# Changelog - -## 1.13.3 (2022-03-31) - -### Fixed - -- Case sensitive use of the module name - -## 1.13.2 (2022-03-30) - -### Fixed - -- Fix for CVE-2022-21235 -- #103: Fixed CI testing. This included moving to GitHub Actions, updating the - the Git submodule handling, and skipping bzr tests on Windows (bzr has - discontinued and the installer now installs a broken environment) - -## 1.13.1 (2019-07-09) - -### Fixed - -- #101: Updated bitbucket API call as previous API was removed -- #97: Fixed travis ci building -- #95: Fixed "git clean" invocation for submodule - -## 1.13.0 (2019-02-27) - -### Changed - -- #92: Allow non-200 remote lookup responses for Go style redirects - -### Fixed - -- #91: For Mercurial/Hg return an error if Version() called and Hg prints to stderr -- #87 and #93: Fix CI issues - -## 1.12.0 (2017-09-11) - -### Changed - -- #79: Include the error context in the error string (thanks @guywithnose) -- #80: Bump the Go versions for Travis CI testing (thanks @AlekSi) - -## 1.11.1 (2017-04-28) - -### Fixed - -- #76: Fix submodule handling for Windows (thanks @m0j0hn) - -## 1.11.0 (2017-03-23) - -### Added - -- #65: Exposed CmdFromDir function (thanks @erizocosmico) - -### Changed - -- #69: Updated testing for Go 1.8 - -### Fixed - -- #64: Testing fatal error if bzr not installed (thanks @kevinburke) - -## 1.10.2 (2017-01-24) - -### Fixed - -- #63: Remove extra quotes in submodule export (thanks @dt) - -## 1.10.1 (2017-01-18) - -### Fixed - -- #62: Added windows testing via appveyor and fixed issues under windows. - -## 1.10.0 (2017-01-09) - -### Added - -- #60: Handle Git submodules (thanks @sdboyer) -- #61: Add gometalinter to testing - -## 1.9.0 (2016-11-18) - -### Added - -- #50: Auto-detect remotes with file:// prefix. -- #59: Testing against Go 1.7 - -### Changed - -- Removed auto-detection for Google Code as the service is deprecated -- Added auto-detection of git.openstack.org - -### Fixed - -- #53: Git not fetching tags off branch - -## 1.8.0 (2016-06-29) - -### Added - -- #43: Detect when tool (e.g., git, svn, etc) not installed -- #49: Detect access denied and not found situations - -### Changed - -- #48: Updated Go Report Gard url to new format -- Refactored SVN handling to detect when not in a top level directory -- Updating tagging to v[SemVer] structure for compatibility with other tools. - -### Fixed - -- #45: Fixed hg's update method so that it pulls from remote before updates - -## 1.7.0 (2016-05-05) - -- Adds a glide.yaml file with some limited information. -- Implements #37: Ability to export source as a directory. -- Implements #36: Get current version-ish with Current method. This returns - a branch (if on tip) or equivalent tip, a tag if on a tag, or a revision if - on an individual revision. Note, the tip of branch is VCS specific so usage - may require detecting VCS type. - -## 1.6.1 (2016-04-27) - -- Fixed #30: tags from commit should not have ^{} appended (seen in git) -- Fixed #29: isDetachedHead fails with non-english locales (git) -- Fixed #33: Access denied and not found http errors causing xml parsing errors - -## 1.6.0 (2016-04-18) - -- Issue #26: Added Init method to initialize a repo at the local location - (thanks tony). -- Issue #19: Added method to retrieve tags for a commit. -- Issue #24: Reworked errors returned from common methods. Now differing - VCS implementations return the same errors. The original VCS specific error - is available on the error. See the docs for more details. -- Issue #25: Export the function RunFromDir which runs VCS commands from the - root of the local directory. This is useful for those that want to build and - extend on top of the vcs package (thanks tony). -- Issue #22: Added Ping command to test if remote location is present and - accessible. - -## 1.5.1 (2016-03-23) - -- Fixing bug parsing some Git commit dates. - -## 1.5.0 (2016-03-22) - -- Add Travis CI testing for Go 1.6. -- Issue #17: Add CommitInfo method allowing for a common way to get commit - metadata from all VCS. -- Autodetect types that have git@ or hg@ users. -- Autodetect git+ssh, bzr+ssh, git, and svn+ssh scheme urls. -- On Bitbucket for ssh style URLs retrieve the type from the URL. This allows - for private repo type detection. -- Issue #14: Autodetect ssh/scp style urls (thanks chonthu). - -## 1.4.1 (2016-03-07) - -- Fixes #16: some windows situations are unable to create parent directory. - -## 1.4.0 (2016-02-15) - -- Adding support for IBM JazzHub. - -## 1.3.1 (2016-01-27) - -- Issue #12: Failed to checkout Bzr repo when parent directory didn't - exist (thanks cyrilleverrier). - -## 1.3.0 (2015-11-09) - -- Issue #9: Added Date method to get the date/time of latest commit (thanks kamilchm). - -## 1.2.0 (2015-10-29) - -- Adding IsDirty method to detect a checkout with uncommitted changes. - -## 1.1.4 (2015-10-28) - -- Fixed #8: Git IsReference not detecting branches that have not been checked - out yet. - -## 1.1.3 (2015-10-21) - -- Fixing issue where there are multiple go-import statements for go redirects - -## 1.1.2 (2015-10-20) - -- Fixes #7: hg not checking out code when Get is called - -## 1.1.1 (2015-10-20) - -- Issue #6: Allow VCS commands to be run concurrently. - -## 1.1.0 (2015-10-19) - -- #5: Added output of failed command to returned errors. - -## 1.0.0 (2015-10-06) - -- Initial release. diff --git a/vendor/github.com/Masterminds/vcs/LICENSE.txt b/vendor/github.com/Masterminds/vcs/LICENSE.txt deleted file mode 100644 index 0da4aeadb0..0000000000 --- a/vendor/github.com/Masterminds/vcs/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -The Masterminds -Copyright (C) 2014-2015, Matt Butcher and Matt Farina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/vcs/Makefile b/vendor/github.com/Masterminds/vcs/Makefile deleted file mode 100644 index 13123bbffb..0000000000 --- a/vendor/github.com/Masterminds/vcs/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -GOLANGCI_LINT_VERSION?=1.45.0 -GOLANGCI_LINT_SHA256?=ca06a2b170f41a9e1e34d40ca88b15b8fed2d7e37310f0c08b7fc244c34292a9 -GOLANGCI_LINT=/usr/local/bin/golangci-lint - -$(GOLANGCI_LINT): - curl -sSLO https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz - shasum -a 256 golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz | grep "^${GOLANGCI_LINT_SHA256} " > /dev/null - tar -xf golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz - sudo mv golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint /usr/local/bin/golangci-lint - rm -rf golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64* - -.PHONY: test -test: - @echo "==> Running tests" - go test -v - -.PHONY: lint -lint: $(GOLANGCI_LINT) - @$(GOLANGCI_LINT) run diff --git a/vendor/github.com/Masterminds/vcs/README.md b/vendor/github.com/Masterminds/vcs/README.md deleted file mode 100644 index 0e4119998c..0000000000 --- a/vendor/github.com/Masterminds/vcs/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# VCS Repository Management for Go - -Manage repos in varying version control systems with ease through a common -interface. - -[![Linux Tests](https://github.com/Masterminds/vcs/actions/workflows/linux-tests.yaml/badge.svg)](https://github.com/Masterminds/vcs/actions/workflows/linux-tests.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/vcs)](https://goreportcard.com/report/github.com/Masterminds/vcs) -[![Windows Tests](https://github.com/Masterminds/vcs/actions/workflows/windows-tests.yaml/badge.svg)](https://github.com/Masterminds/vcs/actions/workflows/windows-tests.yaml) [![Docs](https://img.shields.io/static/v1?label=docs&message=reference&color=blue)](https://pkg.go.dev/github.com/Masterminds/vcs) - -**Note: Module names are case sensitive. Please be sure to use `github.com/Masterminds/vcs` with the capital M.** - -## Quick Usage - -Quick usage: - - remote := "https://github.com/Masterminds/vcs" - local, _ := ioutil.TempDir("", "go-vcs") - repo, err := NewRepo(remote, local) - -In this case `NewRepo` will detect the VCS is Git and return a `GitRepo`. All of -the repos implement the `Repo` interface with a common set of features between -them. - -## Supported VCS - -Git, SVN, Bazaar (Bzr), and Mercurial (Hg) are currently supported. They each -have their own type (e.g., `GitRepo`) that follow a simple naming pattern. Each -type implements the `Repo` interface and has a constructor (e.g., `NewGitRepo`). -The constructors have the same signature as `NewRepo`. - -## Features - -- Clone or checkout a repository depending on the version control system. -- Pull updates to a repository. -- Get the currently checked out commit id. -- Checkout a commit id, branch, or tag (depending on the availability in the VCS). -- Get a list of tags and branches in the VCS. -- Check if a string value is a valid reference within the VCS. -- More... - -For more details see [the documentation](https://godoc.org/github.com/Masterminds/vcs). - -## Motivation - -The package `golang.org/x/tools/go/vcs` provides some valuable functionality -for working with packages in repositories in varying source control management -systems. That package, while useful and well tested, is designed with a specific -purpose in mind. Our uses went beyond the scope of that package. To implement -our scope we built a package that went beyond the functionality and scope -of `golang.org/x/tools/go/vcs`. diff --git a/vendor/github.com/Masterminds/vcs/bzr.go b/vendor/github.com/Masterminds/vcs/bzr.go deleted file mode 100644 index 9803d20cd3..0000000000 --- a/vendor/github.com/Masterminds/vcs/bzr.go +++ /dev/null @@ -1,342 +0,0 @@ -package vcs - -import ( - "fmt" - "net/url" - "os" - "os/exec" - "path/filepath" - "regexp" - "strings" - "time" -) - -var bzrDetectURL = regexp.MustCompile("parent branch: (?P.+)\n") - -// NewBzrRepo creates a new instance of BzrRepo. The remote and local directories -// need to be passed in. -func NewBzrRepo(remote, local string) (*BzrRepo, error) { - ins := depInstalled("bzr") - if !ins { - return nil, NewLocalError("bzr is not installed", nil, "") - } - ltype, err := DetectVcsFromFS(local) - - // Found a VCS other than Bzr. Need to report an error. - if err == nil && ltype != Bzr { - return nil, ErrWrongVCS - } - - r := &BzrRepo{} - r.setRemote(remote) - r.setLocalPath(local) - r.Logger = Logger - - // With the other VCS we can check if the endpoint locally is different - // from the one configured internally. But, with Bzr you can't. For example, - // if you do `bzr branch https://launchpad.net/govcstestbzrrepo` and then - // use `bzr info` to get the parent branch you'll find it set to - // http://bazaar.launchpad.net/~mattfarina/govcstestbzrrepo/trunk/. Notice - // the change from https to http and the path chance. - // Here we set the remote to be the local one if none is passed in. - if err == nil && r.CheckLocal() && remote == "" { - c := exec.Command("bzr", "info") - c.Dir = local - c.Env = envForDir(c.Dir) - out, err := c.CombinedOutput() - if err != nil { - return nil, NewLocalError("Unable to retrieve local repo information", err, string(out)) - } - m := bzrDetectURL.FindStringSubmatch(string(out)) - - // If no remote was passed in but one is configured for the locally - // checked out Bzr repo use that one. - if m[1] != "" { - r.setRemote(m[1]) - } - } - - return r, nil -} - -// BzrRepo implements the Repo interface for the Bzr source control. -type BzrRepo struct { - base -} - -// Vcs retrieves the underlying VCS being implemented. -func (s BzrRepo) Vcs() Type { - return Bzr -} - -// Get is used to perform an initial clone of a repository. -func (s *BzrRepo) Get() error { - - basePath := filepath.Dir(filepath.FromSlash(s.LocalPath())) - if _, err := os.Stat(basePath); os.IsNotExist(err) { - err = os.MkdirAll(basePath, 0755) - if err != nil { - return NewLocalError("Unable to create directory", err, "") - } - } - - out, err := s.run("bzr", "branch", "--", s.Remote(), s.LocalPath()) - if err != nil { - return NewRemoteError("Unable to get repository", err, string(out)) - } - - return nil -} - -// Init initializes a bazaar repository at local location. -func (s *BzrRepo) Init() error { - out, err := s.run("bzr", "init", "--", s.LocalPath()) - - // There are some windows cases where bazaar cannot create the parent - // directory if it does not already exist, to the location it's trying - // to create the repo. Catch that error and try to handle it. - if err != nil && s.isUnableToCreateDir(err) { - - basePath := filepath.Dir(filepath.FromSlash(s.LocalPath())) - if _, err := os.Stat(basePath); os.IsNotExist(err) { - err = os.MkdirAll(basePath, 0755) - if err != nil { - return NewLocalError("Unable to initialize repository", err, "") - } - - out, err = s.run("bzr", "init", "--", s.LocalPath()) - if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - return nil - } - - } else if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - - return nil -} - -// Update performs a Bzr pull and update to an existing checkout. -func (s *BzrRepo) Update() error { - out, err := s.RunFromDir("bzr", "pull") - if err != nil { - return NewRemoteError("Unable to update repository", err, string(out)) - } - out, err = s.RunFromDir("bzr", "update") - if err != nil { - return NewRemoteError("Unable to update repository", err, string(out)) - } - return nil -} - -// UpdateVersion sets the version of a package currently checked out via Bzr. -func (s *BzrRepo) UpdateVersion(version string) error { - out, err := s.RunFromDir("bzr", "update", "-r", version) - if err != nil { - return NewLocalError("Unable to update checked out version", err, string(out)) - } - return nil -} - -// Version retrieves the current version. -func (s *BzrRepo) Version() (string, error) { - - out, err := s.RunFromDir("bzr", "revno", "--tree") - if err != nil { - return "", NewLocalError("Unable to retrieve checked out version", err, string(out)) - } - - return strings.TrimSpace(string(out)), nil -} - -// Current returns the current version-ish. This means: -// * -1 if on the tip of the branch (this is the Bzr value for HEAD) -// * A tag if on a tag -// * Otherwise a revision -func (s *BzrRepo) Current() (string, error) { - tip, err := s.CommitInfo("-1") - if err != nil { - return "", err - } - - curr, err := s.Version() - if err != nil { - return "", err - } - - if tip.Commit == curr { - return "-1", nil - } - - ts, err := s.TagsFromCommit(curr) - if err != nil { - return "", err - } - if len(ts) > 0 { - return ts[0], nil - } - - return curr, nil -} - -// Date retrieves the date on the latest commit. -func (s *BzrRepo) Date() (time.Time, error) { - out, err := s.RunFromDir("bzr", "version-info", "--custom", "--template={date}") - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - t, err := time.Parse(longForm, string(out)) - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - return t, nil -} - -// CheckLocal verifies the local location is a Bzr repo. -func (s *BzrRepo) CheckLocal() bool { - if _, err := os.Stat(s.LocalPath() + "/.bzr"); err == nil { - return true - } - - return false -} - -// Branches returns a list of available branches on the repository. -// In Bazaar (Bzr) clones and branches are the same. A different branch will -// have a different URL location which we cannot detect from the repo. This -// is a little different from other VCS. -func (s *BzrRepo) Branches() ([]string, error) { - var branches []string - return branches, nil -} - -// Tags returns a list of available tags on the repository. -func (s *BzrRepo) Tags() ([]string, error) { - out, err := s.RunFromDir("bzr", "tags") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - tags := s.referenceList(string(out), `(?m-s)^(\S+)`) - return tags, nil -} - -// IsReference returns if a string is a reference. A reference can be a -// commit id or tag. -func (s *BzrRepo) IsReference(r string) bool { - _, err := s.RunFromDir("bzr", "revno", "-r", r) - return err == nil -} - -// IsDirty returns if the checkout has been modified from the checked -// out reference. -func (s *BzrRepo) IsDirty() bool { - out, err := s.RunFromDir("bzr", "diff") - return err != nil || len(out) != 0 -} - -// CommitInfo retrieves metadata about a commit. -func (s *BzrRepo) CommitInfo(id string) (*CommitInfo, error) { - r := "-r" + id - out, err := s.RunFromDir("bzr", "log", r, "--log-format=long") - if err != nil { - return nil, ErrRevisionUnavailable - } - - ci := &CommitInfo{} - lines := strings.Split(string(out), "\n") - const format = "Mon 2006-01-02 15:04:05 -0700" - var track int - var trackOn bool - - // Note, bzr does not appear to use i18m. - for i, l := range lines { - if strings.HasPrefix(l, "revno:") { - ci.Commit = strings.TrimSpace(strings.TrimPrefix(l, "revno:")) - } else if strings.HasPrefix(l, "committer:") { - ci.Author = strings.TrimSpace(strings.TrimPrefix(l, "committer:")) - } else if strings.HasPrefix(l, "timestamp:") { - ts := strings.TrimSpace(strings.TrimPrefix(l, "timestamp:")) - ci.Date, err = time.Parse(format, ts) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - } else if strings.TrimSpace(l) == "message:" { - track = i - trackOn = true - } else if trackOn && i > track { - ci.Message = ci.Message + l - } - } - ci.Message = strings.TrimSpace(ci.Message) - - // Didn't find the revision - if ci.Author == "" { - return nil, ErrRevisionUnavailable - } - - return ci, nil -} - -// TagsFromCommit retrieves tags from a commit id. -func (s *BzrRepo) TagsFromCommit(id string) ([]string, error) { - out, err := s.RunFromDir("bzr", "tags", "-r", id) - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - - tags := s.referenceList(string(out), `(?m-s)^(\S+)`) - return tags, nil -} - -// Ping returns if remote location is accessible. -func (s *BzrRepo) Ping() bool { - - // Running bzr info is slow. Many of the projects are on launchpad which - // has a public 1.0 API we can use. - u, err := url.Parse(s.Remote()) - if err == nil { - if u.Host == "launchpad.net" { - try := strings.TrimPrefix(u.Path, "/") - - // get returns the body and an err. If the status code is not a 200 - // an error is returned. Launchpad returns a 404 for a codebase that - // does not exist. Otherwise it returns a JSON object describing it. - _, er := get("https://api.launchpad.net/1.0/" + try) - return er == nil - } - } - - // This is the same command that Go itself uses but it's not fast (or fast - // enough by my standards). A faster method would be useful. - _, err = s.run("bzr", "info", "--", s.Remote()) - return err == nil -} - -// ExportDir exports the current revision to the passed in directory. -func (s *BzrRepo) ExportDir(dir string) error { - out, err := s.RunFromDir("bzr", "export", "--", dir) - s.log(out) - if err != nil { - return NewLocalError("Unable to export source", err, string(out)) - } - - return nil -} - -// Multi-lingual manner check for the VCS error that it couldn't create directory. -// https://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev/files/head:/po/ -func (s *BzrRepo) isUnableToCreateDir(err error) bool { - msg := err.Error() - - if strings.HasPrefix(msg, fmt.Sprintf("Parent directory of %s does not exist.", s.LocalPath())) || - strings.HasPrefix(msg, fmt.Sprintf("NadÅ™azený adresář %s neexistuje.", s.LocalPath())) || - strings.HasPrefix(msg, fmt.Sprintf("El directorio padre de %s no existe.", s.LocalPath())) || - strings.HasPrefix(msg, fmt.Sprintf("%s ã®è¦ªãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãŒã‚りã¾ã›ã‚“。", s.LocalPath())) || - strings.HasPrefix(msg, fmt.Sprintf("РодительÑÐºÐ°Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð´Ð»Ñ %s не ÑущеÑтвует.", s.LocalPath())) { - return true - } - - return false -} diff --git a/vendor/github.com/Masterminds/vcs/errors.go b/vendor/github.com/Masterminds/vcs/errors.go deleted file mode 100644 index b1eb464f0a..0000000000 --- a/vendor/github.com/Masterminds/vcs/errors.go +++ /dev/null @@ -1,114 +0,0 @@ -package vcs - -import ( - "errors" - "fmt" -) - -// The vcs package provides ways to work with errors that hide the underlying -// implementation details but make them accessible if needed. For basic errors -// that do not have underlying implementation specific details or the underlying -// details are not necessary there are errors for comparison. -// -// For example: -// -// ci, err := repo.CommitInfo("123") -// if err == vcs.ErrRevisionUnavailable { -// // The commit id was not available in the VCS. -// } -// -// There are other times where getting the details are more useful. For example, -// if you're performing a repo.Get() and an error occurs. In general you'll want -// to consistently know it failed. But, you may want to know the underlying -// details (opt-in) to them. For those cases there is a different form of error -// handling. -// -// For example: -// -// err := repo.Get() -// if err != nil { -// // A RemoteError was returned. This has access to the output of the -// // vcs command, original error, and has a consistent cross vcs message. -// } -// -// The errors returned here can be used in type switches to detect the underlying -// error. For example: -// -// switch err.(type) { -// case *vcs.RemoteError: -// // This an error connecting to a remote system. -// } -// -// For more information on using type switches to detect error types you can -// read the Go wiki at https://github.com/golang/go/wiki/Errors - -var ( - // ErrWrongVCS is returned when an action is tried on the wrong VCS. - ErrWrongVCS = errors.New("Wrong VCS detected") - - // ErrCannotDetectVCS is returned when VCS cannot be detected from URI string. - ErrCannotDetectVCS = errors.New("Cannot detect VCS") - - // ErrWrongRemote occurs when the passed in remote does not match the VCS - // configured endpoint. - ErrWrongRemote = errors.New("The Remote does not match the VCS endpoint") - - // ErrRevisionUnavailable happens when commit revision information is - // unavailable. - ErrRevisionUnavailable = errors.New("Revision unavailable") -) - -// RemoteError is returned when an operation fails against a remote repo -type RemoteError struct { - vcsError -} - -// NewRemoteError constructs a RemoteError -func NewRemoteError(msg string, err error, out string) error { - e := &RemoteError{} - e.s = msg - e.e = err - e.o = out - - return e -} - -// LocalError is returned when a local operation has an error -type LocalError struct { - vcsError -} - -// NewLocalError constructs a LocalError -func NewLocalError(msg string, err error, out string) error { - e := &LocalError{} - e.s = msg - e.e = err - e.o = out - - return e -} - -type vcsError struct { - s string - e error // The original error - o string // The output from executing the command -} - -// Error implements the Error interface -func (e *vcsError) Error() string { - if e.e == nil { - return e.s - } - - return fmt.Sprintf("%s: %v", e.s, e.e) -} - -// Original retrieves the underlying implementation specific error. -func (e *vcsError) Original() error { - return e.e -} - -// Out retrieves the output of the original command that was run. -func (e *vcsError) Out() string { - return e.o -} diff --git a/vendor/github.com/Masterminds/vcs/git.go b/vendor/github.com/Masterminds/vcs/git.go deleted file mode 100644 index 2da0274bc1..0000000000 --- a/vendor/github.com/Masterminds/vcs/git.go +++ /dev/null @@ -1,457 +0,0 @@ -package vcs - -import ( - "bytes" - "encoding/xml" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "runtime" - "strings" - "time" -) - -// NewGitRepo creates a new instance of GitRepo. The remote and local directories -// need to be passed in. -func NewGitRepo(remote, local string) (*GitRepo, error) { - ins := depInstalled("git") - if !ins { - return nil, NewLocalError("git is not installed", nil, "") - } - ltype, err := DetectVcsFromFS(local) - - // Found a VCS other than Git. Need to report an error. - if err == nil && ltype != Git { - return nil, ErrWrongVCS - } - - r := &GitRepo{} - r.setRemote(remote) - r.setLocalPath(local) - r.RemoteLocation = "origin" - r.Logger = Logger - - // Make sure the local Git repo is configured the same as the remote when - // A remote value was passed in. - if err == nil && r.CheckLocal() { - c := exec.Command("git", "config", "--get", "remote.origin.url") - c.Dir = local - c.Env = envForDir(c.Dir) - out, err := c.CombinedOutput() - if err != nil { - return nil, NewLocalError("Unable to retrieve local repo information", err, string(out)) - } - - localRemote := strings.TrimSpace(string(out)) - if remote != "" && localRemote != remote { - return nil, ErrWrongRemote - } - - // If no remote was passed in but one is configured for the locally - // checked out Git repo use that one. - if remote == "" && localRemote != "" { - r.setRemote(localRemote) - } - } - - return r, nil -} - -// GitRepo implements the Repo interface for the Git source control. -type GitRepo struct { - base - RemoteLocation string -} - -// Vcs retrieves the underlying VCS being implemented. -func (s GitRepo) Vcs() Type { - return Git -} - -// Get is used to perform an initial clone of a repository. -func (s *GitRepo) Get() error { - out, err := s.run("git", "clone", "--recursive", "--", s.Remote(), s.LocalPath()) - - // There are some windows cases where Git cannot create the parent directory, - // if it does not already exist, to the location it's trying to create the - // repo. Catch that error and try to handle it. - if err != nil && s.isUnableToCreateDir(err) { - - basePath := filepath.Dir(filepath.FromSlash(s.LocalPath())) - if _, err := os.Stat(basePath); os.IsNotExist(err) { - err = os.MkdirAll(basePath, 0755) - if err != nil { - return NewLocalError("Unable to create directory", err, "") - } - - out, err = s.run("git", "clone", "--recursive", "--", s.Remote(), s.LocalPath()) - if err != nil { - return NewRemoteError("Unable to get repository", err, string(out)) - } - return err - } - - } else if err != nil { - return NewRemoteError("Unable to get repository", err, string(out)) - } - - return nil -} - -// Init initializes a git repository at local location. -func (s *GitRepo) Init() error { - out, err := s.run("git", "init", "--", s.LocalPath()) - - // There are some windows cases where Git cannot create the parent directory, - // if it does not already exist, to the location it's trying to create the - // repo. Catch that error and try to handle it. - if err != nil && s.isUnableToCreateDir(err) { - - basePath := filepath.Dir(filepath.FromSlash(s.LocalPath())) - if _, err := os.Stat(basePath); os.IsNotExist(err) { - err = os.MkdirAll(basePath, 0755) - if err != nil { - return NewLocalError("Unable to initialize repository", err, "") - } - - out, err = s.run("git", "init", "--", s.LocalPath()) - if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - return nil - } - - } else if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - - return nil -} - -// Update performs an Git fetch and pull to an existing checkout. -func (s *GitRepo) Update() error { - // Perform a fetch to make sure everything is up to date. - out, err := s.RunFromDir("git", "fetch", "--tags", "--", s.RemoteLocation) - if err != nil { - return NewRemoteError("Unable to update repository", err, string(out)) - } - - // When in a detached head state, such as when an individual commit is checked - // out do not attempt a pull. It will cause an error. - detached, err := isDetachedHead(s.LocalPath()) - if err != nil { - return NewLocalError("Unable to update repository", err, "") - } - - if detached { - return nil - } - - out, err = s.RunFromDir("git", "pull") - if err != nil { - return NewRemoteError("Unable to update repository", err, string(out)) - } - - return s.defendAgainstSubmodules() -} - -// UpdateVersion sets the version of a package currently checked out via Git. -func (s *GitRepo) UpdateVersion(version string) error { - out, err := s.RunFromDir("git", "checkout", version) - if err != nil { - return NewLocalError("Unable to update checked out version", err, string(out)) - } - - return s.defendAgainstSubmodules() -} - -// defendAgainstSubmodules tries to keep repo state sane in the event of -// submodules. Or nested submodules. What a great idea, submodules. -func (s *GitRepo) defendAgainstSubmodules() error { - // First, update them to whatever they should be, if there should happen to be any. - out, err := s.RunFromDir("git", "submodule", "update", "--init", "--recursive") - if err != nil { - return NewLocalError("Unexpected error while defensively updating submodules", err, string(out)) - } - // Now, do a special extra-aggressive clean in case changing versions caused - // one or more submodules to go away. - out, err = s.RunFromDir("git", "clean", "-x", "-d", "-f", "-f") - if err != nil { - return NewLocalError("Unexpected error while defensively cleaning up after possible derelict submodule directories", err, string(out)) - } - // Then, repeat just in case there are any nested submodules that went away. - out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "git clean -x -d -f -f") - if err != nil { - return NewLocalError("Unexpected error while defensively cleaning up after possible derelict nested submodule directories", err, string(out)) - } - - return nil -} - -// Version retrieves the current version. -func (s *GitRepo) Version() (string, error) { - out, err := s.RunFromDir("git", "rev-parse", "HEAD") - if err != nil { - return "", NewLocalError("Unable to retrieve checked out version", err, string(out)) - } - - return strings.TrimSpace(string(out)), nil -} - -// Current returns the current version-ish. This means: -// * Branch name if on the tip of the branch -// * Tag if on a tag -// * Otherwise a revision id -func (s *GitRepo) Current() (string, error) { - out, err := s.RunFromDir("git", "symbolic-ref", "HEAD") - if err == nil { - o := bytes.TrimSpace(bytes.TrimPrefix(out, []byte("refs/heads/"))) - return string(o), nil - } - - v, err := s.Version() - if err != nil { - return "", err - } - - ts, err := s.TagsFromCommit(v) - if err != nil { - return "", err - } - - if len(ts) > 0 { - return ts[0], nil - } - - return v, nil -} - -// Date retrieves the date on the latest commit. -func (s *GitRepo) Date() (time.Time, error) { - out, err := s.RunFromDir("git", "log", "-1", "--date=iso", "--pretty=format:%cd") - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - t, err := time.Parse(longForm, string(out)) - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - return t, nil -} - -// Branches returns a list of available branches on the RemoteLocation -func (s *GitRepo) Branches() ([]string, error) { - out, err := s.RunFromDir("git", "show-ref") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve branches", err, string(out)) - } - branches := s.referenceList(string(out), `(?m-s)(?:`+s.RemoteLocation+`)/(\S+)$`) - return branches, nil -} - -// Tags returns a list of available tags on the RemoteLocation -func (s *GitRepo) Tags() ([]string, error) { - out, err := s.RunFromDir("git", "show-ref") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - tags := s.referenceList(string(out), `(?m-s)(?:tags)/(\S+)$`) - return tags, nil -} - -// CheckLocal verifies the local location is a Git repo. -func (s *GitRepo) CheckLocal() bool { - if _, err := os.Stat(s.LocalPath() + "/.git"); err == nil { - return true - } - - return false -} - -// IsReference returns if a string is a reference. A reference can be a -// commit id, branch, or tag. -func (s *GitRepo) IsReference(r string) bool { - _, err := s.RunFromDir("git", "rev-parse", "--verify", r) - if err == nil { - return true - } - - // Some refs will fail rev-parse. For example, a remote branch that has - // not been checked out yet. This next step should pickup the other - // possible references. - _, err = s.RunFromDir("git", "show-ref", r) - return err == nil -} - -// IsDirty returns if the checkout has been modified from the checked -// out reference. -func (s *GitRepo) IsDirty() bool { - out, err := s.RunFromDir("git", "diff") - return err != nil || len(out) != 0 -} - -// CommitInfo retrieves metadata about a commit. -func (s *GitRepo) CommitInfo(id string) (*CommitInfo, error) { - fm := `--pretty=format:"%H%an <%ae>%aD%s"` - out, err := s.RunFromDir("git", "log", id, fm, "-1") - if err != nil { - return nil, ErrRevisionUnavailable - } - - cis := struct { - Commit string `xml:"commit"` - Author string `xml:"author"` - Date string `xml:"date"` - Message string `xml:"message"` - }{} - err = xml.Unmarshal(out, &cis) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - - t, err := time.Parse("Mon, _2 Jan 2006 15:04:05 -0700", cis.Date) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - - ci := &CommitInfo{ - Commit: cis.Commit, - Author: cis.Author, - Date: t, - Message: cis.Message, - } - - return ci, nil -} - -// TagsFromCommit retrieves tags from a commit id. -func (s *GitRepo) TagsFromCommit(id string) ([]string, error) { - // This is imperfect and a better method would be great. - - var re []string - - out, err := s.RunFromDir("git", "show-ref", "-d") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - - lines := strings.Split(string(out), "\n") - var list []string - for _, i := range lines { - if strings.HasPrefix(strings.TrimSpace(i), id) { - list = append(list, i) - } - } - tags := s.referenceList(strings.Join(list, "\n"), `(?m-s)(?:tags)/(\S+)$`) - for _, t := range tags { - // Dereferenced tags have ^{} appended to them. - re = append(re, strings.TrimSuffix(t, "^{}")) - } - - return re, nil -} - -// Ping returns if remote location is accessible. -func (s *GitRepo) Ping() bool { - c := exec.Command("git", "ls-remote", s.Remote()) - - // If prompted for a username and password, which GitHub does for all things - // not public, it's considered not available. To make it available the - // remote needs to be different. - c.Env = mergeEnvLists([]string{"GIT_TERMINAL_PROMPT=0"}, os.Environ()) - _, err := c.CombinedOutput() - return err == nil -} - -// EscapePathSeparator escapes the path separator by replacing it with several. -// Note: this is harmless on Unix, and needed on Windows. -func EscapePathSeparator(path string) string { - switch runtime.GOOS { - case `windows`: - // On Windows, triple all path separators. - // Needed to escape backslash(s) preceding doublequotes, - // because of how Windows strings treats backslash+doublequote combo, - // and Go seems to be implicitly passing around a doublequoted string on Windows, - // so we cannot use default string instead. - // See: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ - // e.g., C:\foo\bar\ -> C:\\\foo\\\bar\\\ - // used with --prefix, like this: --prefix=C:\foo\bar\ -> --prefix=C:\\\foo\\\bar\\\ - return strings.Replace(path, - string(os.PathSeparator), - string(os.PathSeparator)+string(os.PathSeparator)+string(os.PathSeparator), - -1) - default: - return path - } -} - -// ExportDir exports the current revision to the passed in directory. -func (s *GitRepo) ExportDir(dir string) error { - - var path string - - // Without the trailing / there can be problems. - if !strings.HasSuffix(dir, string(os.PathSeparator)) { - dir = dir + string(os.PathSeparator) - } - - // checkout-index on some systems, such as some Windows cases, does not - // create the parent directory to export into if it does not exist. Explicitly - // creating it. - err := os.MkdirAll(dir, 0755) - if err != nil { - return NewLocalError("Unable to create directory", err, "") - } - - path = EscapePathSeparator(dir) - out, err := s.RunFromDir("git", "checkout-index", "-f", "-a", "--prefix="+path) - s.log(out) - if err != nil { - return NewLocalError("Unable to export source", err, string(out)) - } - - // and now, the horror of submodules - handleSubmodules(s, dir) - - s.log(out) - if err != nil { - return NewLocalError("Error while exporting submodule sources", err, string(out)) - } - - return nil -} - -// isDetachedHead will detect if git repo is in "detached head" state. -func isDetachedHead(dir string) (bool, error) { - p := filepath.Join(dir, ".git", "HEAD") - contents, err := ioutil.ReadFile(p) - if err != nil { - return false, err - } - - contents = bytes.TrimSpace(contents) - if bytes.HasPrefix(contents, []byte("ref: ")) { - return false, nil - } - - return true, nil -} - -// isUnableToCreateDir checks for an error in Init() to see if an error -// where the parent directory of the VCS local path doesn't exist. This is -// done in a multi-lingual manner. -func (s *GitRepo) isUnableToCreateDir(err error) bool { - msg := err.Error() - if strings.HasPrefix(msg, "could not create work tree dir") || - strings.HasPrefix(msg, "ä¸èƒ½åˆ›å»ºå·¥ä½œåŒºç›®å½•") || - strings.HasPrefix(msg, "no s'ha pogut crear el directori d'arbre de treball") || - strings.HasPrefix(msg, "impossible de créer le répertoire de la copie de travail") || - strings.HasPrefix(msg, "kunde inte skapa arbetskatalogen") || - (strings.HasPrefix(msg, "Konnte Arbeitsverzeichnis") && strings.Contains(msg, "nicht erstellen")) || - (strings.HasPrefix(msg, "작업 디렉터리를") && strings.Contains(msg, "만들 수 없습니다")) { - return true - } - - return false -} diff --git a/vendor/github.com/Masterminds/vcs/git_unix.go b/vendor/github.com/Masterminds/vcs/git_unix.go deleted file mode 100644 index 16f380152d..0000000000 --- a/vendor/github.com/Masterminds/vcs/git_unix.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build !windows -// +build !windows - -package vcs - -import "os" - -func handleSubmodules(g *GitRepo, dir string) ([]byte, error) { - // Generate path - path := EscapePathSeparator(dir + "$path" + string(os.PathSeparator)) - - return g.RunFromDir("git", "submodule", "foreach", "--recursive", "git checkout-index -f -a --prefix="+path) -} diff --git a/vendor/github.com/Masterminds/vcs/git_windows.go b/vendor/github.com/Masterminds/vcs/git_windows.go deleted file mode 100644 index 2df3684ee5..0000000000 --- a/vendor/github.com/Masterminds/vcs/git_windows.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build windows -// +build windows - -package vcs - -import ( - "os" - "path/filepath" - "strings" -) - -func handleSubmodules(g *GitRepo, dir string) ([]byte, error) { - // Get the submodule directories - out, err := g.RunFromDir("git", "submodule", "foreach", "--quiet", "--recursive", "echo $sm_path") - if err != nil { - return out, err - } - cleanOut := strings.TrimSpace(string(out)) - pths := strings.Split(strings.ReplaceAll(cleanOut, "\r\n", "\n"), "\n") - - // Create the new directories. Directories are sometimes not created under - // Windows - for _, pth := range pths { - fpth := filepath.Join(dir + pth) - os.MkdirAll(fpth, 0755) - } - - // checkout-index for each submodule. Using $path or $sm_path while iterating - // over the submodules does not work in Windows when called from Go. - var cOut []byte - for _, pth := range pths { - // Get the path to the submodule in the exported location - fpth := EscapePathSeparator(filepath.Join(dir, pth) + string(os.PathSeparator)) - - // Call checkout-index directly in the submodule rather than in the - // parent project. This stils git submodule foreach that has trouble - // on Windows within Go where $sm_path isn't being handled properly - c := g.CmdFromDir("git", "checkout-index", "-f", "-a", "--prefix="+fpth) - c.Dir = filepath.Join(c.Dir, pth) - out, err := c.CombinedOutput() - cOut = append(cOut, out...) - if err != nil { - return cOut, err - } - } - return cOut, nil -} diff --git a/vendor/github.com/Masterminds/vcs/hg.go b/vendor/github.com/Masterminds/vcs/hg.go deleted file mode 100644 index 11e012c5da..0000000000 --- a/vendor/github.com/Masterminds/vcs/hg.go +++ /dev/null @@ -1,327 +0,0 @@ -package vcs - -import ( - "bytes" - "encoding/xml" - "errors" - "os" - "os/exec" - "regexp" - "strings" - "time" -) - -var hgDetectURL = regexp.MustCompile("default = (?P.+)\n") - -// NewHgRepo creates a new instance of HgRepo. The remote and local directories -// need to be passed in. -func NewHgRepo(remote, local string) (*HgRepo, error) { - ins := depInstalled("hg") - if !ins { - return nil, NewLocalError("hg is not installed", nil, "") - } - ltype, err := DetectVcsFromFS(local) - - // Found a VCS other than Hg. Need to report an error. - if err == nil && ltype != Hg { - return nil, ErrWrongVCS - } - - r := &HgRepo{} - r.setRemote(remote) - r.setLocalPath(local) - r.Logger = Logger - - // Make sure the local Hg repo is configured the same as the remote when - // A remote value was passed in. - if err == nil && r.CheckLocal() { - // An Hg repo was found so test that the URL there matches - // the repo passed in here. - c := exec.Command("hg", "paths") - c.Dir = local - c.Env = envForDir(c.Dir) - out, err := c.CombinedOutput() - if err != nil { - return nil, NewLocalError("Unable to retrieve local repo information", err, string(out)) - } - - m := hgDetectURL.FindStringSubmatch(string(out)) - if m[1] != "" && m[1] != remote { - return nil, ErrWrongRemote - } - - // If no remote was passed in but one is configured for the locally - // checked out Hg repo use that one. - if remote == "" && m[1] != "" { - r.setRemote(m[1]) - } - } - - return r, nil -} - -// HgRepo implements the Repo interface for the Mercurial source control. -type HgRepo struct { - base -} - -// Vcs retrieves the underlying VCS being implemented. -func (s HgRepo) Vcs() Type { - return Hg -} - -// Get is used to perform an initial clone of a repository. -func (s *HgRepo) Get() error { - out, err := s.run("hg", "clone", "--", s.Remote(), s.LocalPath()) - if err != nil { - return NewRemoteError("Unable to get repository", err, string(out)) - } - return nil -} - -// Init will initialize a mercurial repository at local location. -func (s *HgRepo) Init() error { - out, err := s.run("hg", "init", "--", s.LocalPath()) - if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - return nil -} - -// Update performs a Mercurial pull to an existing checkout. -func (s *HgRepo) Update() error { - return s.UpdateVersion(``) -} - -// UpdateVersion sets the version of a package currently checked out via Hg. -func (s *HgRepo) UpdateVersion(version string) error { - out, err := s.RunFromDir("hg", "pull") - if err != nil { - return NewLocalError("Unable to update checked out version", err, string(out)) - } - if len(strings.TrimSpace(version)) > 0 { - out, err = s.RunFromDir("hg", "update", "--", version) - } else { - out, err = s.RunFromDir("hg", "update") - } - if err != nil { - return NewLocalError("Unable to update checked out version", err, string(out)) - } - return nil -} - -// Version retrieves the current version. -func (s *HgRepo) Version() (string, error) { - c := s.CmdFromDir("hg", "--debug", "identify") - stdout, stderr := new(bytes.Buffer), new(bytes.Buffer) - c.Stdout = stdout - c.Stderr = stderr - if err := c.Run(); err != nil { - return "", NewLocalError("Unable to retrieve checked out version", err, stderr.String()) - } - if stderr.Len() > 0 { - // "hg --debug identify" can print out errors before it actually prints - // the version. - // https://github.com/Masterminds/vcs/issues/90 - return "", NewLocalError("Unable to retrieve checked out version", errors.New("Error output printed before identify"), stderr.String()) - } - parts := strings.SplitN(stdout.String(), " ", 2) - sha := parts[0] - return strings.TrimSpace(sha), nil -} - -// Current returns the current version-ish. This means: -// * Branch name if on the tip of the branch -// * Tag if on a tag -// * Otherwise a revision id -func (s *HgRepo) Current() (string, error) { - out, err := s.RunFromDir("hg", "branch") - if err != nil { - return "", err - } - branch := strings.TrimSpace(string(out)) - - tip, err := s.CommitInfo("max(branch(" + branch + "))") - if err != nil { - return "", err - } - - curr, err := s.Version() - if err != nil { - return "", err - } - - if tip.Commit == curr { - - return branch, nil - } - - ts, err := s.TagsFromCommit(curr) - if err != nil { - return "", err - } - if len(ts) > 0 { - return ts[0], nil - } - - return curr, nil -} - -// Date retrieves the date on the latest commit. -func (s *HgRepo) Date() (time.Time, error) { - version, err := s.Version() - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, "") - } - out, err := s.RunFromDir("hg", "log", "-r", version, "--template", "{date|isodatesec}") - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - t, err := time.Parse(longForm, string(out)) - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - return t, nil -} - -// CheckLocal verifies the local location is a Git repo. -func (s *HgRepo) CheckLocal() bool { - if _, err := os.Stat(s.LocalPath() + "/.hg"); err == nil { - return true - } - - return false -} - -// Branches returns a list of available branches -func (s *HgRepo) Branches() ([]string, error) { - out, err := s.RunFromDir("hg", "branches") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve branches", err, string(out)) - } - branches := s.referenceList(string(out), `(?m-s)^(\S+)`) - return branches, nil -} - -// Tags returns a list of available tags -func (s *HgRepo) Tags() ([]string, error) { - out, err := s.RunFromDir("hg", "tags") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - tags := s.referenceList(string(out), `(?m-s)^(\S+)`) - return tags, nil -} - -// IsReference returns if a string is a reference. A reference can be a -// commit id, branch, or tag. -func (s *HgRepo) IsReference(r string) bool { - _, err := s.RunFromDir("hg", "log", "-r", r) - return err == nil -} - -// IsDirty returns if the checkout has been modified from the checked -// out reference. -func (s *HgRepo) IsDirty() bool { - out, err := s.RunFromDir("hg", "diff") - return err != nil || len(out) != 0 -} - -// CommitInfo retrieves metadata about a commit. -func (s *HgRepo) CommitInfo(id string) (*CommitInfo, error) { - out, err := s.RunFromDir("hg", "log", "-r", id, "--style=xml") - if err != nil { - return nil, ErrRevisionUnavailable - } - - type Author struct { - Name string `xml:",chardata"` - Email string `xml:"email,attr"` - } - type Logentry struct { - Node string `xml:"node,attr"` - Author Author `xml:"author"` - Date string `xml:"date"` - Msg string `xml:"msg"` - } - type Log struct { - XMLName xml.Name `xml:"log"` - Logs []Logentry `xml:"logentry"` - } - - logs := &Log{} - err = xml.Unmarshal(out, &logs) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - if len(logs.Logs) == 0 { - return nil, ErrRevisionUnavailable - } - - ci := &CommitInfo{ - Commit: logs.Logs[0].Node, - Author: logs.Logs[0].Author.Name + " <" + logs.Logs[0].Author.Email + ">", - Message: logs.Logs[0].Msg, - } - - if logs.Logs[0].Date != "" { - ci.Date, err = time.Parse(time.RFC3339, logs.Logs[0].Date) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - } - - return ci, nil -} - -// TagsFromCommit retrieves tags from a commit id. -func (s *HgRepo) TagsFromCommit(id string) ([]string, error) { - // Hg has a single tag per commit. If a second tag is added to a commit a - // new commit is created and the tag is attached to that new commit. - out, err := s.RunFromDir("hg", "log", "-r", id, "--style=xml") - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - - type Logentry struct { - Node string `xml:"node,attr"` - Tag string `xml:"tag"` - } - type Log struct { - XMLName xml.Name `xml:"log"` - Logs []Logentry `xml:"logentry"` - } - - logs := &Log{} - err = xml.Unmarshal(out, &logs) - if err != nil { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - if len(logs.Logs) == 0 { - return []string{}, NewLocalError("Unable to retrieve tags", err, string(out)) - } - - t := strings.TrimSpace(logs.Logs[0].Tag) - if t != "" { - return []string{t}, nil - } - return []string{}, nil -} - -// Ping returns if remote location is accessible. -func (s *HgRepo) Ping() bool { - _, err := s.run("hg", "identify", "--", s.Remote()) - return err == nil -} - -// ExportDir exports the current revision to the passed in directory. -func (s *HgRepo) ExportDir(dir string) error { - - out, err := s.RunFromDir("hg", "archive", "--", dir) - s.log(out) - if err != nil { - return NewLocalError("Unable to export source", err, string(out)) - } - - return nil -} diff --git a/vendor/github.com/Masterminds/vcs/repo.go b/vendor/github.com/Masterminds/vcs/repo.go deleted file mode 100644 index 356dad6f9f..0000000000 --- a/vendor/github.com/Masterminds/vcs/repo.go +++ /dev/null @@ -1,276 +0,0 @@ -// Package vcs provides the ability to work with varying version control systems -// (VCS), also known as source control systems (SCM) though the same interface. -// -// This package includes a function that attempts to detect the repo type from -// the remote URL and return the proper type. For example, -// -// remote := "https://github.com/Masterminds/vcs" -// local, _ := ioutil.TempDir("", "go-vcs") -// repo, err := NewRepo(remote, local) -// -// In this case repo will be a GitRepo instance. NewRepo can detect the VCS for -// numerous popular VCS and from the URL. For example, a URL ending in .git -// that's not from one of the popular VCS will be detected as a Git repo and -// the correct type will be returned. -// -// If you know the repository type and would like to create an instance of a -// specific type you can use one of constructors for a type. They are NewGitRepo, -// NewSvnRepo, NewBzrRepo, and NewHgRepo. The definition and usage is the same -// as NewRepo. -// -// Once you have an object implementing the Repo interface the operations are -// the same no matter which VCS you're using. There are some caveats. For -// example, each VCS has its own version formats that need to be respected and -// checkout out branches, if a branch is being worked with, is different in -// each VCS. -package vcs - -import ( - "fmt" - "io/ioutil" - "log" - "os" - "os/exec" - "regexp" - "strings" - "time" -) - -// Logger is where you can provide a logger, implementing the log.Logger interface, -// where verbose output from each VCS will be written. The default logger does -// not log data. To log data supply your own logger or change the output location -// of the provided logger. -var Logger *log.Logger - -func init() { - // Initialize the logger to one that does not actually log anywhere. This is - // to be overridden by the package user by setting vcs.Logger to a different - // logger. - Logger = log.New(ioutil.Discard, "go-vcs", log.LstdFlags) -} - -const longForm = "2006-01-02 15:04:05 -0700" - -// Type describes the type of VCS -type Type string - -// VCS types -const ( - NoVCS Type = "" - Git Type = "git" - Svn Type = "svn" - Bzr Type = "bzr" - Hg Type = "hg" -) - -// Repo provides an interface to work with repositories using different source -// control systems such as Git, Bzr, Mercurial, and SVN. For implementations -// of this interface see BzrRepo, GitRepo, HgRepo, and SvnRepo. -type Repo interface { - - // Vcs retrieves the underlying VCS being implemented. - Vcs() Type - - // Remote retrieves the remote location for a repo. - Remote() string - - // LocalPath retrieves the local file system location for a repo. - LocalPath() string - - // Get is used to perform an initial clone/checkout of a repository. - Get() error - - // Initializes a new repository locally. - Init() error - - // Update performs an update to an existing checkout of a repository. - Update() error - - // UpdateVersion sets the version of a package of a repository. - UpdateVersion(string) error - - // Version retrieves the current version. - Version() (string, error) - - // Current retrieves the current version-ish. This is different from the - // Version method. The output could be a branch name if on the tip of a - // branch (git), a tag if on a tag, a revision if on a specific revision - // that's not the tip of the branch. The values here vary based on the VCS. - Current() (string, error) - - // Date retrieves the date on the latest commit. - Date() (time.Time, error) - - // CheckLocal verifies the local location is of the correct VCS type - CheckLocal() bool - - // Branches returns a list of available branches on the repository. - Branches() ([]string, error) - - // Tags returns a list of available tags on the repository. - Tags() ([]string, error) - - // IsReference returns if a string is a reference. A reference can be a - // commit id, branch, or tag. - IsReference(string) bool - - // IsDirty returns if the checkout has been modified from the checked - // out reference. - IsDirty() bool - - // CommitInfo retrieves metadata about a commit. - CommitInfo(string) (*CommitInfo, error) - - // TagsFromCommit retrieves tags from a commit id. - TagsFromCommit(string) ([]string, error) - - // Ping returns if remote location is accessible. - Ping() bool - - // RunFromDir executes a command from repo's directory. - RunFromDir(cmd string, args ...string) ([]byte, error) - - // CmdFromDir creates a new command that will be executed from repo's - // directory. - CmdFromDir(cmd string, args ...string) *exec.Cmd - - // ExportDir exports the current revision to the passed in directory. - ExportDir(string) error -} - -// NewRepo returns a Repo based on trying to detect the source control from the -// remote and local locations. The appropriate implementation will be returned -// or an ErrCannotDetectVCS if the VCS type cannot be detected. -// Note, this function may make calls to the Internet to determind help determine -// the VCS. -func NewRepo(remote, local string) (Repo, error) { - vtype, remote, err := detectVcsFromRemote(remote) - - // From the remote URL the VCS could not be detected. See if the local - // repo contains enough information to figure out the VCS. The reason the - // local repo is not checked first is because of the potential for VCS type - // switches which will be detected in each of the type builders. - if err == ErrCannotDetectVCS { - vtype, err = DetectVcsFromFS(local) - } - - if err != nil { - return nil, err - } - - switch vtype { - case Git: - return NewGitRepo(remote, local) - case Svn: - return NewSvnRepo(remote, local) - case Hg: - return NewHgRepo(remote, local) - case Bzr: - return NewBzrRepo(remote, local) - } - - // Should never fall through to here but just in case. - return nil, ErrCannotDetectVCS -} - -// CommitInfo contains metadata about a commit. -type CommitInfo struct { - // The commit id - Commit string - - // Who authored the commit - Author string - - // Date of the commit - Date time.Time - - // Commit message - Message string -} - -type base struct { - remote, local string - Logger *log.Logger -} - -func (b *base) log(v interface{}) { - b.Logger.Printf("%s", v) -} - -// Remote retrieves the remote location for a repo. -func (b *base) Remote() string { - return b.remote -} - -// LocalPath retrieves the local file system location for a repo. -func (b *base) LocalPath() string { - return b.local -} - -func (b *base) setRemote(remote string) { - b.remote = remote -} - -func (b *base) setLocalPath(local string) { - b.local = local -} - -func (b base) run(cmd string, args ...string) ([]byte, error) { - out, err := exec.Command(cmd, args...).CombinedOutput() - b.log(out) - if err != nil { - err = fmt.Errorf("%s: %s", out, err) - } - return out, err -} - -func (b *base) CmdFromDir(cmd string, args ...string) *exec.Cmd { - c := exec.Command(cmd, args...) - c.Dir = b.local - c.Env = envForDir(c.Dir) - return c -} - -func (b *base) RunFromDir(cmd string, args ...string) ([]byte, error) { - c := b.CmdFromDir(cmd, args...) - out, err := c.CombinedOutput() - return out, err -} - -func (b *base) referenceList(c, r string) []string { - var out []string - re := regexp.MustCompile(r) - for _, m := range re.FindAllStringSubmatch(c, -1) { - out = append(out, m[1]) - } - - return out -} - -func envForDir(dir string) []string { - env := os.Environ() - return mergeEnvLists([]string{"PWD=" + dir}, env) -} - -func mergeEnvLists(in, out []string) []string { -NextVar: - for _, inkv := range in { - k := strings.SplitAfterN(inkv, "=", 2)[0] - for i, outkv := range out { - if strings.HasPrefix(outkv, k) { - out[i] = inkv - continue NextVar - } - } - out = append(out, inkv) - } - return out -} - -func depInstalled(name string) bool { - if _, err := exec.LookPath(name); err != nil { - return false - } - - return true -} diff --git a/vendor/github.com/Masterminds/vcs/svn.go b/vendor/github.com/Masterminds/vcs/svn.go deleted file mode 100644 index 0c382c9c52..0000000000 --- a/vendor/github.com/Masterminds/vcs/svn.go +++ /dev/null @@ -1,386 +0,0 @@ -package vcs - -import ( - "encoding/xml" - "fmt" - "os" - "os/exec" - "path/filepath" - "runtime" - "strings" - "time" -) - -// NewSvnRepo creates a new instance of SvnRepo. The remote and local directories -// need to be passed in. The remote location should include the branch for SVN. -// For example, if the package is https://github.com/Masterminds/cookoo/ the remote -// should be https://github.com/Masterminds/cookoo/trunk for the trunk branch. -func NewSvnRepo(remote, local string) (*SvnRepo, error) { - ins := depInstalled("svn") - if !ins { - return nil, NewLocalError("svn is not installed", nil, "") - } - ltype, err := DetectVcsFromFS(local) - - // Found a VCS other than Svn. Need to report an error. - if err == nil && ltype != Svn { - return nil, ErrWrongVCS - } - - r := &SvnRepo{} - r.setRemote(remote) - r.setLocalPath(local) - r.Logger = Logger - - // Make sure the local SVN repo is configured the same as the remote when - // A remote value was passed in. - if err == nil && r.CheckLocal() { - // An SVN repo was found so test that the URL there matches - // the repo passed in here. - out, err := exec.Command("svn", "info", "--", local).CombinedOutput() - if err != nil { - return nil, NewLocalError("Unable to retrieve local repo information", err, string(out)) - } - - detectedRemote, err := detectRemoteFromInfoCommand(string(out)) - if err != nil { - return nil, NewLocalError("Unable to retrieve local repo information", err, string(out)) - } - if detectedRemote != "" && remote != "" && detectedRemote != remote { - return nil, ErrWrongRemote - } - - // If no remote was passed in but one is configured for the locally - // checked out Svn repo use that one. - if remote == "" && detectedRemote != "" { - r.setRemote(detectedRemote) - } - } - - return r, nil -} - -// SvnRepo implements the Repo interface for the Svn source control. -type SvnRepo struct { - base -} - -// Vcs retrieves the underlying VCS being implemented. -func (s SvnRepo) Vcs() Type { - return Svn -} - -// Get is used to perform an initial checkout of a repository. -// Note, because SVN isn't distributed this is a checkout without -// a clone. -func (s *SvnRepo) Get() error { - remote := s.Remote() - if strings.HasPrefix(remote, "/") { - remote = "file://" + remote - } else if runtime.GOOS == "windows" && filepath.VolumeName(remote) != "" { - remote = "file:///" + remote - } - out, err := s.run("svn", "checkout", "--", remote, s.LocalPath()) - if err != nil { - return NewRemoteError("Unable to get repository", err, string(out)) - } - return nil -} - -// Init will create a svn repository at remote location. -func (s *SvnRepo) Init() error { - out, err := s.run("svnadmin", "create", s.Remote()) - - if err != nil && s.isUnableToCreateDir(err) { - - basePath := filepath.Dir(filepath.FromSlash(s.Remote())) - if _, err := os.Stat(basePath); os.IsNotExist(err) { - err = os.MkdirAll(basePath, 0755) - if err != nil { - return NewLocalError("Unable to initialize repository", err, "") - } - - out, err = s.run("svnadmin", "create", s.Remote()) - if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - return nil - } - - } else if err != nil { - return NewLocalError("Unable to initialize repository", err, string(out)) - } - - return nil -} - -// Update performs an SVN update to an existing checkout. -func (s *SvnRepo) Update() error { - out, err := s.RunFromDir("svn", "update") - if err != nil { - return NewRemoteError("Unable to update repository", err, string(out)) - } - return err -} - -// UpdateVersion sets the version of a package currently checked out via SVN. -func (s *SvnRepo) UpdateVersion(version string) error { - out, err := s.RunFromDir("svn", "update", "-r", version) - if err != nil { - return NewRemoteError("Unable to update checked out version", err, string(out)) - } - return nil -} - -// Version retrieves the current version. -func (s *SvnRepo) Version() (string, error) { - type Commit struct { - Revision string `xml:"revision,attr"` - } - type Info struct { - Commit Commit `xml:"entry>commit"` - } - - out, err := s.RunFromDir("svn", "info", "--xml") - if err != nil { - return "", NewLocalError("Unable to retrieve checked out version", err, string(out)) - } - s.log(out) - infos := &Info{} - err = xml.Unmarshal(out, &infos) - if err != nil { - return "", NewLocalError("Unable to retrieve checked out version", err, string(out)) - } - - return infos.Commit.Revision, nil -} - -// Current returns the current version-ish. This means: -// * HEAD if on the tip. -// * Otherwise a revision id -func (s *SvnRepo) Current() (string, error) { - tip, err := s.CommitInfo("HEAD") - if err != nil { - return "", err - } - - curr, err := s.Version() - if err != nil { - return "", err - } - - if tip.Commit == curr { - return "HEAD", nil - } - - return curr, nil -} - -// Date retrieves the date on the latest commit. -func (s *SvnRepo) Date() (time.Time, error) { - version, err := s.Version() - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, "") - } - out, err := s.RunFromDir("svn", "pget", "svn:date", "--revprop", "-r", version) - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - const longForm = "2006-01-02T15:04:05.000000Z" - t, err := time.Parse(longForm, strings.TrimSpace(string(out))) - if err != nil { - return time.Time{}, NewLocalError("Unable to retrieve revision date", err, string(out)) - } - return t, nil -} - -// CheckLocal verifies the local location is an SVN repo. -func (s *SvnRepo) CheckLocal() bool { - pth, err := filepath.Abs(s.LocalPath()) - if err != nil { - s.log(err.Error()) - return false - } - - if _, err := os.Stat(filepath.Join(pth, ".svn")); err == nil { - return true - } - - oldpth := pth - for oldpth != pth { - pth = filepath.Dir(pth) - if _, err := os.Stat(filepath.Join(pth, ".svn")); err == nil { - return true - } - } - - return false -} - -// Tags returns []string{} as there are no formal tags in SVN. Tags are a -// convention in SVN. They are typically implemented as a copy of the trunk and -// placed in the /tags/[tag name] directory. Since this is a convention the -// expectation is to checkout a tag the correct subdirectory will be used -// as the path. For more information see: -// http://svnbook.red-bean.com/en/1.7/svn.branchmerge.tags.html -func (s *SvnRepo) Tags() ([]string, error) { - return []string{}, nil -} - -// Branches returns []string{} as there are no formal branches in SVN. Branches -// are a convention. They are typically implemented as a copy of the trunk and -// placed in the /branches/[tag name] directory. Since this is a convention the -// expectation is to checkout a branch the correct subdirectory will be used -// as the path. For more information see: -// http://svnbook.red-bean.com/en/1.7/svn.branchmerge.using.html -func (s *SvnRepo) Branches() ([]string, error) { - return []string{}, nil -} - -// IsReference returns if a string is a reference. A reference is a commit id. -// Branches and tags are part of the path. -func (s *SvnRepo) IsReference(r string) bool { - out, err := s.RunFromDir("svn", "log", "-r", r) - - // This is a complete hack. There must be a better way to do this. Pull - // requests welcome. When the reference isn't real you get a line of - // repeated - followed by an empty line. If the reference is real there - // is commit information in addition to those. So, we look for responses - // over 2 lines long. - lines := strings.Split(string(out), "\n") - if err == nil && len(lines) > 2 { - return true - } - - return false -} - -// IsDirty returns if the checkout has been modified from the checked -// out reference. -func (s *SvnRepo) IsDirty() bool { - out, err := s.RunFromDir("svn", "diff") - return err != nil || len(out) != 0 -} - -// CommitInfo retrieves metadata about a commit. -func (s *SvnRepo) CommitInfo(id string) (*CommitInfo, error) { - - // There are cases where Svn log doesn't return anything for HEAD or BASE. - // svn info does provide details for these but does not have elements like - // the commit message. - if id == "HEAD" || id == "BASE" { - type Commit struct { - Revision string `xml:"revision,attr"` - } - type Info struct { - Commit Commit `xml:"entry>commit"` - } - - out, err := s.RunFromDir("svn", "info", "-r", id, "--xml") - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - infos := &Info{} - err = xml.Unmarshal(out, &infos) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - - id = infos.Commit.Revision - if id == "" { - return nil, ErrRevisionUnavailable - } - } - - out, err := s.RunFromDir("svn", "log", "-r", id, "--xml") - if err != nil { - return nil, NewRemoteError("Unable to retrieve commit information", err, string(out)) - } - - type Logentry struct { - Author string `xml:"author"` - Date string `xml:"date"` - Msg string `xml:"msg"` - } - type Log struct { - XMLName xml.Name `xml:"log"` - Logs []Logentry `xml:"logentry"` - } - - logs := &Log{} - err = xml.Unmarshal(out, &logs) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - if len(logs.Logs) == 0 { - return nil, ErrRevisionUnavailable - } - - ci := &CommitInfo{ - Commit: id, - Author: logs.Logs[0].Author, - Message: logs.Logs[0].Msg, - } - - if len(logs.Logs[0].Date) > 0 { - ci.Date, err = time.Parse(time.RFC3339Nano, logs.Logs[0].Date) - if err != nil { - return nil, NewLocalError("Unable to retrieve commit information", err, string(out)) - } - } - - return ci, nil -} - -// TagsFromCommit retrieves tags from a commit id. -func (s *SvnRepo) TagsFromCommit(id string) ([]string, error) { - // Svn tags are a convention implemented as paths. See the details on the - // Tag() method for more information. - return []string{}, nil -} - -// Ping returns if remote location is accessible. -func (s *SvnRepo) Ping() bool { - _, err := s.run("svn", "--non-interactive", "info", "--", s.Remote()) - return err == nil -} - -// ExportDir exports the current revision to the passed in directory. -func (s *SvnRepo) ExportDir(dir string) error { - - out, err := s.RunFromDir("svn", "export", "--", ".", dir) - s.log(out) - if err != nil { - return NewLocalError("Unable to export source", err, string(out)) - } - - return nil -} - -// isUnableToCreateDir checks for an error in Init() to see if an error -// where the parent directory of the VCS local path doesn't exist. -func (s *SvnRepo) isUnableToCreateDir(err error) bool { - msg := err.Error() - return strings.HasPrefix(msg, "E000002") -} - -// detectRemoteFromInfoCommand finds the remote url from the `svn info` -// command's output without using a regex. We avoid regex because URLs -// are notoriously complex to accurately match with a regex and -// splitting strings is less complex and often faster -func detectRemoteFromInfoCommand(infoOut string) (string, error) { - sBytes := []byte(infoOut) - urlIndex := strings.Index(infoOut, "URL: ") - if urlIndex == -1 { - return "", fmt.Errorf("Remote not specified in svn info") - } - urlEndIndex := strings.Index(string(sBytes[urlIndex:]), "\n") - if urlEndIndex == -1 { - urlEndIndex = strings.Index(string(sBytes[urlIndex:]), "\r") - if urlEndIndex == -1 { - return "", fmt.Errorf("Unable to parse remote URL for svn info") - } - } - - return string(sBytes[(urlIndex + 5):(urlIndex + urlEndIndex)]), nil -} diff --git a/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go b/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go deleted file mode 100644 index 09f6e22ebe..0000000000 --- a/vendor/github.com/Masterminds/vcs/vcs_local_lookup.go +++ /dev/null @@ -1,46 +0,0 @@ -package vcs - -import ( - "os" - "runtime" - "strings" -) - -// DetectVcsFromFS detects the type from the local path. -// Is there a better way to do this? -func DetectVcsFromFS(vcsPath string) (Type, error) { - - // There are cases under windows that a path could start with a / and it needs - // to be stripped. For example, a path such as /C:\foio\bar. - if runtime.GOOS == "windows" && strings.HasPrefix(vcsPath, "/") { - vcsPath = strings.TrimPrefix(vcsPath, "/") - } - - // When the local directory to the package doesn't exist - // it's not yet downloaded so we can't detect the type - // locally. - if _, err := os.Stat(vcsPath); os.IsNotExist(err) { - return "", ErrCannotDetectVCS - } - - separator := string(os.PathSeparator) - - // Walk through each of the different VCS types to see if - // one can be detected. Do this is order of guessed popularity. - if _, err := os.Stat(vcsPath + separator + ".git"); err == nil { - return Git, nil - } - if _, err := os.Stat(vcsPath + separator + ".svn"); err == nil { - return Svn, nil - } - if _, err := os.Stat(vcsPath + separator + ".hg"); err == nil { - return Hg, nil - } - if _, err := os.Stat(vcsPath + separator + ".bzr"); err == nil { - return Bzr, nil - } - - // If one was not already detected than we default to not finding it. - return "", ErrCannotDetectVCS - -} diff --git a/vendor/github.com/Masterminds/vcs/vcs_remote_lookup.go b/vendor/github.com/Masterminds/vcs/vcs_remote_lookup.go deleted file mode 100644 index 3fc973ec7b..0000000000 --- a/vendor/github.com/Masterminds/vcs/vcs_remote_lookup.go +++ /dev/null @@ -1,339 +0,0 @@ -package vcs - -import ( - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "regexp" - "strings" -) - -type vcsInfo struct { - host string - pattern string - vcs Type - addCheck func(m map[string]string, u *url.URL) (Type, error) - regex *regexp.Regexp -} - -// scpSyntaxRe matches the SCP-like addresses used by Git to access -// repositories by SSH. -var scpSyntaxRe = regexp.MustCompile(`^([a-zA-Z0-9_]+)@([a-zA-Z0-9._-]+):(.*)$`) - -var vcsList = []*vcsInfo{ - { - host: "github.com", - vcs: Git, - pattern: `^(github\.com[/|:][A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`, - }, - { - host: "bitbucket.org", - pattern: `^(bitbucket\.org/(?P[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+))(/[A-Za-z0-9_.\-]+)*$`, - vcs: Git, - }, - { - host: "launchpad.net", - pattern: `^(launchpad\.net/(([A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)?|~[A-Za-z0-9_.\-]+/(\+junk|[A-Za-z0-9_.\-]+)/[A-Za-z0-9_.\-]+))(/[A-Za-z0-9_.\-]+)*$`, - vcs: Bzr, - }, - { - host: "git.launchpad.net", - vcs: Git, - pattern: `^(git\.launchpad\.net/(([A-Za-z0-9_.\-]+)|~[A-Za-z0-9_.\-]+/(\+git|[A-Za-z0-9_.\-]+)/[A-Za-z0-9_.\-]+))$`, - }, - { - host: "hub.jazz.net", - vcs: Git, - pattern: `^(hub\.jazz\.net/git/[a-z0-9]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`, - }, - { - host: "go.googlesource.com", - vcs: Git, - pattern: `^(go\.googlesource\.com/[A-Za-z0-9_.\-]+/?)$`, - }, - { - host: "git.openstack.org", - vcs: Git, - pattern: `^(git\.openstack\.org/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)$`, - }, - { - host: "hg.code.sf.net", - pattern: `^(hg.code.sf.net/p/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)*$`, - vcs: Hg, - }, - { - host: "git.code.sf.net", - pattern: `^(git.code.sf.net/p/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)*$`, - vcs: Git, - }, - { - host: "svn.code.sf.net", - pattern: `^(svn.code.sf.net/p/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)*$`, - vcs: Svn, - }, - // If none of the previous detect the type they will fall to this looking for the type in a generic sense - // by the extension to the path. - { - addCheck: checkURL, - pattern: `\.(?Pgit|hg|svn|bzr)$`, - }, -} - -func init() { - // Precompile the regular expressions used to check VCS locations. - for _, v := range vcsList { - v.regex = regexp.MustCompile(v.pattern) - } -} - -// This function is really a hack around Go redirects rather than around -// something VCS related. Should this be moved to the glide project or a -// helper function? -func detectVcsFromRemote(vcsURL string) (Type, string, error) { - t, e := detectVcsFromURL(vcsURL) - if e == nil { - return t, vcsURL, nil - } else if e != ErrCannotDetectVCS { - return NoVCS, "", e - } - - // Pages like https://golang.org/x/net provide an html document with - // meta tags containing a location to work with. The go tool uses - // a meta tag with the name go-import which is what we use here. - // godoc.org also has one call go-source that we do not need to use. - // The value of go-import is in the form "prefix vcs repo". The prefix - // should match the vcsURL and the repo is a location that can be - // checked out. Note, to get the html document you you need to add - // ?go-get=1 to the url. - u, err := url.Parse(vcsURL) - if err != nil { - return NoVCS, "", err - } - if u.RawQuery == "" { - u.RawQuery = "go-get=1" - } else { - u.RawQuery = u.RawQuery + "+go-get=1" - } - checkURL := u.String() - resp, err := http.Get(checkURL) - if err != nil { - return NoVCS, "", ErrCannotDetectVCS - } - defer resp.Body.Close() - - t, nu, err := parseImportFromBody(u, resp.Body) - if err != nil { - // TODO(mattfarina): Log the parsing error - return NoVCS, "", ErrCannotDetectVCS - } else if t == "" || nu == "" { - return NoVCS, "", ErrCannotDetectVCS - } - - return t, nu, nil -} - -// From a remote vcs url attempt to detect the VCS. -func detectVcsFromURL(vcsURL string) (Type, error) { - - var u *url.URL - var err error - - if m := scpSyntaxRe.FindStringSubmatch(vcsURL); m != nil { - // Match SCP-like syntax and convert it to a URL. - // Eg, "git@github.com:user/repo" becomes - // "ssh://git@github.com/user/repo". - u = &url.URL{ - Scheme: "ssh", - User: url.User(m[1]), - Host: m[2], - Path: "/" + m[3], - } - } else { - u, err = url.Parse(vcsURL) - if err != nil { - return "", err - } - } - - // Detect file schemes - if u.Scheme == "file" { - return DetectVcsFromFS(u.Path) - } - - if u.Host == "" { - return "", ErrCannotDetectVCS - } - - // Try to detect from the scheme - switch u.Scheme { - case "git+ssh": - return Git, nil - case "git": - return Git, nil - case "bzr+ssh": - return Bzr, nil - case "svn+ssh": - return Svn, nil - } - - // Try to detect from known hosts, such as Github - for _, v := range vcsList { - if v.host != "" && v.host != u.Host { - continue - } - - // Make sure the pattern matches for an actual repo location. For example, - // we should fail if the VCS listed is github.com/masterminds as that's - // not actually a repo. - uCheck := u.Host + u.Path - m := v.regex.FindStringSubmatch(uCheck) - if m == nil { - if v.host != "" { - return "", ErrCannotDetectVCS - } - - continue - } - - // If we are here the host matches. If the host has a singular - // VCS type, such as Github, we can return the type right away. - if v.vcs != "" { - return v.vcs, nil - } - - // Run additional checks to determine try and determine the repo - // for the matched service. - info := make(map[string]string) - for i, name := range v.regex.SubexpNames() { - if name != "" { - info[name] = m[i] - } - } - t, err := v.addCheck(info, u) - if err != nil { - switch err.(type) { - case *RemoteError: - return "", err - } - return "", ErrCannotDetectVCS - } - - return t, nil - } - - // Attempt to ascertain from the username passed in. - if u.User != nil { - un := u.User.Username() - if un == "git" { - return Git, nil - } else if un == "hg" { - return Hg, nil - } - } - - // Unable to determine the vcs from the url. - return "", ErrCannotDetectVCS -} - -// Expect a type key on i with the exact type detected from the regex. -func checkURL(i map[string]string, u *url.URL) (Type, error) { - return Type(i["type"]), nil -} - -func get(url string) ([]byte, error) { - resp, err := http.Get(url) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if resp.StatusCode != 200 { - if resp.StatusCode == 404 { - return nil, NewRemoteError("Not Found", err, resp.Status) - } else if resp.StatusCode == 401 || resp.StatusCode == 403 { - return nil, NewRemoteError("Access Denied", err, resp.Status) - } - return nil, fmt.Errorf("%s: %s", url, resp.Status) - } - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%s: %v", url, err) - } - return b, nil -} - -func parseImportFromBody(ur *url.URL, r io.ReadCloser) (tp Type, u string, err error) { - d := xml.NewDecoder(r) - d.CharsetReader = charsetReader - d.Strict = false - var t xml.Token - for { - t, err = d.Token() - if err != nil { - if err == io.EOF { - // When the end is reached it could not detect a VCS if it - // got here. - err = ErrCannotDetectVCS - } - return - } - if e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, "body") { - return - } - if e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, "head") { - return - } - e, ok := t.(xml.StartElement) - if !ok || !strings.EqualFold(e.Name.Local, "meta") { - continue - } - if attrValue(e.Attr, "name") != "go-import" { - continue - } - if f := strings.Fields(attrValue(e.Attr, "content")); len(f) == 3 { - // If the prefix supplied by the remote system isn't a prefix to the - // url we're fetching continue to look for other imports. - // This will work for exact matches and prefixes. For example, - // golang.org/x/net as a prefix will match for golang.org/x/net and - // golang.org/x/net/context. - vcsURL := ur.Host + ur.Path - if !strings.HasPrefix(vcsURL, f[0]) { - continue - } else { - switch Type(f[1]) { - case Git: - tp = Git - case Svn: - tp = Svn - case Bzr: - tp = Bzr - case Hg: - tp = Hg - } - - u = f[2] - return - } - } - } -} - -func charsetReader(charset string, input io.Reader) (io.Reader, error) { - switch strings.ToLower(charset) { - case "ascii": - return input, nil - default: - return nil, fmt.Errorf("can't decode XML document using charset %q", charset) - } -} - -func attrValue(attrs []xml.Attr, name string) string { - for _, a := range attrs { - if strings.EqualFold(a.Name.Local, name) { - return a.Value - } - } - return "" -} diff --git a/vendor/github.com/chai2010/gettext-go/.travis.yml b/vendor/github.com/chai2010/gettext-go/.travis.yml deleted file mode 100644 index 4eac3982bc..0000000000 --- a/vendor/github.com/chai2010/gettext-go/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: go - -go: - - "1.14" - - tip diff --git a/vendor/github.com/chai2010/gettext-go/LICENSE b/vendor/github.com/chai2010/gettext-go/LICENSE deleted file mode 100644 index 8f39408250..0000000000 --- a/vendor/github.com/chai2010/gettext-go/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2013 ChaiShushan . All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/chai2010/gettext-go/README.md b/vendor/github.com/chai2010/gettext-go/README.md deleted file mode 100644 index 9381bd1522..0000000000 --- a/vendor/github.com/chai2010/gettext-go/README.md +++ /dev/null @@ -1,191 +0,0 @@ -- *赞助 BTC: 1Cbd6oGAUUyBi7X7MaR4np4nTmQZXVgkCW* -- *赞助 ETH: 0x623A3C3a72186A6336C79b18Ac1eD36e1c71A8a6* -- *Go语言付费QQ群: 1055927514* - ----- - -# gettext-go: GNU gettext for Go ([Imported By Kubernetes](https://pkg.go.dev/github.com/chai2010/gettext-go@v0.1.0/gettext?tab=importedby)) - -- PkgDoc: [http://godoc.org/github.com/chai2010/gettext-go](http://godoc.org/github.com/chai2010/gettext-go) -- PkgDoc: [http://pkg.go.dev/github.com/chai2010/gettext-go](http://pkg.go.dev/github.com/chai2010/gettext-go) - -## Install - -1. `go get github.com/chai2010/gettext-go` -2. `go run hello.go` - -The godoc.org or go.dev has more information. - -## Examples - -```Go -package main - -import ( - "fmt" - - "github.com/chai2010/gettext-go" -) - -func main() { - gettext := gettext.New("hello", "./examples/locale").SetLanguage("zh_CN") - fmt.Println(gettext.Gettext("Hello, world!")) - - // Output: 你好, 世界! -} -``` - -```Go -package main - -import ( - "fmt" - - "github.com/chai2010/gettext-go" -) - -func main() { - gettext.SetLanguage("zh_CN") - gettext.BindLocale(gettext.New("hello", "locale")) - - // gettext.BindLocale("hello", "locale") // from locale dir - // gettext.BindLocale("hello", "locale.zip") // from locale zip file - // gettext.BindLocale("hello", "locale.zip", zipData) // from embedded zip data - - // translate source text - fmt.Println(gettext.Gettext("Hello, world!")) - // Output: 你好, 世界! - - // if no msgctxt in PO file (only msgid and msgstr), - // specify context as "" by - fmt.Println(gettext.PGettext("", "Hello, world!")) - // Output: 你好, 世界! - - // translate resource - fmt.Println(string(gettext.Getdata("poems.txt")))) - // Output: ... -} -``` - -Go file: [hello.go](https://github.com/chai2010/gettext-go/blob/master/examples/hello.go); PO file: [hello.po](https://github.com/chai2010/gettext-go/blob/master/examples/locale/default/LC_MESSAGES/hello.po); - ----- - -## API Changes (v0.1.0 vs v1.0.0) - -### Renamed package path - -| v0.1.0 (old) | v1.0.0 (new) | -| ----------------------------------------------- | --------------------------------------- | -| `github.com/chai2010/gettext-go/gettext` | `github.com/chai2010/gettext-go` | -| `github.com/chai2010/gettext-go/gettext/po` | `github.com/chai2010/gettext-go/po` | -| `github.com/chai2010/gettext-go/gettext/mo` | `github.com/chai2010/gettext-go/mo` | -| `github.com/chai2010/gettext-go/gettext/plural` | `github.com/chai2010/gettext-go/plural` | - -### Renamed functions - -| v0.1.0 (old) | v1.0.0 (new) | -| ---------------------------------- | --------------------------- | -| `gettext-go/gettext.*` | `gettext-go.*` | -| `gettext-go/gettext.DefaultLocal` | `gettext-go.DefaultLanguage`| -| `gettext-go/gettext.BindTextdomain`| `gettext-go.BindLocale` | -| `gettext-go/gettext.Textdomain` | `gettext-go.SetDomain` | -| `gettext-go/gettext.SetLocale` | `gettext-go.SetLanguage` | -| `gettext-go/gettext/po.Load` | `gettext-go/po.LoadFile` | -| `gettext-go/gettext/po.LoadData` | `gettext-go/po.Load` | -| `gettext-go/gettext/mo.Load` | `gettext-go/mo.LoadFile` | -| `gettext-go/gettext/mo.LoadData` | `gettext-go/mo.Load` | - -### Use empty string as the default context for `gettext.Gettext` - -```go -package main - -// v0.1.0 -// if the **context** missing, use `callerName(2)` as the context: - -// v1.0.0 -// if the **context** missing, use empty string as the context: - -func main() { - gettext.Gettext("hello") - // v0.1.0 => gettext.PGettext("main.main", "hello") - // v1.0.0 => gettext.PGettext("", "hello") - - gettext.DGettext("domain", "hello") - // v0.1.0 => gettext.DPGettext("domain", "main.main", "hello") - // v1.0.0 => gettext.DPGettext("domain", "", "hello") - - gettext.NGettext("domain", "hello", "hello2", n) - // v0.1.0 => gettext.PNGettext("domain", "main.main", "hello", "hello2", n) - // v1.0.0 => gettext.PNGettext("domain", "", "hello", "hello2", n) - - gettext.DNGettext("domain", "hello", "hello2", n) - // v0.1.0 => gettext.DPNGettext("domain", "main.main", "hello", "hello2", n) - // v1.0.0 => gettext.DPNGettext("domain", "", "hello", "hello2", n) -} -``` - -### `BindLocale` support `FileSystem` interface - -```go -// Use FileSystem: -// BindLocale(New("poedit", "name", OS("path/to/dir"))) // bind "poedit" domain -// BindLocale(New("poedit", "name", OS("path/to.zip"))) // bind "poedit" domain -``` - -## New API in v1.0.0 - -`Gettexter` interface: - -```go -type Gettexter interface { - FileSystem() FileSystem - - GetDomain() string - SetDomain(domain string) Gettexter - - GetLanguage() string - SetLanguage(lang string) Gettexter - - Gettext(msgid string) string - PGettext(msgctxt, msgid string) string - - NGettext(msgid, msgidPlural string, n int) string - PNGettext(msgctxt, msgid, msgidPlural string, n int) string - - DGettext(domain, msgid string) string - DPGettext(domain, msgctxt, msgid string) string - DNGettext(domain, msgid, msgidPlural string, n int) string - DPNGettext(domain, msgctxt, msgid, msgidPlural string, n int) string - - Getdata(name string) []byte - DGetdata(domain, name string) []byte -} - -func New(domain, path string, data ...interface{}) Gettexter -``` - -`FileSystem` interface: - -```go -type FileSystem interface { - LocaleList() []string - LoadMessagesFile(domain, lang, ext string) ([]byte, error) - LoadResourceFile(domain, lang, name string) ([]byte, error) - String() string -} - -func NewFS(name string, x interface{}) FileSystem -func OS(root string) FileSystem -func ZipFS(r *zip.Reader, name string) FileSystem -func NilFS(name string) FileSystem -``` - ----- - -## BUGS - -Please report bugs to . - -Thanks! diff --git a/vendor/github.com/chai2010/gettext-go/doc.go b/vendor/github.com/chai2010/gettext-go/doc.go deleted file mode 100644 index 50dfea3305..0000000000 --- a/vendor/github.com/chai2010/gettext-go/doc.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package gettext implements a basic GNU's gettext library. - -Example: - import ( - "github.com/chai2010/gettext-go" - ) - - func main() { - gettext.SetLanguage("zh_CN") - - // gettext.BindLocale(gettext.New("hello", "locale")) // from locale dir - // gettext.BindLocale(gettext.New("hello", "locale.zip")) // from locale zip file - // gettext.BindLocale(gettext.New("hello", "locale.zip", zipData)) // from embedded zip data - - gettext.BindLocale(gettext.New("hello", "locale")) - - // translate source text - fmt.Println(gettext.Gettext("Hello, world!")) - // Output: 你好, 世界! - - // translate resource - fmt.Println(string(gettext.Getdata("poems.txt"))) - // Output: ... - } - -Translate directory struct("./examples/locale.zip"): - - Root: "path" or "file.zip/zipBaseName" - +-default # locale: $(LC_MESSAGES) or $(LANG) or "default" - | +-LC_MESSAGES # just for `gettext.Gettext` - | | +-hello.mo # $(Root)/$(lang)/LC_MESSAGES/$(domain).mo - | | +-hello.po # $(Root)/$(lang)/LC_MESSAGES/$(domain).po - | | \-hello.json # $(Root)/$(lang)/LC_MESSAGES/$(domain).json - | | - | \-LC_RESOURCE # just for `gettext.Getdata` - | +-hello # domain map a dir in resource translate - | +-favicon.ico # $(Root)/$(lang)/LC_RESOURCE/$(domain)/$(filename) - | \-poems.txt - | - \-zh_CN # simple chinese translate - +-LC_MESSAGES - | +-hello.po # try "$(domain).po" first - | +-hello.mo # try "$(domain).mo" second - | \-hello.json # try "$(domain).json" third - | - \-LC_RESOURCE - +-hello - +-favicon.ico # $(lang)/$(domain)/favicon.ico - \-poems.txt # $(lang)/$(domain)/poems.txt - -See: - http://en.wikipedia.org/wiki/Gettext - http://www.gnu.org/software/gettext/manual/html_node - http://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html - http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html - http://www.gnu.org/software/gettext/manual/html_node/MO-Files.html - http://www.poedit.net/ - -Please report bugs to . -Thanks! -*/ -package gettext diff --git a/vendor/github.com/chai2010/gettext-go/fs.go b/vendor/github.com/chai2010/gettext-go/fs.go deleted file mode 100644 index 4e66fae7c6..0000000000 --- a/vendor/github.com/chai2010/gettext-go/fs.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "archive/zip" - "bytes" - "fmt" -) - -type FileSystem interface { - LocaleList() []string - LoadMessagesFile(domain, lang, ext string) ([]byte, error) - LoadResourceFile(domain, lang, name string) ([]byte, error) - String() string -} - -func NewFS(name string, x interface{}) FileSystem { - if x == nil { - if name != "" { - return OS(name) - } - return NilFS(name) - } - - switch x := x.(type) { - case []byte: - if len(x) == 0 { - return OS(name) - } - if r, err := zip.NewReader(bytes.NewReader(x), int64(len(x))); err == nil { - return ZipFS(r, name) - } - if fs, err := newJson(x, name); err == nil { - return fs - } - case string: - if len(x) == 0 { - return OS(name) - } - if r, err := zip.NewReader(bytes.NewReader([]byte(x)), int64(len(x))); err == nil { - return ZipFS(r, name) - } - if fs, err := newJson([]byte(x), name); err == nil { - return fs - } - case FileSystem: - return x - } - - return NilFS(name) -} - -func OS(root string) FileSystem { - return newOsFS(root) -} - -func ZipFS(r *zip.Reader, name string) FileSystem { - return newZipFS(r, name) -} - -func NilFS(name string) FileSystem { - return &nilFS{name} -} - -type nilFS struct { - name string -} - -func (p *nilFS) LocaleList() []string { - return nil -} - -func (p *nilFS) LoadMessagesFile(domain, lang, ext string) ([]byte, error) { - return nil, fmt.Errorf("not found") -} -func (p *nilFS) LoadResourceFile(domain, lang, name string) ([]byte, error) { - return nil, fmt.Errorf("not found") -} -func (p *nilFS) String() string { - return "gettext.nilfs(" + p.name + ")" -} diff --git a/vendor/github.com/chai2010/gettext-go/fs_json.go b/vendor/github.com/chai2010/gettext-go/fs_json.go deleted file mode 100644 index c7138c9954..0000000000 --- a/vendor/github.com/chai2010/gettext-go/fs_json.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "encoding/json" - "fmt" - "sort" -) - -type jsonFS struct { - name string - x map[string]struct { - LC_MESSAGES map[string][]struct { - MsgContext string `json:"msgctxt"` // msgctxt context - MsgId string `json:"msgid"` // msgid untranslated-string - MsgIdPlural string `json:"msgid_plural"` // msgid_plural untranslated-string-plural - MsgStr []string `json:"msgstr"` // msgstr translated-string - } - LC_RESOURCE map[string]map[string]string - } -} - -func isJsonData() bool { - return false -} - -func newJson(jsonData []byte, name string) (*jsonFS, error) { - p := &jsonFS{name: name} - if err := json.Unmarshal(jsonData, &p.x); err != nil { - return nil, err - } - - return p, nil -} - -func (p *jsonFS) LocaleList() []string { - var ss []string - for lang := range p.x { - ss = append(ss, lang) - } - sort.Strings(ss) - return ss -} - -func (p *jsonFS) LoadMessagesFile(domain, lang, ext string) ([]byte, error) { - if v, ok := p.x[lang]; ok { - if v, ok := v.LC_MESSAGES[domain+ext]; ok { - return json.Marshal(v) - } - } - return nil, fmt.Errorf("not found") -} -func (p *jsonFS) LoadResourceFile(domain, lang, name string) ([]byte, error) { - if v, ok := p.x[lang]; ok { - if v, ok := v.LC_RESOURCE[domain]; ok { - return []byte(v[name]), nil - } - } - return nil, fmt.Errorf("not found") -} -func (p *jsonFS) String() string { - return "gettext.nilfs(" + p.name + ")" -} diff --git a/vendor/github.com/chai2010/gettext-go/fs_os.go b/vendor/github.com/chai2010/gettext-go/fs_os.go deleted file mode 100644 index 80d4f51bac..0000000000 --- a/vendor/github.com/chai2010/gettext-go/fs_os.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "archive/zip" - "bytes" - "fmt" - "io/ioutil" - "os" - "sort" - "strings" -) - -type osFS struct { - root string -} - -func newOsFS(root string) FileSystem { - // locale zip file - if fi, err := os.Stat(root); err == nil && !fi.IsDir() { - if strings.HasSuffix(strings.ToLower(root), ".zip") { - if x, err := ioutil.ReadFile(root); err == nil { - if r, err := zip.NewReader(bytes.NewReader(x), int64(len(x))); err == nil { - return ZipFS(r, root) - } - } - } - if strings.HasSuffix(strings.ToLower(root), ".json") { - if x, err := ioutil.ReadFile(root); err == nil { - if fs, err := newJson(x, root); err == nil { - return fs - } - } - } - } - - // locale dir - return &osFS{root: root} -} - -func (p *osFS) LocaleList() []string { - list, err := ioutil.ReadDir(p.root) - if err != nil { - return nil - } - ssMap := make(map[string]bool) - for _, dir := range list { - if dir.IsDir() { - ssMap[dir.Name()] = true - } - } - var locales = make([]string, 0, len(ssMap)) - for s := range ssMap { - locales = append(locales, s) - } - sort.Strings(locales) - return locales -} - -func (p *osFS) LoadMessagesFile(domain, locale, ext string) ([]byte, error) { - trName := p.makeMessagesFileName(domain, locale, ext) - rcData, err := ioutil.ReadFile(trName) - if err != nil { - return nil, err - } - return rcData, nil -} - -func (p *osFS) LoadResourceFile(domain, locale, name string) ([]byte, error) { - rcName := p.makeResourceFileName(domain, locale, name) - rcData, err := ioutil.ReadFile(rcName) - if err != nil { - return nil, err - } - return rcData, nil -} - -func (p *osFS) String() string { - return "gettext.localfs(" + p.root + ")" -} - -func (p *osFS) makeMessagesFileName(domain, lang, ext string) string { - return fmt.Sprintf("%s/%s/LC_MESSAGES/%s%s", p.root, lang, domain, ext) -} - -func (p *osFS) makeResourceFileName(domain, lang, name string) string { - return fmt.Sprintf("%s/%s/LC_RESOURCE/%s/%s", p.root, lang, domain, name) -} diff --git a/vendor/github.com/chai2010/gettext-go/fs_zip.go b/vendor/github.com/chai2010/gettext-go/fs_zip.go deleted file mode 100644 index 61eb8359da..0000000000 --- a/vendor/github.com/chai2010/gettext-go/fs_zip.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "archive/zip" - "fmt" - "io/ioutil" - "sort" - "strings" -) - -type zipFS struct { - root string - name string - r *zip.Reader -} - -func newZipFS(r *zip.Reader, name string) *zipFS { - fs := &zipFS{r: r, name: name} - fs.root = fs.zipRoot() - return fs -} - -func (p *zipFS) zipName() string { - name := p.name - if x := strings.LastIndexAny(name, `\/`); x != -1 { - name = name[x+1:] - } - name = strings.TrimSuffix(name, ".zip") - return name -} - -func (p *zipFS) zipRoot() string { - var somepath string - for _, f := range p.r.File { - if x := strings.Index(f.Name, "LC_MESSAGES"); x != -1 { - somepath = f.Name - } - if x := strings.Index(f.Name, "LC_RESOURCE"); x != -1 { - somepath = f.Name - } - } - if somepath == "" { - return p.zipName() - } - - ss := strings.Split(somepath, "/") - for i, s := range ss { - // $(root)/$(lang)/LC_MESSAGES - // $(root)/$(lang)/LC_RESOURCE - if (s == "LC_MESSAGES" || s == "LC_RESOURCE") && i >= 2 { - return strings.Join(ss[:i-1], "/") - } - } - - return p.zipName() -} - -func (p *zipFS) LocaleList() []string { - var locals []string - for s := range p.lsZip(p.r) { - locals = append(locals, s) - } - sort.Strings(locals) - return locals -} - -func (p *zipFS) LoadMessagesFile(domain, lang, ext string) ([]byte, error) { - trName := p.makeMessagesFileName(domain, lang, ext) - for _, f := range p.r.File { - if f.Name != trName { - continue - } - rc, err := f.Open() - if err != nil { - return nil, err - } - rcData, err := ioutil.ReadAll(rc) - rc.Close() - return rcData, err - } - return nil, fmt.Errorf("not found") -} - -func (p *zipFS) LoadResourceFile(domain, lang, name string) ([]byte, error) { - rcName := p.makeResourceFileName(domain, lang, name) - for _, f := range p.r.File { - if f.Name != rcName { - continue - } - rc, err := f.Open() - if err != nil { - return nil, err - } - rcData, err := ioutil.ReadAll(rc) - rc.Close() - return rcData, err - } - return nil, fmt.Errorf("not found") -} - -func (p *zipFS) String() string { - return "gettext.zipfs(" + p.name + ")" -} - -func (p *zipFS) makeMessagesFileName(domain, lang, ext string) string { - return fmt.Sprintf("%s/%s/LC_MESSAGES/%s%s", p.root, lang, domain, ext) -} - -func (p *zipFS) makeResourceFileName(domain, lang, name string) string { - return fmt.Sprintf("%s/%s/LC_RESOURCE/%s/%s", p.root, lang, domain, name) -} - -func (p *zipFS) lsZip(r *zip.Reader) map[string]bool { - ssMap := make(map[string]bool) - for _, f := range r.File { - if x := strings.Index(f.Name, "LC_MESSAGES"); x != -1 { - s := strings.TrimRight(f.Name[:x], `\/`) - if x = strings.LastIndexAny(s, `\/`); x != -1 { - s = s[x+1:] - } - if s != "" { - ssMap[s] = true - } - continue - } - if x := strings.Index(f.Name, "LC_RESOURCE"); x != -1 { - s := strings.TrimRight(f.Name[:x], `\/`) - if x = strings.LastIndexAny(s, `\/`); x != -1 { - s = s[x+1:] - } - if s != "" { - ssMap[s] = true - } - continue - } - } - return ssMap -} diff --git a/vendor/github.com/chai2010/gettext-go/gettext.go b/vendor/github.com/chai2010/gettext-go/gettext.go deleted file mode 100644 index 7747188ab4..0000000000 --- a/vendor/github.com/chai2010/gettext-go/gettext.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -var ( - DefaultLanguage string = getDefaultLanguage() // use $(LC_MESSAGES) or $(LANG) or "default" -) - -type Gettexter interface { - FileSystem() FileSystem - - GetDomain() string - SetDomain(domain string) Gettexter - - GetLanguage() string - SetLanguage(lang string) Gettexter - - Gettext(msgid string) string - PGettext(msgctxt, msgid string) string - - NGettext(msgid, msgidPlural string, n int) string - PNGettext(msgctxt, msgid, msgidPlural string, n int) string - - DGettext(domain, msgid string) string - DPGettext(domain, msgctxt, msgid string) string - DNGettext(domain, msgid, msgidPlural string, n int) string - DPNGettext(domain, msgctxt, msgid, msgidPlural string, n int) string - - Getdata(name string) []byte - DGetdata(domain, name string) []byte -} - -// New create Interface use default language. -func New(domain, path string, data ...interface{}) Gettexter { - return newLocale(domain, path, data...) -} - -var defaultGettexter struct { - lang string - domain string - Gettexter -} - -func init() { - defaultGettexter.lang = getDefaultLanguage() - defaultGettexter.domain = "default" - defaultGettexter.Gettexter = newLocale("", "") -} - -// BindLocale sets and queries program's domains. -// -// Examples: -// BindLocale(New("poedit", "locale")) // bind "poedit" domain -// -// Use zip file: -// BindLocale(New("poedit", "locale.zip")) // bind "poedit" domain -// BindLocale(New("poedit", "locale.zip", zipData)) // bind "poedit" domain -// -// Use FileSystem: -// BindLocale(New("poedit", "name", OS("path/to/dir"))) // bind "poedit" domain -// BindLocale(New("poedit", "name", OS("path/to.zip"))) // bind "poedit" domain -// -func BindLocale(g Gettexter) { - if g != nil { - defaultGettexter.Gettexter = g - defaultGettexter.SetLanguage(defaultGettexter.lang) - } else { - defaultGettexter.Gettexter = newLocale("", "") - defaultGettexter.SetLanguage(defaultGettexter.lang) - } -} - -// SetLanguage sets and queries the program's current lang. -// -// If the lang is not empty string, set the new locale. -// -// If the lang is empty string, don't change anything. -// -// Returns is the current locale. -// -// Examples: -// SetLanguage("") // get locale: return DefaultLocale -// SetLanguage("zh_CN") // set locale: return zh_CN -// SetLanguage("") // get locale: return zh_CN -func SetLanguage(lang string) string { - defaultGettexter.SetLanguage(lang) - return defaultGettexter.GetLanguage() -} - -// SetDomain sets and retrieves the current message domain. -// -// If the domain is not empty string, set the new domains. -// -// If the domain is empty string, don't change anything. -// -// Returns is the all used domains. -// -// Examples: -// SetDomain("poedit") // set domain: poedit -// SetDomain("") // get domain: return poedit -func SetDomain(domain string) string { - defaultGettexter.SetDomain(domain) - return defaultGettexter.GetDomain() -} - -// Gettext attempt to translate a text string into the user's native language, -// by looking up the translation in a message catalog. -// -// It use the caller's function name as the msgctxt. -// -// Examples: -// func Foo() { -// msg := gettext.Gettext("Hello") // msgctxt is "" -// } -func Gettext(msgid string) string { - return defaultGettexter.Gettext(msgid) -} - -// Getdata attempt to translate a resource file into the user's native language, -// by looking up the translation in a message catalog. -// -// Examples: -// func Foo() { -// Textdomain("hello") -// BindLocale("hello", "locale.zip", nilOrZipData) -// poems := gettext.Getdata("poems.txt") -// } -func Getdata(name string) []byte { - return defaultGettexter.Getdata(name) -} - -// NGettext attempt to translate a text string into the user's native language, -// by looking up the appropriate plural form of the translation in a message -// catalog. -// -// It use the caller's function name as the msgctxt. -// -// Examples: -// func Foo() { -// msg := gettext.NGettext("%d people", "%d peoples", 2) -// } -func NGettext(msgid, msgidPlural string, n int) string { - return defaultGettexter.NGettext(msgid, msgidPlural, n) -} - -// PGettext attempt to translate a text string into the user's native language, -// by looking up the translation in a message catalog. -// -// Examples: -// func Foo() { -// msg := gettext.PGettext("gettext-go.example", "Hello") // msgctxt is "gettext-go.example" -// } -func PGettext(msgctxt, msgid string) string { - return defaultGettexter.PGettext(msgctxt, msgid) -} - -// PNGettext attempt to translate a text string into the user's native language, -// by looking up the appropriate plural form of the translation in a message -// catalog. -// -// Examples: -// func Foo() { -// msg := gettext.PNGettext("gettext-go.example", "%d people", "%d peoples", 2) -// } -func PNGettext(msgctxt, msgid, msgidPlural string, n int) string { - return defaultGettexter.PNGettext(msgctxt, msgid, msgidPlural, n) -} - -// DGettext like Gettext(), but looking up the message in the specified domain. -// -// Examples: -// func Foo() { -// msg := gettext.DGettext("poedit", "Hello") -// } -func DGettext(domain, msgid string) string { - return defaultGettexter.DGettext(domain, msgid) -} - -// DNGettext like NGettext(), but looking up the message in the specified domain. -// -// Examples: -// func Foo() { -// msg := gettext.PNGettext("poedit", "gettext-go.example", "%d people", "%d peoples", 2) -// } -func DNGettext(domain, msgid, msgidPlural string, n int) string { - return defaultGettexter.DNGettext(domain, msgid, msgidPlural, n) -} - -// DPGettext like PGettext(), but looking up the message in the specified domain. -// -// Examples: -// func Foo() { -// msg := gettext.DPGettext("poedit", "gettext-go.example", "Hello") -// } -func DPGettext(domain, msgctxt, msgid string) string { - return defaultGettexter.DPGettext(domain, msgctxt, msgid) -} - -// DPNGettext like PNGettext(), but looking up the message in the specified domain. -// -// Examples: -// func Foo() { -// msg := gettext.DPNGettext("poedit", "gettext-go.example", "%d people", "%d peoples", 2) -// } -func DPNGettext(domain, msgctxt, msgid, msgidPlural string, n int) string { - return defaultGettexter.DPNGettext(domain, msgctxt, msgid, msgidPlural, n) -} - -// DGetdata like Getdata(), but looking up the resource in the specified domain. -// -// Examples: -// func Foo() { -// msg := gettext.DGetdata("hello", "poems.txt") -// } -func DGetdata(domain, name string) []byte { - return defaultGettexter.DGetdata(domain, name) -} diff --git a/vendor/github.com/chai2010/gettext-go/locale.go b/vendor/github.com/chai2010/gettext-go/locale.go deleted file mode 100644 index e7a2d4b37b..0000000000 --- a/vendor/github.com/chai2010/gettext-go/locale.go +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright 2020 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "fmt" - "sync" -) - -type _Locale struct { - mutex sync.Mutex - fs FileSystem - lang string - domain string - trMap map[string]*translator - trCurrent *translator -} - -var _ Gettexter = (*_Locale)(nil) - -func newLocale(domain, path string, data ...interface{}) *_Locale { - if domain == "" { - domain = "default" - } - p := &_Locale{ - lang: DefaultLanguage, - domain: domain, - } - if len(data) > 0 { - p.fs = NewFS(path, data[0]) - } else { - p.fs = NewFS(path, nil) - } - - p.syncTrMap() - return p -} - -func (p *_Locale) makeTrMapKey(domain, _Locale string) string { - return domain + "_$$$_" + _Locale -} - -func (p *_Locale) FileSystem() FileSystem { - return p.fs -} - -func (p *_Locale) GetLanguage() string { - p.mutex.Lock() - defer p.mutex.Unlock() - - return p.lang -} -func (p *_Locale) SetLanguage(lang string) Gettexter { - p.mutex.Lock() - defer p.mutex.Unlock() - - if lang == "" { - lang = DefaultLanguage - } - if lang == p.lang { - return p - } - - p.lang = lang - p.syncTrMap() - return p -} - -func (p *_Locale) GetDomain() string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.domain -} - -func (p *_Locale) SetDomain(domain string) Gettexter { - p.mutex.Lock() - defer p.mutex.Unlock() - - if domain == "" || domain == p.domain { - return p - } - - p.domain = domain - p.syncTrMap() - return p -} - -func (p *_Locale) syncTrMap() { - p.trMap = make(map[string]*translator) - trMapKey := p.makeTrMapKey(p.domain, p.lang) - - if tr, ok := p.trMap[trMapKey]; ok { - p.trCurrent = tr - return - } - - // try load po file - if data, err := p.fs.LoadMessagesFile(p.domain, p.lang, ".po"); err == nil { - if tr, err := newPoTranslator(fmt.Sprintf("%s_%s.po", p.domain, p.lang), data); err == nil { - p.trMap[trMapKey] = tr - p.trCurrent = tr - return - } - } - - // try load mo file - if data, err := p.fs.LoadMessagesFile(p.domain, p.lang, ".mo"); err == nil { - if tr, err := newMoTranslator(fmt.Sprintf("%s_%s.mo", p.domain, p.lang), data); err == nil { - p.trMap[trMapKey] = tr - p.trCurrent = tr - return - } - } - - // try load json file - if data, err := p.fs.LoadMessagesFile(p.domain, p.lang, ".json"); err == nil { - if tr, err := newJsonTranslator(p.lang, fmt.Sprintf("%s_%s.json", p.domain, p.lang), data); err == nil { - p.trMap[trMapKey] = tr - p.trCurrent = tr - return - } - } - - // no po/mo file - p.trMap[trMapKey] = nilTranslator - p.trCurrent = nilTranslator - return -} - -func (p *_Locale) Gettext(msgid string) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.trCurrent.PGettext("", msgid) -} - -func (p *_Locale) PGettext(msgctxt, msgid string) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.trCurrent.PGettext(msgctxt, msgid) -} - -func (p *_Locale) NGettext(msgid, msgidPlural string, n int) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.trCurrent.PNGettext("", msgid, msgidPlural, n) -} - -func (p *_Locale) PNGettext(msgctxt, msgid, msgidPlural string, n int) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.trCurrent.PNGettext(msgctxt, msgid, msgidPlural, n) -} - -func (p *_Locale) DGettext(domain, msgid string) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.gettext(domain, "", msgid, "", 0) -} - -func (p *_Locale) DNGettext(domain, msgid, msgidPlural string, n int) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.gettext(domain, "", msgid, msgidPlural, n) -} - -func (p *_Locale) DPGettext(domain, msgctxt, msgid string) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.gettext(domain, msgctxt, msgid, "", 0) -} - -func (p *_Locale) DPNGettext(domain, msgctxt, msgid, msgidPlural string, n int) string { - p.mutex.Lock() - defer p.mutex.Unlock() - return p.gettext(domain, msgctxt, msgid, msgidPlural, n) -} - -func (p *_Locale) Getdata(name string) []byte { - return p.getdata(p.domain, name) -} - -func (p *_Locale) DGetdata(domain, name string) []byte { - return p.getdata(domain, name) -} - -func (p *_Locale) gettext(domain, msgctxt, msgid, msgidPlural string, n int) string { - if f, ok := p.trMap[p.makeTrMapKey(domain, p.lang)]; ok { - return f.PNGettext(msgctxt, msgid, msgidPlural, n) - } - return msgid -} - -func (p *_Locale) getdata(domain, name string) []byte { - if data, err := p.fs.LoadResourceFile(domain, p.lang, name); err == nil { - return data - } - if p.lang != "default" { - if data, err := p.fs.LoadResourceFile(domain, "default", name); err == nil { - return data - } - } - return nil -} diff --git a/vendor/github.com/chai2010/gettext-go/mo/doc.go b/vendor/github.com/chai2010/gettext-go/mo/doc.go deleted file mode 100644 index 5fefc18930..0000000000 --- a/vendor/github.com/chai2010/gettext-go/mo/doc.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package mo provides support for reading and writing GNU MO file. - -Examples: - import ( - "github.com/chai2010/gettext-go/mo" - ) - - func main() { - moFile, err := mo.LoadFile("test.mo") - if err != nil { - log.Fatal(err) - } - fmt.Printf("%v", moFile) - } - -GNU MO file struct: - - byte - +------------------------------------------+ - 0 | magic number = 0x950412de | - | | - 4 | file format revision = 0 | - | | - 8 | number of strings | == N - | | - 12 | offset of table with original strings | == O - | | - 16 | offset of table with translation strings | == T - | | - 20 | size of hashing table | == S - | | - 24 | offset of hashing table | == H - | | - . . - . (possibly more entries later) . - . . - | | - O | length & offset 0th string ----------------. - O + 8 | length & offset 1st string ------------------. - ... ... | | - O + ((N-1)*8)| length & offset (N-1)th string | | | - | | | | - T | length & offset 0th translation ---------------. - T + 8 | length & offset 1st translation -----------------. - ... ... | | | | - T + ((N-1)*8)| length & offset (N-1)th translation | | | | | - | | | | | | - H | start hash table | | | | | - ... ... | | | | - H + S * 4 | end hash table | | | | | - | | | | | | - | NUL terminated 0th string <----------------' | | | - | | | | | - | NUL terminated 1st string <------------------' | | - | | | | - ... ... | | - | | | | - | NUL terminated 0th translation <---------------' | - | | | - | NUL terminated 1st translation <-----------------' - | | - ... ... - | | - +------------------------------------------+ - -The GNU MO file specification is at -http://www.gnu.org/software/gettext/manual/html_node/MO-Files.html. -*/ -package mo diff --git a/vendor/github.com/chai2010/gettext-go/mo/encoder.go b/vendor/github.com/chai2010/gettext-go/mo/encoder.go deleted file mode 100644 index f953fd3cb8..0000000000 --- a/vendor/github.com/chai2010/gettext-go/mo/encoder.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mo - -import ( - "bytes" - "encoding/binary" - "sort" - "strings" -) - -type moHeader struct { - MagicNumber uint32 - MajorVersion uint16 - MinorVersion uint16 - MsgIdCount uint32 - MsgIdOffset uint32 - MsgStrOffset uint32 - HashSize uint32 - HashOffset uint32 -} - -type moStrPos struct { - Size uint32 // must keep fields order - Addr uint32 -} - -func encodeFile(f *File) []byte { - hdr := &moHeader{ - MagicNumber: MoMagicLittleEndian, - } - data := encodeData(hdr, f) - data = append(encodeHeader(hdr), data...) - return data -} - -// encode data and init moHeader -func encodeData(hdr *moHeader, f *File) []byte { - msgList := []Message{f.MimeHeader.toMessage()} - for _, v := range f.Messages { - if len(v.MsgId) == 0 { - continue - } - if len(v.MsgStr) == 0 && len(v.MsgStrPlural) == 0 { - continue - } - msgList = append(msgList, v) - } - sort.Slice(msgList, func(i, j int) bool { - return msgList[i].less(&msgList[j]) - }) - - var buf bytes.Buffer - var msgIdPosList = make([]moStrPos, len(msgList)) - var msgStrPosList = make([]moStrPos, len(msgList)) - for i, v := range msgList { - // write msgid - msgId := encodeMsgId(v) - msgIdPosList[i].Addr = uint32(buf.Len() + MoHeaderSize) - msgIdPosList[i].Size = uint32(len(msgId)) - buf.WriteString(msgId) - // write msgstr - msgStr := encodeMsgStr(v) - msgStrPosList[i].Addr = uint32(buf.Len() + MoHeaderSize) - msgStrPosList[i].Size = uint32(len(msgStr)) - buf.WriteString(msgStr) - } - - hdr.MsgIdOffset = uint32(buf.Len() + MoHeaderSize) - binary.Write(&buf, binary.LittleEndian, msgIdPosList) - hdr.MsgStrOffset = uint32(buf.Len() + MoHeaderSize) - binary.Write(&buf, binary.LittleEndian, msgStrPosList) - - hdr.MsgIdCount = uint32(len(msgList)) - return buf.Bytes() -} - -// must called after encodeData -func encodeHeader(hdr *moHeader) []byte { - var buf bytes.Buffer - binary.Write(&buf, binary.LittleEndian, hdr) - return buf.Bytes() -} - -func encodeMsgId(v Message) string { - if v.MsgContext != "" && v.MsgIdPlural != "" { - return v.MsgContext + EotSeparator + v.MsgId + NulSeparator + v.MsgIdPlural - } - if v.MsgContext != "" && v.MsgIdPlural == "" { - return v.MsgContext + EotSeparator + v.MsgId - } - if v.MsgContext == "" && v.MsgIdPlural != "" { - return v.MsgId + NulSeparator + v.MsgIdPlural - } - return v.MsgId -} - -func encodeMsgStr(v Message) string { - if v.MsgIdPlural != "" { - return strings.Join(v.MsgStrPlural, NulSeparator) - } - return v.MsgStr -} diff --git a/vendor/github.com/chai2010/gettext-go/mo/file.go b/vendor/github.com/chai2010/gettext-go/mo/file.go deleted file mode 100644 index 6f7ed161c1..0000000000 --- a/vendor/github.com/chai2010/gettext-go/mo/file.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mo - -import ( - "bytes" - "encoding/binary" - "fmt" - "io/ioutil" - "strings" -) - -const ( - MoHeaderSize = 28 - MoMagicLittleEndian = 0x950412de - MoMagicBigEndian = 0xde120495 - - EotSeparator = "\x04" // msgctxt and msgid separator - NulSeparator = "\x00" // msgid and msgstr separator -) - -// File represents an MO File. -// -// See http://www.gnu.org/software/gettext/manual/html_node/MO-Files.html -type File struct { - MagicNumber uint32 - MajorVersion uint16 - MinorVersion uint16 - MsgIdCount uint32 - MsgIdOffset uint32 - MsgStrOffset uint32 - HashSize uint32 - HashOffset uint32 - MimeHeader Header - Messages []Message -} - -// Load loads mo file format data. -func Load(data []byte) (*File, error) { - return loadData(data) -} - -// Load loads a named mo file. -func LoadFile(path string) (*File, error) { - data, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - return loadData(data) -} - -func loadData(data []byte) (*File, error) { - r := bytes.NewReader(data) - - var magicNumber uint32 - if err := binary.Read(r, binary.LittleEndian, &magicNumber); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - var bo binary.ByteOrder - switch magicNumber { - case MoMagicLittleEndian: - bo = binary.LittleEndian - case MoMagicBigEndian: - bo = binary.BigEndian - default: - return nil, fmt.Errorf("gettext: %v", "invalid magic number") - } - - var header struct { - MajorVersion uint16 - MinorVersion uint16 - MsgIdCount uint32 - MsgIdOffset uint32 - MsgStrOffset uint32 - HashSize uint32 - HashOffset uint32 - } - if err := binary.Read(r, bo, &header); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - if v := header.MajorVersion; v != 0 && v != 1 { - return nil, fmt.Errorf("gettext: %v", "invalid version number") - } - if v := header.MinorVersion; v != 0 && v != 1 { - return nil, fmt.Errorf("gettext: %v", "invalid version number") - } - - msgIdStart := make([]uint32, header.MsgIdCount) - msgIdLen := make([]uint32, header.MsgIdCount) - if _, err := r.Seek(int64(header.MsgIdOffset), 0); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - for i := 0; i < int(header.MsgIdCount); i++ { - if err := binary.Read(r, bo, &msgIdLen[i]); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - if err := binary.Read(r, bo, &msgIdStart[i]); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - } - - msgStrStart := make([]int32, header.MsgIdCount) - msgStrLen := make([]int32, header.MsgIdCount) - if _, err := r.Seek(int64(header.MsgStrOffset), 0); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - for i := 0; i < int(header.MsgIdCount); i++ { - if err := binary.Read(r, bo, &msgStrLen[i]); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - if err := binary.Read(r, bo, &msgStrStart[i]); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - } - - file := &File{ - MagicNumber: magicNumber, - MajorVersion: header.MajorVersion, - MinorVersion: header.MinorVersion, - MsgIdCount: header.MsgIdCount, - MsgIdOffset: header.MsgIdOffset, - MsgStrOffset: header.MsgStrOffset, - HashSize: header.HashSize, - HashOffset: header.HashOffset, - } - for i := 0; i < int(header.MsgIdCount); i++ { - if _, err := r.Seek(int64(msgIdStart[i]), 0); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - msgIdData := make([]byte, msgIdLen[i]) - if _, err := r.Read(msgIdData); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - - if _, err := r.Seek(int64(msgStrStart[i]), 0); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - msgStrData := make([]byte, msgStrLen[i]) - if _, err := r.Read(msgStrData); err != nil { - return nil, fmt.Errorf("gettext: %v", err) - } - - if len(msgIdData) == 0 { - var msg = Message{ - MsgId: string(msgIdData), - MsgStr: string(msgStrData), - } - file.MimeHeader.fromMessage(&msg) - } else { - var msg = Message{ - MsgId: string(msgIdData), - MsgStr: string(msgStrData), - } - // Is this a context message? - if idx := strings.Index(msg.MsgId, EotSeparator); idx != -1 { - msg.MsgContext, msg.MsgId = msg.MsgId[:idx], msg.MsgId[idx+1:] - } - // Is this a plural message? - if idx := strings.Index(msg.MsgId, NulSeparator); idx != -1 { - msg.MsgId, msg.MsgIdPlural = msg.MsgId[:idx], msg.MsgId[idx+1:] - msg.MsgStrPlural = strings.Split(msg.MsgStr, NulSeparator) - msg.MsgStr = "" - } - file.Messages = append(file.Messages, msg) - } - } - - return file, nil -} - -// Save saves a mo file. -func (f *File) Save(name string) error { - return ioutil.WriteFile(name, f.Data(), 0666) -} - -// Save returns a mo file format data. -func (f *File) Data() []byte { - return encodeFile(f) -} - -// String returns the po format file string. -func (f *File) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "# version: %d.%d\n", f.MajorVersion, f.MinorVersion) - fmt.Fprintf(&buf, "%s\n", f.MimeHeader.String()) - fmt.Fprintf(&buf, "\n") - - for k, v := range f.Messages { - fmt.Fprintf(&buf, `msgid "%v"`+"\n", k) - fmt.Fprintf(&buf, `msgstr "%s"`+"\n", v.MsgStr) - fmt.Fprintf(&buf, "\n") - } - - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/mo/header.go b/vendor/github.com/chai2010/gettext-go/mo/header.go deleted file mode 100644 index d8c7a5e3a3..0000000000 --- a/vendor/github.com/chai2010/gettext-go/mo/header.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mo - -import ( - "bytes" - "fmt" - "strings" -) - -// Header is the initial comments "SOME DESCRIPTIVE TITLE", "YEAR" -// and "FIRST AUTHOR , YEAR" ought to be replaced by sensible information. -// -// See http://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html#Header-Entry -type Header struct { - ProjectIdVersion string // Project-Id-Version: PACKAGE VERSION - ReportMsgidBugsTo string // Report-Msgid-Bugs-To: FIRST AUTHOR - POTCreationDate string // POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE - PORevisionDate string // PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE - LastTranslator string // Last-Translator: FIRST AUTHOR - LanguageTeam string // Language-Team: golang-china - Language string // Language: zh_CN - MimeVersion string // MIME-Version: 1.0 - ContentType string // Content-Type: text/plain; charset=UTF-8 - ContentTransferEncoding string // Content-Transfer-Encoding: 8bit - PluralForms string // Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; - XGenerator string // X-Generator: Poedit 1.5.5 - UnknowFields map[string]string -} - -func (p *Header) fromMessage(msg *Message) { - if msg.MsgId != "" || msg.MsgStr == "" { - return - } - lines := strings.Split(msg.MsgStr, "\n") - for i := 0; i < len(lines); i++ { - idx := strings.Index(lines[i], ":") - if idx < 0 { - continue - } - key := strings.TrimSpace(lines[i][:idx]) - val := strings.TrimSpace(lines[i][idx+1:]) - switch strings.ToUpper(key) { - case strings.ToUpper("Project-Id-Version"): - p.ProjectIdVersion = val - case strings.ToUpper("Report-Msgid-Bugs-To"): - p.ReportMsgidBugsTo = val - case strings.ToUpper("POT-Creation-Date"): - p.POTCreationDate = val - case strings.ToUpper("PO-Revision-Date"): - p.PORevisionDate = val - case strings.ToUpper("Last-Translator"): - p.LastTranslator = val - case strings.ToUpper("Language-Team"): - p.LanguageTeam = val - case strings.ToUpper("Language"): - p.Language = val - case strings.ToUpper("MIME-Version"): - p.MimeVersion = val - case strings.ToUpper("Content-Type"): - p.ContentType = val - case strings.ToUpper("Content-Transfer-Encoding"): - p.ContentTransferEncoding = val - case strings.ToUpper("Plural-Forms"): - p.PluralForms = val - case strings.ToUpper("X-Generator"): - p.XGenerator = val - default: - if p.UnknowFields == nil { - p.UnknowFields = make(map[string]string) - } - p.UnknowFields[key] = val - } - } -} - -func (p *Header) toMessage() Message { - return Message{ - MsgStr: p.String(), - } -} - -// String returns the po format header string. -func (p Header) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, `msgid ""`+"\n") - fmt.Fprintf(&buf, `msgstr ""`+"\n") - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Project-Id-Version", p.ProjectIdVersion) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Report-Msgid-Bugs-To", p.ReportMsgidBugsTo) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "POT-Creation-Date", p.POTCreationDate) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "PO-Revision-Date", p.PORevisionDate) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Last-Translator", p.LastTranslator) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Language-Team", p.LanguageTeam) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Language", p.Language) - if p.MimeVersion != "" { - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "MIME-Version", p.MimeVersion) - } - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Content-Type", p.ContentType) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Content-Transfer-Encoding", p.ContentTransferEncoding) - if p.XGenerator != "" { - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "X-Generator", p.XGenerator) - } - for k, v := range p.UnknowFields { - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", k, v) - } - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/mo/message.go b/vendor/github.com/chai2010/gettext-go/mo/message.go deleted file mode 100644 index b67bde0b70..0000000000 --- a/vendor/github.com/chai2010/gettext-go/mo/message.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mo - -import ( - "bytes" - "fmt" -) - -// A MO file is made up of many entries, -// each entry holding the relation between an original untranslated string -// and its corresponding translation. -// -// See http://www.gnu.org/software/gettext/manual/html_node/MO-Files.html -type Message struct { - MsgContext string // msgctxt context - MsgId string // msgid untranslated-string - MsgIdPlural string // msgid_plural untranslated-string-plural - MsgStr string // msgstr translated-string - MsgStrPlural []string // msgstr[0] translated-string-case-0 -} - -// String returns the po format entry string. -func (p Message) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "msgid %s", encodePoString(p.MsgId)) - if p.MsgIdPlural != "" { - fmt.Fprintf(&buf, "msgid_plural %s", encodePoString(p.MsgIdPlural)) - } - if p.MsgStr != "" { - fmt.Fprintf(&buf, "msgstr %s", encodePoString(p.MsgStr)) - } - for i := 0; i < len(p.MsgStrPlural); i++ { - fmt.Fprintf(&buf, "msgstr[%d] %s", i, encodePoString(p.MsgStrPlural[i])) - } - return buf.String() -} - -func (m_i *Message) less(m_j *Message) bool { - if a, b := m_i.MsgContext, m_j.MsgContext; a != b { - return a < b - } - if a, b := m_i.MsgId, m_j.MsgId; a != b { - return a < b - } - if a, b := m_i.MsgIdPlural, m_j.MsgIdPlural; a != b { - return a < b - } - return false -} diff --git a/vendor/github.com/chai2010/gettext-go/mo/util.go b/vendor/github.com/chai2010/gettext-go/mo/util.go deleted file mode 100644 index 3804511053..0000000000 --- a/vendor/github.com/chai2010/gettext-go/mo/util.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mo - -import ( - "bytes" - "strings" -) - -func decodePoString(text string) string { - lines := strings.Split(text, "\n") - for i := 0; i < len(lines); i++ { - left := strings.Index(lines[i], `"`) - right := strings.LastIndex(lines[i], `"`) - if left < 0 || right < 0 || left == right { - lines[i] = "" - continue - } - line := lines[i][left+1 : right] - data := make([]byte, 0, len(line)) - for i := 0; i < len(line); i++ { - if line[i] != '\\' { - data = append(data, line[i]) - continue - } - if i+1 >= len(line) { - break - } - switch line[i+1] { - case 'n': // \\n -> \n - data = append(data, '\n') - i++ - case 't': // \\t -> \n - data = append(data, '\t') - i++ - case '\\': // \\\ -> ? - data = append(data, '\\') - i++ - } - } - lines[i] = string(data) - } - return strings.Join(lines, "") -} - -func encodePoString(text string) string { - var buf bytes.Buffer - lines := strings.Split(text, "\n") - for i := 0; i < len(lines); i++ { - if lines[i] == "" { - if i != len(lines)-1 { - buf.WriteString(`"\n"` + "\n") - } - continue - } - buf.WriteRune('"') - for _, r := range lines[i] { - switch r { - case '\\': - buf.WriteString(`\\`) - case '"': - buf.WriteString(`\"`) - case '\n': - buf.WriteString(`\n`) - case '\t': - buf.WriteString(`\t`) - default: - buf.WriteRune(r) - } - } - buf.WriteString(`\n"` + "\n") - } - return buf.String() -} - -func encodeCommentPoString(text string) string { - var buf bytes.Buffer - lines := strings.Split(text, "\n") - if len(lines) > 1 { - buf.WriteString(`""` + "\n") - } - for i := 0; i < len(lines); i++ { - if len(lines) > 0 { - buf.WriteString("#| ") - } - buf.WriteRune('"') - for _, r := range lines[i] { - switch r { - case '\\': - buf.WriteString(`\\`) - case '"': - buf.WriteString(`\"`) - case '\n': - buf.WriteString(`\n`) - case '\t': - buf.WriteString(`\t`) - default: - buf.WriteRune(r) - } - } - if i < len(lines)-1 { - buf.WriteString(`\n"` + "\n") - } else { - buf.WriteString(`"`) - } - } - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/plural/doc.go b/vendor/github.com/chai2010/gettext-go/plural/doc.go deleted file mode 100644 index 31cb8fae9f..0000000000 --- a/vendor/github.com/chai2010/gettext-go/plural/doc.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package plural provides standard plural formulas. - -Examples: - import ( - "github.com/chai2010/gettext-go/plural" - ) - - func main() { - enFormula := plural.Formula("en_US") - xxFormula := plural.Formula("zh_CN") - - fmt.Printf("%s: %d\n", "en", enFormula(0)) - fmt.Printf("%s: %d\n", "en", enFormula(1)) - fmt.Printf("%s: %d\n", "en", enFormula(2)) - fmt.Printf("%s: %d\n", "??", xxFormula(0)) - fmt.Printf("%s: %d\n", "??", xxFormula(1)) - fmt.Printf("%s: %d\n", "??", xxFormula(2)) - fmt.Printf("%s: %d\n", "??", xxFormula(9)) - // Output: - // en: 0 - // en: 0 - // en: 1 - // ??: 0 - // ??: 0 - // ??: 1 - // ??: 8 - } - -See http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html -*/ -package plural diff --git a/vendor/github.com/chai2010/gettext-go/plural/formula.go b/vendor/github.com/chai2010/gettext-go/plural/formula.go deleted file mode 100644 index 679a1cd50d..0000000000 --- a/vendor/github.com/chai2010/gettext-go/plural/formula.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package plural - -import ( - "strings" -) - -// Formula provides the language's standard plural formula. -func Formula(lang string) func(n int) int { - if idx := index(lang); idx != -1 { - return formulaTable[fmtForms(FormsTable[idx].Value)] - } - if idx := index("??"); idx != -1 { - return formulaTable[fmtForms(FormsTable[idx].Value)] - } - return func(n int) int { - return n - } -} - -func index(lang string) int { - for i := 0; i < len(FormsTable); i++ { - if strings.HasPrefix(lang, FormsTable[i].Lang) { - return i - } - } - return -1 -} - -func fmtForms(forms string) string { - forms = strings.TrimSpace(forms) - forms = strings.Replace(forms, " ", "", -1) - return forms -} - -var formulaTable = map[string]func(n int) int{ - fmtForms("nplurals=n; plural=n-1;"): func(n int) int { - if n > 0 { - return n - 1 - } - return 0 - }, - fmtForms("nplurals=1; plural=0;"): func(n int) int { - return 0 - }, - fmtForms("nplurals=2; plural=(n != 1);"): func(n int) int { - if n <= 1 { - return 0 - } - return 1 - }, - fmtForms("nplurals=2; plural=(n > 1);"): func(n int) int { - if n <= 1 { - return 0 - } - return 1 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n != 0 { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;"): func(n int) int { - if n == 1 { - return 0 - } - if n == 2 { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;"): func(n int) int { - if n == 1 { - return 0 - } - if n == 0 || (n%100 > 0 && n%100 < 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n%10 >= 2 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n%10 >= 2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n%10 >= 2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n%10 >= 2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n%10 >= 2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n%10 == 1 && n%100 != 11 { - return 0 - } - if n%10 >= 2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"): func(n int) int { - if n == 1 { - return 0 - } - if n >= 2 && n <= 4 { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"): func(n int) int { - if n == 1 { - return 0 - } - if n >= 2 && n <= 4 { - return 1 - } - return 2 - }, - fmtForms("nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"): func(n int) int { - if n == 1 { - return 0 - } - if n%10 >= 2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20) { - return 1 - } - return 2 - }, - fmtForms("nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"): func(n int) int { - if n%100 == 1 { - return 0 - } - if n%100 == 2 { - return 1 - } - if n%100 == 3 || n%100 == 4 { - return 2 - } - return 3 - }, -} diff --git a/vendor/github.com/chai2010/gettext-go/plural/table.go b/vendor/github.com/chai2010/gettext-go/plural/table.go deleted file mode 100644 index cdc50d2110..0000000000 --- a/vendor/github.com/chai2010/gettext-go/plural/table.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package plural - -// FormsTable are standard hard-coded plural rules. -// The application developers and the translators need to understand them. -// -// See GNU's gettext library source code: gettext/gettext-tools/src/plural-table.c -var FormsTable = []struct { - Lang string - Language string - Value string -}{ - {"??", "Unknown", "nplurals=1; plural=0;"}, - {"ja", "Japanese", "nplurals=1; plural=0;"}, - {"vi", "Vietnamese", "nplurals=1; plural=0;"}, - {"ko", "Korean", "nplurals=1; plural=0;"}, - {"en", "English", "nplurals=2; plural=(n != 1);"}, - {"de", "German", "nplurals=2; plural=(n != 1);"}, - {"nl", "Dutch", "nplurals=2; plural=(n != 1);"}, - {"sv", "Swedish", "nplurals=2; plural=(n != 1);"}, - {"da", "Danish", "nplurals=2; plural=(n != 1);"}, - {"no", "Norwegian", "nplurals=2; plural=(n != 1);"}, - {"nb", "Norwegian Bokmal", "nplurals=2; plural=(n != 1);"}, - {"nn", "Norwegian Nynorsk", "nplurals=2; plural=(n != 1);"}, - {"fo", "Faroese", "nplurals=2; plural=(n != 1);"}, - {"es", "Spanish", "nplurals=2; plural=(n != 1);"}, - {"pt", "Portuguese", "nplurals=2; plural=(n != 1);"}, - {"it", "Italian", "nplurals=2; plural=(n != 1);"}, - {"bg", "Bulgarian", "nplurals=2; plural=(n != 1);"}, - {"el", "Greek", "nplurals=2; plural=(n != 1);"}, - {"fi", "Finnish", "nplurals=2; plural=(n != 1);"}, - {"et", "Estonian", "nplurals=2; plural=(n != 1);"}, - {"he", "Hebrew", "nplurals=2; plural=(n != 1);"}, - {"eo", "Esperanto", "nplurals=2; plural=(n != 1);"}, - {"hu", "Hungarian", "nplurals=2; plural=(n != 1);"}, - {"tr", "Turkish", "nplurals=2; plural=(n != 1);"}, - {"pt_BR", "Brazilian", "nplurals=2; plural=(n > 1);"}, - {"fr", "French", "nplurals=2; plural=(n > 1);"}, - {"lv", "Latvian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"}, - {"ga", "Irish", "nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;"}, - {"ro", "Romanian", "nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;"}, - {"lt", "Lithuanian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"ru", "Russian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"uk", "Ukrainian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"be", "Belarusian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"sr", "Serbian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"hr", "Croatian", "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"cs", "Czech", "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"}, - {"sk", "Slovak", "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"}, - {"pl", "Polish", "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"}, - {"sl", "Slovenian", "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"}, -} diff --git a/vendor/github.com/chai2010/gettext-go/po/comment.go b/vendor/github.com/chai2010/gettext-go/po/comment.go deleted file mode 100644 index d4abe7c106..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/comment.go +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" -) - -// Comment represents every message's comments. -type Comment struct { - StartLine int // comment start line - TranslatorComment string // # translator-comments // TrimSpace - ExtractedComment string // #. extracted-comments - ReferenceFile []string // #: src/msgcmp.c:338 src/po-lex.c:699 - ReferenceLine []int // #: src/msgcmp.c:338 src/po-lex.c:699 - Flags []string // #, fuzzy,c-format,range:0..10 - PrevMsgContext string // #| msgctxt previous-context - PrevMsgId string // #| msgid previous-untranslated-string -} - -func (p *Comment) less(q *Comment) bool { - if p.StartLine != 0 || q.StartLine != 0 { - return p.StartLine < q.StartLine - } - if a, b := len(p.ReferenceFile), len(q.ReferenceFile); a != b { - return a < b - } - for i := 0; i < len(p.ReferenceFile); i++ { - if a, b := p.ReferenceFile[i], q.ReferenceFile[i]; a != b { - return a < b - } - if a, b := p.ReferenceLine[i], q.ReferenceLine[i]; a != b { - return a < b - } - } - return false -} - -func (p *Comment) readPoComment(r *lineReader) (err error) { - *p = Comment{} - if err = r.skipBlankLine(); err != nil { - return err - } - defer func(oldPos int) { - newPos := r.currentPos() - if newPos != oldPos && err == io.EOF { - err = nil - } - }(r.currentPos()) - - p.StartLine = r.currentPos() + 1 - for { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if len(s) == 0 || s[0] != '#' { - return - } - - if err = p.readTranslatorComment(r); err != nil { - return - } - if err = p.readExtractedComment(r); err != nil { - return - } - if err = p.readReferenceComment(r); err != nil { - return - } - if err = p.readFlagsComment(r); err != nil { - return - } - if err = p.readPrevMsgContext(r); err != nil { - return - } - if err = p.readPrevMsgId(r); err != nil { - return - } - } -} - -func (p *Comment) readTranslatorComment(r *lineReader) (err error) { - const prefix = "# " // .,:| - for { - var s string - if s, _, err = r.readLine(); err != nil { - return err - } - if len(s) < 1 || s[0] != '#' { - r.unreadLine() - return nil - } - if len(s) >= 2 { - switch s[1] { - case '.', ',', ':', '|': - r.unreadLine() - return nil - } - } - if p.TranslatorComment != "" { - p.TranslatorComment += "\n" - } - p.TranslatorComment += strings.TrimSpace(s[1:]) - } -} - -func (p *Comment) readExtractedComment(r *lineReader) (err error) { - const prefix = "#." - for { - var s string - if s, _, err = r.readLine(); err != nil { - return err - } - if len(s) < len(prefix) || s[:len(prefix)] != prefix { - r.unreadLine() - return nil - } - if p.ExtractedComment != "" { - p.ExtractedComment += "\n" - } - p.ExtractedComment += strings.TrimSpace(s[len(prefix):]) - } -} - -func (p *Comment) readReferenceComment(r *lineReader) (err error) { - const prefix = "#:" - for { - var s string - if s, _, err = r.readLine(); err != nil { - return err - } - if len(s) < len(prefix) || s[:len(prefix)] != prefix { - r.unreadLine() - return nil - } - ss := strings.Split(strings.TrimSpace(s[len(prefix):]), " ") - for i := 0; i < len(ss); i++ { - idx := strings.Index(ss[i], ":") - if idx <= 0 { - continue - } - name := strings.TrimSpace(ss[i][:idx]) - line, _ := strconv.Atoi(strings.TrimSpace(ss[i][idx+1:])) - p.ReferenceFile = append(p.ReferenceFile, name) - p.ReferenceLine = append(p.ReferenceLine, line) - } - } -} - -func (p *Comment) readFlagsComment(r *lineReader) (err error) { - const prefix = "#," - for { - var s string - if s, _, err = r.readLine(); err != nil { - return err - } - if len(s) < len(prefix) || s[:len(prefix)] != prefix { - r.unreadLine() - return nil - } - ss := strings.Split(strings.TrimSpace(s[len(prefix):]), ",") - for i := 0; i < len(ss); i++ { - p.Flags = append(p.Flags, strings.TrimSpace(ss[i])) - } - } -} - -func (p *Comment) readPrevMsgContext(r *lineReader) (err error) { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if !rePrevMsgContextComments.MatchString(s) { - return - } - p.PrevMsgContext, err = p.readString(r) - return -} - -func (p *Comment) readPrevMsgId(r *lineReader) (err error) { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if !rePrevMsgIdComments.MatchString(s) { - return - } - p.PrevMsgId, err = p.readString(r) - return -} - -func (p *Comment) readString(r *lineReader) (msg string, err error) { - var s string - if s, _, err = r.readLine(); err != nil { - return - } - msg += decodePoString(s) - for { - if s, _, err = r.readLine(); err != nil { - return - } - if !reStringLineComments.MatchString(s) { - r.unreadLine() - break - } - msg += decodePoString(s) - } - return -} - -// GetFuzzy gets the fuzzy flag. -func (p *Comment) GetFuzzy() bool { - for _, s := range p.Flags { - if s == "fuzzy" { - return true - } - } - return false -} - -// SetFuzzy sets the fuzzy flag. -func (p *Comment) SetFuzzy(fuzzy bool) { - // -} - -// String returns the po format comment string. -func (p Comment) String() string { - var buf bytes.Buffer - if p.TranslatorComment != "" { - ss := strings.Split(p.TranslatorComment, "\n") - for i := 0; i < len(ss); i++ { - fmt.Fprintf(&buf, "# %s\n", ss[i]) - } - } - if p.ExtractedComment != "" { - ss := strings.Split(p.ExtractedComment, "\n") - for i := 0; i < len(ss); i++ { - fmt.Fprintf(&buf, "#. %s\n", ss[i]) - } - } - if a, b := len(p.ReferenceFile), len(p.ReferenceLine); a != 0 && a == b { - fmt.Fprintf(&buf, "#:") - for i := 0; i < len(p.ReferenceFile); i++ { - fmt.Fprintf(&buf, " %s:%d", p.ReferenceFile[i], p.ReferenceLine[i]) - } - fmt.Fprintf(&buf, "\n") - } - if len(p.Flags) != 0 { - fmt.Fprintf(&buf, "#, %s", p.Flags[0]) - for i := 1; i < len(p.Flags); i++ { - fmt.Fprintf(&buf, ", %s", p.Flags[i]) - } - fmt.Fprintf(&buf, "\n") - } - if p.PrevMsgContext != "" { - s := encodeCommentPoString(p.PrevMsgContext) - fmt.Fprintf(&buf, "#| msgctxt %s\n", s) - } - if p.PrevMsgId != "" { - s := encodeCommentPoString(p.PrevMsgId) - fmt.Fprintf(&buf, "#| msgid %s\n", s) - } - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/po/doc.go b/vendor/github.com/chai2010/gettext-go/po/doc.go deleted file mode 100644 index 6cfa2a24be..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package po provides support for reading and writing GNU PO file. - -Examples: - import ( - "github.com/chai2010/gettext-go/po" - ) - - func main() { - poFile, err := po.LoadFile("test.po") - if err != nil { - log.Fatal(err) - } - fmt.Printf("%v", poFile) - } - -The GNU PO file specification is at -http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html. -*/ -package po diff --git a/vendor/github.com/chai2010/gettext-go/po/file.go b/vendor/github.com/chai2010/gettext-go/po/file.go deleted file mode 100644 index 4a122eeb8b..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/file.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "sort" -) - -// File represents an PO File. -// -// See http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html -type File struct { - MimeHeader Header - Messages []Message -} - -// Load loads po file format data. -func Load(data []byte) (*File, error) { - return loadData(data) -} - -// LoadFile loads a named po file. -func LoadFile(path string) (*File, error) { - data, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - return loadData(data) -} - -func loadData(data []byte) (*File, error) { - r := newLineReader(string(data)) - var file File - for { - var msg Message - if err := msg.readPoEntry(r); err != nil { - if err == io.EOF { - return &file, nil - } - return nil, err - } - if msg.MsgId == "" { - file.MimeHeader.parseHeader(&msg) - continue - } - file.Messages = append(file.Messages, msg) - } -} - -// Save saves a po file. -func (f *File) Save(name string) error { - return ioutil.WriteFile(name, []byte(f.String()), 0666) -} - -// Save returns a po file format data. -func (f *File) Data() []byte { - // sort the massge as ReferenceFile/ReferenceLine field - var messages []Message - messages = append(messages, f.Messages...) - sort.Slice(messages, func(i, j int) bool { - return messages[i].less(&messages[j]) - }) - - var buf bytes.Buffer - fmt.Fprintf(&buf, "%s\n", f.MimeHeader.String()) - for i := 0; i < len(messages); i++ { - fmt.Fprintf(&buf, "%s\n", messages[i].String()) - } - return buf.Bytes() -} - -// String returns the po format file string. -func (f *File) String() string { - return string(f.Data()) -} diff --git a/vendor/github.com/chai2010/gettext-go/po/header.go b/vendor/github.com/chai2010/gettext-go/po/header.go deleted file mode 100644 index a9b5b6671b..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/header.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "bytes" - "fmt" - "strings" -) - -// Header is the initial comments "SOME DESCRIPTIVE TITLE", "YEAR" -// and "FIRST AUTHOR , YEAR" ought to be replaced by sensible information. -// -// See http://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html#Header-Entry -type Header struct { - Comment // Header Comments - ProjectIdVersion string // Project-Id-Version: PACKAGE VERSION - ReportMsgidBugsTo string // Report-Msgid-Bugs-To: FIRST AUTHOR - POTCreationDate string // POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE - PORevisionDate string // PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE - LastTranslator string // Last-Translator: FIRST AUTHOR - LanguageTeam string // Language-Team: golang-china - Language string // Language: zh_CN - MimeVersion string // MIME-Version: 1.0 - ContentType string // Content-Type: text/plain; charset=UTF-8 - ContentTransferEncoding string // Content-Transfer-Encoding: 8bit - PluralForms string // Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; - XGenerator string // X-Generator: Poedit 1.5.5 - UnknowFields map[string]string -} - -func (p *Header) parseHeader(msg *Message) { - if msg.MsgId != "" || msg.MsgStr == "" { - return - } - lines := strings.Split(msg.MsgStr, "\n") - for i := 0; i < len(lines); i++ { - idx := strings.Index(lines[i], ":") - if idx < 0 { - continue - } - key := strings.TrimSpace(lines[i][:idx]) - val := strings.TrimSpace(lines[i][idx+1:]) - switch strings.ToUpper(key) { - case strings.ToUpper("Project-Id-Version"): - p.ProjectIdVersion = val - case strings.ToUpper("Report-Msgid-Bugs-To"): - p.ReportMsgidBugsTo = val - case strings.ToUpper("POT-Creation-Date"): - p.POTCreationDate = val - case strings.ToUpper("PO-Revision-Date"): - p.PORevisionDate = val - case strings.ToUpper("Last-Translator"): - p.LastTranslator = val - case strings.ToUpper("Language-Team"): - p.LanguageTeam = val - case strings.ToUpper("Language"): - p.Language = val - case strings.ToUpper("MIME-Version"): - p.MimeVersion = val - case strings.ToUpper("Content-Type"): - p.ContentType = val - case strings.ToUpper("Content-Transfer-Encoding"): - p.ContentTransferEncoding = val - case strings.ToUpper("Plural-Forms"): - p.PluralForms = val - case strings.ToUpper("X-Generator"): - p.XGenerator = val - default: - if p.UnknowFields == nil { - p.UnknowFields = make(map[string]string) - } - p.UnknowFields[key] = val - } - } - p.Comment = msg.Comment -} - -// String returns the po format header string. -func (p Header) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "%s", p.Comment.String()) - fmt.Fprintf(&buf, `msgid ""`+"\n") - fmt.Fprintf(&buf, `msgstr ""`+"\n") - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Project-Id-Version", p.ProjectIdVersion) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Report-Msgid-Bugs-To", p.ReportMsgidBugsTo) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "POT-Creation-Date", p.POTCreationDate) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "PO-Revision-Date", p.PORevisionDate) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Last-Translator", p.LastTranslator) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Language-Team", p.LanguageTeam) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Language", p.Language) - if p.MimeVersion != "" { - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "MIME-Version", p.MimeVersion) - } - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Content-Type", p.ContentType) - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "Content-Transfer-Encoding", p.ContentTransferEncoding) - if p.XGenerator != "" { - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", "X-Generator", p.XGenerator) - } - for k, v := range p.UnknowFields { - fmt.Fprintf(&buf, `"%s: %s\n"`+"\n", k, v) - } - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/po/line_reader.go b/vendor/github.com/chai2010/gettext-go/po/line_reader.go deleted file mode 100644 index 8597273a2b..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/line_reader.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "io" - "strings" -) - -type lineReader struct { - lines []string - pos int -} - -func newLineReader(data string) *lineReader { - data = strings.Replace(data, "\r", "", -1) - lines := strings.Split(data, "\n") - return &lineReader{lines: lines} -} - -func (r *lineReader) skipBlankLine() error { - for ; r.pos < len(r.lines); r.pos++ { - if strings.TrimSpace(r.lines[r.pos]) != "" { - break - } - } - if r.pos >= len(r.lines) { - return io.EOF - } - return nil -} - -func (r *lineReader) currentPos() int { - return r.pos -} - -func (r *lineReader) currentLine() (s string, pos int, err error) { - if r.pos >= len(r.lines) { - err = io.EOF - return - } - s, pos = r.lines[r.pos], r.pos - return -} - -func (r *lineReader) readLine() (s string, pos int, err error) { - if r.pos >= len(r.lines) { - err = io.EOF - return - } - s, pos = r.lines[r.pos], r.pos - r.pos++ - return -} - -func (r *lineReader) unreadLine() { - if r.pos >= 0 { - r.pos-- - } -} diff --git a/vendor/github.com/chai2010/gettext-go/po/message.go b/vendor/github.com/chai2010/gettext-go/po/message.go deleted file mode 100644 index 39936dcc7b..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/message.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" -) - -// A PO file is made up of many entries, -// each entry holding the relation between an original untranslated string -// and its corresponding translation. -// -// See http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html -type Message struct { - Comment // Coments - MsgContext string // msgctxt context - MsgId string // msgid untranslated-string - MsgIdPlural string // msgid_plural untranslated-string-plural - MsgStr string // msgstr translated-string - MsgStrPlural []string // msgstr[0] translated-string-case-0 -} - -func (p *Message) less(q *Message) bool { - if p.Comment.less(&q.Comment) { - return true - } - if a, b := p.MsgContext, q.MsgContext; a != b { - return a < b - } - if a, b := p.MsgId, q.MsgId; a != b { - return a < b - } - if a, b := p.MsgIdPlural, q.MsgIdPlural; a != b { - return a < b - } - return false -} - -func (p *Message) readPoEntry(r *lineReader) (err error) { - *p = Message{} - if err = r.skipBlankLine(); err != nil { - return - } - defer func(oldPos int) { - newPos := r.currentPos() - if newPos != oldPos && err == io.EOF { - err = nil - } - }(r.currentPos()) - - if err = p.Comment.readPoComment(r); err != nil { - return - } - for { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - - if p.isInvalidLine(s) { - err = fmt.Errorf("gettext: line %d, %v", r.currentPos(), "invalid line") - return - } - if reComment.MatchString(s) || reBlankLine.MatchString(s) { - return - } - - if err = p.readMsgContext(r); err != nil { - return - } - if err = p.readMsgId(r); err != nil { - return - } - if err = p.readMsgIdPlural(r); err != nil { - return - } - if err = p.readMsgStrOrPlural(r); err != nil { - return - } - } -} - -func (p *Message) readMsgContext(r *lineReader) (err error) { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if !reMsgContext.MatchString(s) { - return - } - p.MsgContext, err = p.readString(r) - return -} - -func (p *Message) readMsgId(r *lineReader) (err error) { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if !reMsgId.MatchString(s) { - return - } - p.MsgId, err = p.readString(r) - return -} - -func (p *Message) readMsgIdPlural(r *lineReader) (err error) { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if !reMsgIdPlural.MatchString(s) { - return - } - p.MsgIdPlural, err = p.readString(r) - return nil -} - -func (p *Message) readMsgStrOrPlural(r *lineReader) (err error) { - var s string - if s, _, err = r.currentLine(); err != nil { - return - } - if !reMsgStr.MatchString(s) && !reMsgStrPlural.MatchString(s) { - return - } - if reMsgStrPlural.MatchString(s) { - left, right := strings.Index(s, `[`), strings.LastIndex(s, `]`) - idx, _ := strconv.Atoi(s[left+1 : right]) - s, err = p.readString(r) - if n := len(p.MsgStrPlural); (idx + 1) > n { - p.MsgStrPlural = append(p.MsgStrPlural, make([]string, (idx+1)-n)...) - } - p.MsgStrPlural[idx] = s - } else { - p.MsgStr, err = p.readString(r) - } - return nil -} - -func (p *Message) readString(r *lineReader) (msg string, err error) { - var s string - if s, _, err = r.readLine(); err != nil { - return - } - msg += decodePoString(s) - for { - if s, _, err = r.readLine(); err != nil { - return - } - if !reStringLine.MatchString(s) { - r.unreadLine() - break - } - msg += decodePoString(s) - } - return -} - -// String returns the po format entry string. -func (p Message) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "%s", p.Comment.String()) - if p.MsgContext != "" { - fmt.Fprintf(&buf, "msgctxt %s", encodePoString(p.MsgContext)) - } - fmt.Fprintf(&buf, "msgid %s", encodePoString(p.MsgId)) - if p.MsgIdPlural != "" { - fmt.Fprintf(&buf, "msgid_plural %s", encodePoString(p.MsgIdPlural)) - } - if len(p.MsgStrPlural) == 0 { - if p.MsgStr != "" { - fmt.Fprintf(&buf, "msgstr %s", encodePoString(p.MsgStr)) - } else { - fmt.Fprintf(&buf, "msgstr %s", `""`+"\n") - } - } else { - for i := 0; i < len(p.MsgStrPlural); i++ { - if p.MsgStrPlural[i] != "" { - fmt.Fprintf(&buf, "msgstr[%d] %s", i, encodePoString(p.MsgStrPlural[i])) - } else { - fmt.Fprintf(&buf, "msgstr[%d] %s", i, `""`+"\n") - } - } - } - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/po/re.go b/vendor/github.com/chai2010/gettext-go/po/re.go deleted file mode 100644 index 67c240a57b..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/re.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "regexp" -) - -var ( - reComment = regexp.MustCompile(`^#`) // # - reExtractedComments = regexp.MustCompile(`^#\.`) // #. - reReferenceComments = regexp.MustCompile(`^#:`) // #: - reFlagsComments = regexp.MustCompile(`^#,`) // #, fuzzy,c-format - rePrevMsgContextComments = regexp.MustCompile(`^#\|\s+msgctxt`) // #| msgctxt - rePrevMsgIdComments = regexp.MustCompile(`^#\|\s+msgid`) // #| msgid - reStringLineComments = regexp.MustCompile(`^#\|\s+".*"\s*$`) // #| "message" - - reMsgContext = regexp.MustCompile(`^msgctxt\s+".*"\s*$`) // msgctxt - reMsgId = regexp.MustCompile(`^msgid\s+".*"\s*$`) // msgid - reMsgIdPlural = regexp.MustCompile(`^msgid_plural\s+".*"\s*$`) // msgid_plural - reMsgStr = regexp.MustCompile(`^msgstr\s*".*"\s*$`) // msgstr - reMsgStrPlural = regexp.MustCompile(`^msgstr\s*(\[\d+\])\s*".*"\s*$`) // msgstr[0] - reStringLine = regexp.MustCompile(`^\s*".*"\s*$`) // "message" - reBlankLine = regexp.MustCompile(`^\s*$`) // -) - -func (p *Message) isInvalidLine(s string) bool { - if reComment.MatchString(s) { - return false - } - if reBlankLine.MatchString(s) { - return false - } - - if reMsgContext.MatchString(s) { - return false - } - if reMsgId.MatchString(s) { - return false - } - if reMsgIdPlural.MatchString(s) { - return false - } - if reMsgStr.MatchString(s) { - return false - } - if reMsgStrPlural.MatchString(s) { - return false - } - - if reStringLine.MatchString(s) { - return false - } - - return true -} diff --git a/vendor/github.com/chai2010/gettext-go/po/util.go b/vendor/github.com/chai2010/gettext-go/po/util.go deleted file mode 100644 index d8b3b0e254..0000000000 --- a/vendor/github.com/chai2010/gettext-go/po/util.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package po - -import ( - "bytes" - "strings" -) - -func decodePoString(text string) string { - lines := strings.Split(text, "\n") - for i := 0; i < len(lines); i++ { - left := strings.Index(lines[i], `"`) - right := strings.LastIndex(lines[i], `"`) - if left < 0 || right < 0 || left == right { - lines[i] = "" - continue - } - line := lines[i][left+1 : right] - data := make([]byte, 0, len(line)) - for i := 0; i < len(line); i++ { - if line[i] != '\\' { - data = append(data, line[i]) - continue - } - if i+1 >= len(line) { - break - } - switch line[i+1] { - case 'n': // \\n -> \n - data = append(data, '\n') - i++ - case 't': // \\t -> \n - data = append(data, '\t') - i++ - case '\\': // \\\ -> ? - data = append(data, '\\') - i++ - } - } - lines[i] = string(data) - } - return strings.Join(lines, "") -} - -func encodePoString(text string) string { - var buf bytes.Buffer - lines := strings.Split(text, "\n") - for i := 0; i < len(lines); i++ { - if lines[i] == "" { - if i != len(lines)-1 { - buf.WriteString(`"\n"` + "\n") - } - continue - } - buf.WriteRune('"') - for _, r := range lines[i] { - switch r { - case '\\': - buf.WriteString(`\\`) - case '"': - buf.WriteString(`\"`) - case '\n': - buf.WriteString(`\n`) - case '\t': - buf.WriteString(`\t`) - default: - buf.WriteRune(r) - } - } - if i < len(lines)-1 { - buf.WriteString(`\n"` + "\n") - } else { - buf.WriteString(`"` + "\n") - } - } - return buf.String() -} - -func encodeCommentPoString(text string) string { - var buf bytes.Buffer - lines := strings.Split(text, "\n") - if len(lines) > 1 { - buf.WriteString(`""` + "\n") - } - for i := 0; i < len(lines); i++ { - if len(lines) > 0 { - buf.WriteString("#| ") - } - buf.WriteRune('"') - for _, r := range lines[i] { - switch r { - case '\\': - buf.WriteString(`\\`) - case '"': - buf.WriteString(`\"`) - case '\n': - buf.WriteString(`\n`) - case '\t': - buf.WriteString(`\t`) - default: - buf.WriteRune(r) - } - } - if i < len(lines)-1 { - buf.WriteString(`\n"` + "\n") - } else { - buf.WriteString(`"`) - } - } - return buf.String() -} diff --git a/vendor/github.com/chai2010/gettext-go/tr.go b/vendor/github.com/chai2010/gettext-go/tr.go deleted file mode 100644 index 5b9d08f426..0000000000 --- a/vendor/github.com/chai2010/gettext-go/tr.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "encoding/json" - - "github.com/chai2010/gettext-go/mo" - "github.com/chai2010/gettext-go/plural" - "github.com/chai2010/gettext-go/po" -) - -var nilTranslator = &translator{ - MessageMap: make(map[string]mo.Message), - PluralFormula: plural.Formula("??"), -} - -type translator struct { - MessageMap map[string]mo.Message - PluralFormula func(n int) int -} - -func newMoTranslator(name string, data []byte) (*translator, error) { - var ( - f *mo.File - err error - ) - if len(data) != 0 { - f, err = mo.Load(data) - } else { - f, err = mo.LoadFile(name) - } - if err != nil { - return nil, err - } - var tr = &translator{ - MessageMap: make(map[string]mo.Message), - } - for _, v := range f.Messages { - tr.MessageMap[tr.makeMapKey(v.MsgContext, v.MsgId)] = v - } - if lang := f.MimeHeader.Language; lang != "" { - tr.PluralFormula = plural.Formula(lang) - } else { - tr.PluralFormula = plural.Formula("??") - } - return tr, nil -} - -func newPoTranslator(name string, data []byte) (*translator, error) { - var ( - f *po.File - err error - ) - if len(data) != 0 { - f, err = po.Load(data) - } else { - f, err = po.LoadFile(name) - } - if err != nil { - return nil, err - } - var tr = &translator{ - MessageMap: make(map[string]mo.Message), - } - for _, v := range f.Messages { - tr.MessageMap[tr.makeMapKey(v.MsgContext, v.MsgId)] = mo.Message{ - MsgContext: v.MsgContext, - MsgId: v.MsgId, - MsgIdPlural: v.MsgIdPlural, - MsgStr: v.MsgStr, - MsgStrPlural: v.MsgStrPlural, - } - } - if lang := f.MimeHeader.Language; lang != "" { - tr.PluralFormula = plural.Formula(lang) - } else { - tr.PluralFormula = plural.Formula("??") - } - return tr, nil -} - -func newJsonTranslator(lang, name string, jsonData []byte) (*translator, error) { - var msgList []struct { - MsgContext string `json:"msgctxt"` // msgctxt context - MsgId string `json:"msgid"` // msgid untranslated-string - MsgIdPlural string `json:"msgid_plural"` // msgid_plural untranslated-string-plural - MsgStr []string `json:"msgstr"` // msgstr translated-string - } - if err := json.Unmarshal(jsonData, &msgList); err != nil { - return nil, err - } - - var tr = &translator{ - MessageMap: make(map[string]mo.Message), - PluralFormula: plural.Formula(lang), - } - - for _, v := range msgList { - var v_MsgStr string - var v_MsgStrPlural = v.MsgStr - - if len(v.MsgStr) != 0 { - v_MsgStr = v.MsgStr[0] - } - - tr.MessageMap[tr.makeMapKey(v.MsgContext, v.MsgId)] = mo.Message{ - MsgContext: v.MsgContext, - MsgId: v.MsgId, - MsgIdPlural: v.MsgIdPlural, - MsgStr: v_MsgStr, - MsgStrPlural: v_MsgStrPlural, - } - } - return tr, nil -} - -func (p *translator) PGettext(msgctxt, msgid string) string { - return p.findMsgStr(msgctxt, msgid) -} - -func (p *translator) PNGettext(msgctxt, msgid, msgidPlural string, n int) string { - n = p.PluralFormula(n) - if ss := p.findMsgStrPlural(msgctxt, msgid, msgidPlural); len(ss) != 0 { - if n >= len(ss) { - n = len(ss) - 1 - } - if ss[n] != "" { - return ss[n] - } - } - if msgidPlural != "" && n > 0 { - return msgidPlural - } - return msgid -} - -func (p *translator) findMsgStr(msgctxt, msgid string) string { - key := p.makeMapKey(msgctxt, msgid) - if v, ok := p.MessageMap[key]; ok { - if v.MsgStr != "" { - return v.MsgStr - } - } - return msgid -} - -func (p *translator) findMsgStrPlural(msgctxt, msgid, msgidPlural string) []string { - key := p.makeMapKey(msgctxt, msgid) - if v, ok := p.MessageMap[key]; ok { - if len(v.MsgIdPlural) != 0 { - if len(v.MsgStrPlural) != 0 { - return v.MsgStrPlural - } else { - return nil - } - } else { - if len(v.MsgStr) != 0 { - return []string{v.MsgStr} - } else { - return nil - } - } - } - return nil -} - -func (p *translator) makeMapKey(msgctxt, msgid string) string { - if msgctxt != "" { - return msgctxt + mo.EotSeparator + msgid - } - return msgid -} diff --git a/vendor/github.com/chai2010/gettext-go/util.go b/vendor/github.com/chai2010/gettext-go/util.go deleted file mode 100644 index b8269a605c..0000000000 --- a/vendor/github.com/chai2010/gettext-go/util.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2013 ChaiShushan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gettext - -import ( - "os" - "strings" -) - -func getDefaultLanguage() string { - if v := os.Getenv("LC_MESSAGES"); v != "" { - return simplifiedLanguage(v) - } - if v := os.Getenv("LANG"); v != "" { - return simplifiedLanguage(v) - } - return "default" -} - -func simplifiedLanguage(lang string) string { - // en_US/en_US.UTF-8/zh_CN/zh_TW/el_GR@euro/... - if idx := strings.Index(lang, ":"); idx != -1 { - lang = lang[:idx] - } - if idx := strings.Index(lang, "@"); idx != -1 { - lang = lang[:idx] - } - if idx := strings.Index(lang, "."); idx != -1 { - lang = lang[:idx] - } - return strings.TrimSpace(lang) -} diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md b/vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md deleted file mode 100644 index 1cade6cef6..0000000000 --- a/vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Brian Goff - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go deleted file mode 100644 index 42bf32aab0..0000000000 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go +++ /dev/null @@ -1,16 +0,0 @@ -package md2man - -import ( - "github.com/russross/blackfriday/v2" -) - -// Render converts a markdown document into a roff formatted document. -func Render(doc []byte) []byte { - renderer := NewRoffRenderer() - - return blackfriday.Run(doc, - []blackfriday.Option{ - blackfriday.WithRenderer(renderer), - blackfriday.WithExtensions(renderer.GetExtensions()), - }...) -} diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go deleted file mode 100644 index 4b19188d90..0000000000 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ /dev/null @@ -1,348 +0,0 @@ -package md2man - -import ( - "bytes" - "fmt" - "io" - "os" - "strings" - - "github.com/russross/blackfriday/v2" -) - -// roffRenderer implements the blackfriday.Renderer interface for creating -// roff format (manpages) from markdown text -type roffRenderer struct { - extensions blackfriday.Extensions - listCounters []int - firstHeader bool - firstDD bool - listDepth int -} - -const ( - titleHeader = ".TH " - topLevelHeader = "\n\n.SH " - secondLevelHdr = "\n.SH " - otherHeader = "\n.SS " - crTag = "\n" - emphTag = "\\fI" - emphCloseTag = "\\fP" - strongTag = "\\fB" - strongCloseTag = "\\fP" - breakTag = "\n.br\n" - paraTag = "\n.PP\n" - hruleTag = "\n.ti 0\n\\l'\\n(.lu'\n" - linkTag = "\n\\[la]" - linkCloseTag = "\\[ra]" - codespanTag = "\\fB" - codespanCloseTag = "\\fR" - codeTag = "\n.EX\n" - codeCloseTag = "\n.EE\n" - quoteTag = "\n.PP\n.RS\n" - quoteCloseTag = "\n.RE\n" - listTag = "\n.RS\n" - listCloseTag = "\n.RE\n" - dtTag = "\n.TP\n" - dd2Tag = "\n" - tableStart = "\n.TS\nallbox;\n" - tableEnd = ".TE\n" - tableCellStart = "T{\n" - tableCellEnd = "\nT}\n" -) - -// NewRoffRenderer creates a new blackfriday Renderer for generating roff documents -// from markdown -func NewRoffRenderer() *roffRenderer { // nolint: golint - var extensions blackfriday.Extensions - - extensions |= blackfriday.NoIntraEmphasis - extensions |= blackfriday.Tables - extensions |= blackfriday.FencedCode - extensions |= blackfriday.SpaceHeadings - extensions |= blackfriday.Footnotes - extensions |= blackfriday.Titleblock - extensions |= blackfriday.DefinitionLists - return &roffRenderer{ - extensions: extensions, - } -} - -// GetExtensions returns the list of extensions used by this renderer implementation -func (r *roffRenderer) GetExtensions() blackfriday.Extensions { - return r.extensions -} - -// RenderHeader handles outputting the header at document start -func (r *roffRenderer) RenderHeader(w io.Writer, ast *blackfriday.Node) { - // disable hyphenation - out(w, ".nh\n") -} - -// RenderFooter handles outputting the footer at the document end; the roff -// renderer has no footer information -func (r *roffRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) { -} - -// RenderNode is called for each node in a markdown document; based on the node -// type the equivalent roff output is sent to the writer -func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus { - walkAction := blackfriday.GoToNext - - switch node.Type { - case blackfriday.Text: - escapeSpecialChars(w, node.Literal) - case blackfriday.Softbreak: - out(w, crTag) - case blackfriday.Hardbreak: - out(w, breakTag) - case blackfriday.Emph: - if entering { - out(w, emphTag) - } else { - out(w, emphCloseTag) - } - case blackfriday.Strong: - if entering { - out(w, strongTag) - } else { - out(w, strongCloseTag) - } - case blackfriday.Link: - // Don't render the link text for automatic links, because this - // will only duplicate the URL in the roff output. - // See https://daringfireball.net/projects/markdown/syntax#autolink - if !bytes.Equal(node.LinkData.Destination, node.FirstChild.Literal) { - out(w, string(node.FirstChild.Literal)) - } - // Hyphens in a link must be escaped to avoid word-wrap in the rendered man page. - escapedLink := strings.ReplaceAll(string(node.LinkData.Destination), "-", "\\-") - out(w, linkTag+escapedLink+linkCloseTag) - walkAction = blackfriday.SkipChildren - case blackfriday.Image: - // ignore images - walkAction = blackfriday.SkipChildren - case blackfriday.Code: - out(w, codespanTag) - escapeSpecialChars(w, node.Literal) - out(w, codespanCloseTag) - case blackfriday.Document: - break - case blackfriday.Paragraph: - // roff .PP markers break lists - if r.listDepth > 0 { - return blackfriday.GoToNext - } - if entering { - out(w, paraTag) - } else { - out(w, crTag) - } - case blackfriday.BlockQuote: - if entering { - out(w, quoteTag) - } else { - out(w, quoteCloseTag) - } - case blackfriday.Heading: - r.handleHeading(w, node, entering) - case blackfriday.HorizontalRule: - out(w, hruleTag) - case blackfriday.List: - r.handleList(w, node, entering) - case blackfriday.Item: - r.handleItem(w, node, entering) - case blackfriday.CodeBlock: - out(w, codeTag) - escapeSpecialChars(w, node.Literal) - out(w, codeCloseTag) - case blackfriday.Table: - r.handleTable(w, node, entering) - case blackfriday.TableHead: - case blackfriday.TableBody: - case blackfriday.TableRow: - // no action as cell entries do all the nroff formatting - return blackfriday.GoToNext - case blackfriday.TableCell: - r.handleTableCell(w, node, entering) - case blackfriday.HTMLSpan: - // ignore other HTML tags - case blackfriday.HTMLBlock: - if bytes.HasPrefix(node.Literal, []byte("