From a98cace2fdd8ee2e7bd930c0b9397bb3a38736c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Suszy=C5=84ski?= Date: Thu, 3 Nov 2022 14:19:04 +0100 Subject: [PATCH] Change the extract dir to be constant --- pkg/inflator/cli/app_test.go | 5 +++-- pkg/inflator/cli/flags.go | 20 ++++++++++++++++++- pkg/inflator/extract/extract.go | 16 ++++++--------- pkg/inflator/extract/extract_test.go | 12 +++++------ .../gogo/protobuf/proto/pointer_reflect.go | 1 - .../protobuf/proto/pointer_reflect_gogo.go | 1 - .../gogo/protobuf/proto/pointer_unsafe.go | 1 - .../protobuf/proto/pointer_unsafe_gogo.go | 1 - .../inconshreveable/mousetrap/trap_others.go | 1 - .../inconshreveable/mousetrap/trap_windows.go | 4 ++-- .../mousetrap/trap_windows_1.4.go | 4 ++-- .../vendor/github.com/json-iterator/go/any.go | 3 +-- .../json-iterator/go/iter_skip_sloppy.go | 3 +-- .../json-iterator/go/iter_skip_strict.go | 3 +-- .../json-iterator/go/reflect_array.go | 3 +-- .../json-iterator/go/reflect_dynamic.go | 3 +-- .../json-iterator/go/reflect_extension.go | 3 +-- .../json-iterator/go/reflect_json_number.go | 3 +-- .../go/reflect_json_raw_message.go | 3 +-- .../json-iterator/go/reflect_map.go | 3 +-- .../json-iterator/go/reflect_optional.go | 3 +-- .../json-iterator/go/reflect_slice.go | 3 +-- .../go/reflect_struct_encoder.go | 3 +-- .../modern-go/concurrent/go_above_19.go | 3 +-- .../modern-go/concurrent/go_below_19.go | 3 +-- .../github.com/modern-go/concurrent/log.go | 6 +++--- .../concurrent/unbounded_executor.go | 2 +- .../modern-go/reflect2/go_above_17.go | 3 +-- .../modern-go/reflect2/go_above_19.go | 3 +-- .../modern-go/reflect2/go_below_17.go | 3 +-- .../modern-go/reflect2/go_below_19.go | 3 +-- .../github.com/modern-go/reflect2/reflect2.go | 9 ++++----- .../github.com/spf13/cobra/command_notwin.go | 1 - .../github.com/spf13/cobra/command_win.go | 1 - schema/vendor/golang.org/x/net/http2/go111.go | 1 - .../golang.org/x/net/http2/not_go111.go | 1 - .../golang.org/x/net/idna/idna10.0.0.go | 1 - .../vendor/golang.org/x/net/idna/idna9.0.0.go | 1 - .../golang.org/x/net/idna/tables10.0.0.go | 1 - .../golang.org/x/net/idna/tables11.0.0.go | 1 - .../golang.org/x/net/idna/tables12.0.0.go | 1 - .../golang.org/x/net/idna/tables13.0.0.go | 1 - .../golang.org/x/net/idna/tables9.0.0.go | 1 - .../x/text/secure/bidirule/bidirule10.0.0.go | 1 - .../x/text/secure/bidirule/bidirule9.0.0.go | 1 - .../x/text/unicode/bidi/tables10.0.0.go | 1 - .../x/text/unicode/bidi/tables11.0.0.go | 1 - .../x/text/unicode/bidi/tables12.0.0.go | 1 - .../x/text/unicode/bidi/tables9.0.0.go | 1 - .../x/text/unicode/norm/tables10.0.0.go | 1 - .../x/text/unicode/norm/tables11.0.0.go | 1 - .../x/text/unicode/norm/tables12.0.0.go | 1 - .../x/text/unicode/norm/tables9.0.0.go | 1 - schema/vendor/gopkg.in/yaml.v2/readerc.go | 2 +- schema/vendor/gopkg.in/yaml.v2/resolve.go | 2 +- schema/vendor/gopkg.in/yaml.v2/sorter.go | 2 +- schema/vendor/gopkg.in/yaml.v3/apic.go | 8 ++++---- schema/vendor/gopkg.in/yaml.v3/emitterc.go | 2 +- schema/vendor/gopkg.in/yaml.v3/readerc.go | 8 ++++---- schema/vendor/gopkg.in/yaml.v3/scannerc.go | 8 ++++---- schema/vendor/gopkg.in/yaml.v3/writerc.go | 8 ++++---- schema/vendor/gopkg.in/yaml.v3/yaml.go | 5 +++-- schema/vendor/gopkg.in/yaml.v3/yamlh.go | 1 + .../vendor/gopkg.in/yaml.v3/yamlprivateh.go | 20 +++++++++---------- .../pkg/api/resource/zz_generated.deepcopy.go | 1 - .../pkg/apis/meta/v1/micro_time.go | 2 +- .../apis/meta/v1/zz_generated.conversion.go | 1 - .../pkg/apis/meta/v1/zz_generated.deepcopy.go | 1 - .../pkg/apis/meta/v1/zz_generated.defaults.go | 1 - .../pkg/labels/zz_generated.deepcopy.go | 1 - .../pkg/runtime/zz_generated.deepcopy.go | 1 - .../apimachinery/pkg/util/intstr/intstr.go | 2 +- .../pkg/watch/zz_generated.deepcopy.go | 1 - test/e2e-kind.sh | 5 ++++- test/e2e-tests.sh | 5 ++++- test/hack/update-deps.sh | 5 ++++- test/presubmit-tests.sh | 5 ++++- test/unit/scripts/fake-prow-job.bash | 1 + test/unit/scripts/source-e2e-tests.bash | 7 ++++++- test/unit/scripts/source-library.bash | 7 ++++++- test/unit/scripts/source-presubmit-tests.bash | 7 ++++++- test/unit/scripts/source-release.bash | 7 ++++++- test/unit/sharedlib_test.go | 1 + .../github.com/davecgh/go-spew/spew/bypass.go | 1 - .../davecgh/go-spew/spew/bypasssafe.go | 1 - .../pmezard/go-difflib/difflib/difflib.go | 8 ++++---- .../stretchr/testify/require/require.go | 3 +-- .../testify/require/require_forward.go | 3 +-- test/vendor/gopkg.in/yaml.v3/apic.go | 8 ++++---- test/vendor/gopkg.in/yaml.v3/emitterc.go | 2 +- test/vendor/gopkg.in/yaml.v3/readerc.go | 8 ++++---- test/vendor/gopkg.in/yaml.v3/scannerc.go | 8 ++++---- test/vendor/gopkg.in/yaml.v3/writerc.go | 8 ++++---- test/vendor/gopkg.in/yaml.v3/yaml.go | 5 +++-- test/vendor/gopkg.in/yaml.v3/yamlh.go | 1 + test/vendor/gopkg.in/yaml.v3/yamlprivateh.go | 20 +++++++++---------- 96 files changed, 179 insertions(+), 182 deletions(-) diff --git a/pkg/inflator/cli/app_test.go b/pkg/inflator/cli/app_test.go index 56405966..62686246 100644 --- a/pkg/inflator/cli/app_test.go +++ b/pkg/inflator/cli/app_test.go @@ -12,7 +12,8 @@ import ( func TestApp(t *testing.T) { tmpdir := t.TempDir() - t.Setenv(extract.ArtifactsEnvVar, tmpdir) + t.Setenv(extract.HackScriptsDirEnvVar, tmpdir) + t.Setenv(cli.ManualVerboseEnvVar, "true") c := cli.App{}.Command() var ( outb bytes.Buffer @@ -24,6 +25,6 @@ func TestApp(t *testing.T) { err := c.Execute() require.NoError(t, err) - assert.Equal(t, outb.String(), tmpdir+"/hack-scripts/e2e-tests.sh\n") + assert.Equal(t, outb.String(), tmpdir+"/e2e-tests.sh\n") assert.Equal(t, errb.String(), "") } diff --git a/pkg/inflator/cli/flags.go b/pkg/inflator/cli/flags.go index ee5e6d4d..ce49e7e9 100644 --- a/pkg/inflator/cli/flags.go +++ b/pkg/inflator/cli/flags.go @@ -1,15 +1,33 @@ package cli import ( + "os" + "strings" + "github.com/spf13/cobra" ) +const ( + // ManualVerboseEnvVar is the environment variable that can be set to disable + // automatic verbose mode on CI servers. + ManualVerboseEnvVar = "KNATIVE_HACK_SCRIPT_MANUAL_VERBOSE" +) + type flags struct { verbose bool } func (f *flags) withFlags(c *cobra.Command) *cobra.Command { fl := c.PersistentFlags() - fl.BoolVarP(&f.verbose, "verbose", "v", false, "Print verbose output on Stderr") + fl.BoolVarP(&f.verbose, "verbose", "v", isCiServer(), "Print verbose output on Stderr") return c } + +func isCiServer() bool { + if strings.HasPrefix(strings.ToLower(os.Getenv(ManualVerboseEnvVar)), "t") { + return false + } + return os.Getenv("CI") != "" || + os.Getenv("BUILD_ID") != "" || + os.Getenv("PROW_JOB_ID") != "" +} diff --git a/pkg/inflator/extract/extract.go b/pkg/inflator/extract/extract.go index b9a07f89..2275c165 100644 --- a/pkg/inflator/extract/extract.go +++ b/pkg/inflator/extract/extract.go @@ -11,9 +11,9 @@ import ( ) const ( - // ArtifactsEnvVar is the name of the environment variable that points - // to ARTIFACTS directory. - ArtifactsEnvVar = "ARTIFACTS" + // HackScriptsDirEnvVar is the name of the environment variable that points + // to directory where knative-hack scripts will be extracted. + HackScriptsDirEnvVar = "KNATIVE_HACK_SCRIPTS_DIR" // PermOwnerWrite is the permission bits for owner write. PermOwnerWrite = 0o200 // PermAllExecutable is the permission bits for executable. @@ -42,14 +42,10 @@ type Operation struct { // provide the file path to it. func (o Operation) Extract(prtr Printer) error { l := logger{o.Verbose, prtr} - artifactsDir := os.Getenv(ArtifactsEnvVar) - if artifactsDir == "" { - var err error - if artifactsDir, err = os.MkdirTemp("", "knative.*"); err != nil { - return wrapErr(err, ErrBug) - } + hackRootDir := os.Getenv(HackScriptsDirEnvVar) + if hackRootDir == "" { + hackRootDir = path.Join(os.TempDir(), "knative", "hack", "scripts") } - hackRootDir := path.Join(artifactsDir, "hack-scripts") l.debugf("Extracting hack scripts to directory: %s", hackRootDir) if err := copyDir(l, hack.Scripts, hackRootDir, "."); err != nil { return err diff --git a/pkg/inflator/extract/extract_test.go b/pkg/inflator/extract/extract_test.go index dbf44886..522655b6 100644 --- a/pkg/inflator/extract/extract_test.go +++ b/pkg/inflator/extract/extract_test.go @@ -13,7 +13,7 @@ import ( func TestExtract(t *testing.T) { tmpdir := t.TempDir() - t.Setenv(extract.ArtifactsEnvVar, tmpdir) + t.Setenv(extract.HackScriptsDirEnvVar, tmpdir) op := extract.Operation{ ScriptName: "library.sh", Verbose: true, @@ -21,9 +21,9 @@ func TestExtract(t *testing.T) { prtr := &testPrinter{} err := op.Extract(prtr) require.NoError(t, err) - assert.Equal(t, prtr.out.String(), tmpdir+"/hack-scripts/library.sh\n") + assert.Equal(t, prtr.out.String(), tmpdir+"/library.sh\n") assert.Equal(t, - `[hack] Extracting hack scripts to directory: /tmp/x/hack-scripts + `[hack] Extracting hack scripts to directory: /tmp/x [hack] codegen-library.sh 1 KiB + [hack] e2e-tests.sh 6 KiB ++ [hack] infra-library.sh 5 KiB + @@ -31,7 +31,7 @@ func TestExtract(t *testing.T) { [hack] microbenchmarks.sh 2 KiB + [hack] performance-tests.sh 6 KiB ++ [hack] presubmit-tests.sh 12 KiB +++ -[hack] release.sh 26 KiB ++++++ +[hack] release.sh 27 KiB ++++++ [hack] shellcheck-presubmit.sh 1 KiB + `, strings.ReplaceAll(prtr.err.String(), tmpdir, "/tmp/x")) @@ -39,9 +39,9 @@ func TestExtract(t *testing.T) { prtr = &testPrinter{} err = op.Extract(prtr) require.NoError(t, err) - assert.Equal(t, prtr.out.String(), tmpdir+"/hack-scripts/library.sh\n") + assert.Equal(t, prtr.out.String(), tmpdir+"/library.sh\n") assert.Equal(t, - `[hack] Extracting hack scripts to directory: /tmp/x/hack-scripts + `[hack] Extracting hack scripts to directory: /tmp/x [hack] codegen-library.sh up-to-date [hack] e2e-tests.sh up-to-date [hack] infra-library.sh up-to-date diff --git a/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go b/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go index 461d5821..b6cad908 100644 --- a/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go +++ b/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go @@ -29,7 +29,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//go:build purego || appengine || js // +build purego appengine js // This file contains an implementation of proto field accesses using package reflect. diff --git a/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go b/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go index d6e07e2f..7ffd3c29 100644 --- a/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go +++ b/schema/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go @@ -26,7 +26,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//go:build purego || appengine || js // +build purego appengine js // This file contains an implementation of proto field accesses using package reflect. diff --git a/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go b/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go index c998399b..d55a335d 100644 --- a/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go +++ b/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go @@ -29,7 +29,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//go:build !purego && !appengine && !js // +build !purego,!appengine,!js // This file contains the implementation of the proto field accesses using package unsafe. diff --git a/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go b/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go index 57a14965..aca8eed0 100644 --- a/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go +++ b/schema/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go @@ -26,7 +26,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//go:build !purego && !appengine && !js // +build !purego,!appengine,!js // This file contains the implementation of the proto field accesses using package unsafe. diff --git a/schema/vendor/github.com/inconshreveable/mousetrap/trap_others.go b/schema/vendor/github.com/inconshreveable/mousetrap/trap_others.go index 06a91f08..9d2d8a4b 100644 --- a/schema/vendor/github.com/inconshreveable/mousetrap/trap_others.go +++ b/schema/vendor/github.com/inconshreveable/mousetrap/trap_others.go @@ -1,4 +1,3 @@ -//go:build !windows // +build !windows package mousetrap diff --git a/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows.go b/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows.go index 2d2adac9..336142a5 100644 --- a/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows.go +++ b/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows.go @@ -1,5 +1,5 @@ -//go:build windows && !go1.4 -// +build windows,!go1.4 +// +build windows +// +build !go1.4 package mousetrap diff --git a/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go b/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go index c78a98fd..9a28e57c 100644 --- a/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go +++ b/schema/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go @@ -1,5 +1,5 @@ -//go:build windows && go1.4 -// +build windows,go1.4 +// +build windows +// +build go1.4 package mousetrap diff --git a/schema/vendor/github.com/json-iterator/go/any.go b/schema/vendor/github.com/json-iterator/go/any.go index 4b7e1cf5..f6b8aeab 100644 --- a/schema/vendor/github.com/json-iterator/go/any.go +++ b/schema/vendor/github.com/json-iterator/go/any.go @@ -3,12 +3,11 @@ package jsoniter import ( "errors" "fmt" + "github.com/modern-go/reflect2" "io" "reflect" "strconv" "unsafe" - - "github.com/modern-go/reflect2" ) // Any generic object representation. diff --git a/schema/vendor/github.com/json-iterator/go/iter_skip_sloppy.go b/schema/vendor/github.com/json-iterator/go/iter_skip_sloppy.go index 3d993f27..9303de41 100644 --- a/schema/vendor/github.com/json-iterator/go/iter_skip_sloppy.go +++ b/schema/vendor/github.com/json-iterator/go/iter_skip_sloppy.go @@ -1,5 +1,4 @@ -//go:build jsoniter_sloppy -// +build jsoniter_sloppy +//+build jsoniter_sloppy package jsoniter diff --git a/schema/vendor/github.com/json-iterator/go/iter_skip_strict.go b/schema/vendor/github.com/json-iterator/go/iter_skip_strict.go index f1ad6591..6cf66d04 100644 --- a/schema/vendor/github.com/json-iterator/go/iter_skip_strict.go +++ b/schema/vendor/github.com/json-iterator/go/iter_skip_strict.go @@ -1,5 +1,4 @@ -//go:build !jsoniter_sloppy -// +build !jsoniter_sloppy +//+build !jsoniter_sloppy package jsoniter diff --git a/schema/vendor/github.com/json-iterator/go/reflect_array.go b/schema/vendor/github.com/json-iterator/go/reflect_array.go index 7eb5b1dc..13a0b7b0 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_array.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_array.go @@ -2,10 +2,9 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "unsafe" - - "github.com/modern-go/reflect2" ) func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/schema/vendor/github.com/json-iterator/go/reflect_dynamic.go b/schema/vendor/github.com/json-iterator/go/reflect_dynamic.go index 71a0fe27..8b6bc8b4 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_dynamic.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_dynamic.go @@ -1,10 +1,9 @@ package jsoniter import ( + "github.com/modern-go/reflect2" "reflect" "unsafe" - - "github.com/modern-go/reflect2" ) type dynamicEncoder struct { diff --git a/schema/vendor/github.com/json-iterator/go/reflect_extension.go b/schema/vendor/github.com/json-iterator/go/reflect_extension.go index a820f10c..74a97bfe 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_extension.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_extension.go @@ -2,13 +2,12 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "reflect" "sort" "strings" "unicode" "unsafe" - - "github.com/modern-go/reflect2" ) var typeDecoders = map[string]ValDecoder{} diff --git a/schema/vendor/github.com/json-iterator/go/reflect_json_number.go b/schema/vendor/github.com/json-iterator/go/reflect_json_number.go index 52e11bf3..98d45c1e 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_json_number.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_json_number.go @@ -2,10 +2,9 @@ package jsoniter import ( "encoding/json" + "github.com/modern-go/reflect2" "strconv" "unsafe" - - "github.com/modern-go/reflect2" ) type Number string diff --git a/schema/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/schema/vendor/github.com/json-iterator/go/reflect_json_raw_message.go index 70670a8f..f2619936 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_json_raw_message.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_json_raw_message.go @@ -2,9 +2,8 @@ package jsoniter import ( "encoding/json" - "unsafe" - "github.com/modern-go/reflect2" + "unsafe" ) var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem() diff --git a/schema/vendor/github.com/json-iterator/go/reflect_map.go b/schema/vendor/github.com/json-iterator/go/reflect_map.go index 696194bd..58296713 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_map.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_map.go @@ -2,12 +2,11 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "reflect" "sort" "unsafe" - - "github.com/modern-go/reflect2" ) func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/schema/vendor/github.com/json-iterator/go/reflect_optional.go b/schema/vendor/github.com/json-iterator/go/reflect_optional.go index 112c110a..fa71f474 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_optional.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_optional.go @@ -1,9 +1,8 @@ package jsoniter import ( - "unsafe" - "github.com/modern-go/reflect2" + "unsafe" ) func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/schema/vendor/github.com/json-iterator/go/reflect_slice.go b/schema/vendor/github.com/json-iterator/go/reflect_slice.go index f363a716..9441d79d 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_slice.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_slice.go @@ -2,10 +2,9 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "unsafe" - - "github.com/modern-go/reflect2" ) func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder { diff --git a/schema/vendor/github.com/json-iterator/go/reflect_struct_encoder.go b/schema/vendor/github.com/json-iterator/go/reflect_struct_encoder.go index edf77bf5..152e3ef5 100644 --- a/schema/vendor/github.com/json-iterator/go/reflect_struct_encoder.go +++ b/schema/vendor/github.com/json-iterator/go/reflect_struct_encoder.go @@ -2,11 +2,10 @@ package jsoniter import ( "fmt" + "github.com/modern-go/reflect2" "io" "reflect" "unsafe" - - "github.com/modern-go/reflect2" ) func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder { diff --git a/schema/vendor/github.com/modern-go/concurrent/go_above_19.go b/schema/vendor/github.com/modern-go/concurrent/go_above_19.go index 7db70194..aeabf8c4 100644 --- a/schema/vendor/github.com/modern-go/concurrent/go_above_19.go +++ b/schema/vendor/github.com/modern-go/concurrent/go_above_19.go @@ -1,5 +1,4 @@ -//go:build go1.9 -// +build go1.9 +//+build go1.9 package concurrent diff --git a/schema/vendor/github.com/modern-go/concurrent/go_below_19.go b/schema/vendor/github.com/modern-go/concurrent/go_below_19.go index 64544f5b..b9c8df7f 100644 --- a/schema/vendor/github.com/modern-go/concurrent/go_below_19.go +++ b/schema/vendor/github.com/modern-go/concurrent/go_below_19.go @@ -1,5 +1,4 @@ -//go:build !go1.9 -// +build !go1.9 +//+build !go1.9 package concurrent diff --git a/schema/vendor/github.com/modern-go/concurrent/log.go b/schema/vendor/github.com/modern-go/concurrent/log.go index 4899eed0..9756fcc7 100644 --- a/schema/vendor/github.com/modern-go/concurrent/log.go +++ b/schema/vendor/github.com/modern-go/concurrent/log.go @@ -1,13 +1,13 @@ package concurrent import ( - "io/ioutil" - "log" "os" + "log" + "io/ioutil" ) // ErrorLogger is used to print out error, can be set to writer other than stderr var ErrorLogger = log.New(os.Stderr, "", 0) // InfoLogger is used to print informational message, default to off -var InfoLogger = log.New(ioutil.Discard, "", 0) +var InfoLogger = log.New(ioutil.Discard, "", 0) \ No newline at end of file diff --git a/schema/vendor/github.com/modern-go/concurrent/unbounded_executor.go b/schema/vendor/github.com/modern-go/concurrent/unbounded_executor.go index 5ea18eb7..05a77dce 100644 --- a/schema/vendor/github.com/modern-go/concurrent/unbounded_executor.go +++ b/schema/vendor/github.com/modern-go/concurrent/unbounded_executor.go @@ -3,11 +3,11 @@ package concurrent import ( "context" "fmt" - "reflect" "runtime" "runtime/debug" "sync" "time" + "reflect" ) // HandlePanic logs goroutine panic by default diff --git a/schema/vendor/github.com/modern-go/reflect2/go_above_17.go b/schema/vendor/github.com/modern-go/reflect2/go_above_17.go index 2089f126..5c1cea86 100644 --- a/schema/vendor/github.com/modern-go/reflect2/go_above_17.go +++ b/schema/vendor/github.com/modern-go/reflect2/go_above_17.go @@ -1,5 +1,4 @@ -//go:build go1.7 -// +build go1.7 +//+build go1.7 package reflect2 diff --git a/schema/vendor/github.com/modern-go/reflect2/go_above_19.go b/schema/vendor/github.com/modern-go/reflect2/go_above_19.go index 3d65173b..c7e3b780 100644 --- a/schema/vendor/github.com/modern-go/reflect2/go_above_19.go +++ b/schema/vendor/github.com/modern-go/reflect2/go_above_19.go @@ -1,5 +1,4 @@ -//go:build go1.9 -// +build go1.9 +//+build go1.9 package reflect2 diff --git a/schema/vendor/github.com/modern-go/reflect2/go_below_17.go b/schema/vendor/github.com/modern-go/reflect2/go_below_17.go index c3f98f90..65a93c88 100644 --- a/schema/vendor/github.com/modern-go/reflect2/go_below_17.go +++ b/schema/vendor/github.com/modern-go/reflect2/go_below_17.go @@ -1,5 +1,4 @@ -//go:build !go1.7 -// +build !go1.7 +//+build !go1.7 package reflect2 diff --git a/schema/vendor/github.com/modern-go/reflect2/go_below_19.go b/schema/vendor/github.com/modern-go/reflect2/go_below_19.go index 65966f59..b050ef70 100644 --- a/schema/vendor/github.com/modern-go/reflect2/go_below_19.go +++ b/schema/vendor/github.com/modern-go/reflect2/go_below_19.go @@ -1,5 +1,4 @@ -//go:build !go1.9 -// +build !go1.9 +//+build !go1.9 package reflect2 diff --git a/schema/vendor/github.com/modern-go/reflect2/reflect2.go b/schema/vendor/github.com/modern-go/reflect2/reflect2.go index 773932f6..63b49c79 100644 --- a/schema/vendor/github.com/modern-go/reflect2/reflect2.go +++ b/schema/vendor/github.com/modern-go/reflect2/reflect2.go @@ -1,10 +1,9 @@ package reflect2 import ( + "github.com/modern-go/concurrent" "reflect" "unsafe" - - "github.com/modern-go/concurrent" ) type Type interface { @@ -137,7 +136,7 @@ type frozenConfig struct { func (cfg Config) Froze() *frozenConfig { return &frozenConfig{ useSafeImplementation: cfg.UseSafeImplementation, - cache: concurrent.NewMap(), + cache: concurrent.NewMap(), } } @@ -292,8 +291,8 @@ func UnsafeCastString(str string) []byte { stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str)) sliceHeader := &reflect.SliceHeader{ Data: stringHeader.Data, - Cap: stringHeader.Len, - Len: stringHeader.Len, + Cap: stringHeader.Len, + Len: stringHeader.Len, } return *(*[]byte)(unsafe.Pointer(sliceHeader)) } diff --git a/schema/vendor/github.com/spf13/cobra/command_notwin.go b/schema/vendor/github.com/spf13/cobra/command_notwin.go index bb5dad90..6159c1cc 100644 --- a/schema/vendor/github.com/spf13/cobra/command_notwin.go +++ b/schema/vendor/github.com/spf13/cobra/command_notwin.go @@ -1,4 +1,3 @@ -//go:build !windows // +build !windows package cobra diff --git a/schema/vendor/github.com/spf13/cobra/command_win.go b/schema/vendor/github.com/spf13/cobra/command_win.go index a84f5a82..8768b173 100644 --- a/schema/vendor/github.com/spf13/cobra/command_win.go +++ b/schema/vendor/github.com/spf13/cobra/command_win.go @@ -1,4 +1,3 @@ -//go:build windows // +build windows package cobra diff --git a/schema/vendor/golang.org/x/net/http2/go111.go b/schema/vendor/golang.org/x/net/http2/go111.go index 5bf62b03..3a131016 100644 --- a/schema/vendor/golang.org/x/net/http2/go111.go +++ b/schema/vendor/golang.org/x/net/http2/go111.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.11 // +build go1.11 package http2 diff --git a/schema/vendor/golang.org/x/net/http2/not_go111.go b/schema/vendor/golang.org/x/net/http2/not_go111.go index cc0baa81..161bca7c 100644 --- a/schema/vendor/golang.org/x/net/http2/not_go111.go +++ b/schema/vendor/golang.org/x/net/http2/not_go111.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.11 // +build !go1.11 package http2 diff --git a/schema/vendor/golang.org/x/net/idna/idna10.0.0.go b/schema/vendor/golang.org/x/net/idna/idna10.0.0.go index 7e69ee1b..a98a31f4 100644 --- a/schema/vendor/golang.org/x/net/idna/idna10.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/idna10.0.0.go @@ -4,7 +4,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.10 // +build go1.10 // Package idna implements IDNA2008 using the compatibility processing diff --git a/schema/vendor/golang.org/x/net/idna/idna9.0.0.go b/schema/vendor/golang.org/x/net/idna/idna9.0.0.go index 7c745637..8842146b 100644 --- a/schema/vendor/golang.org/x/net/idna/idna9.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/idna9.0.0.go @@ -4,7 +4,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.10 // +build !go1.10 // Package idna implements IDNA2008 using the compatibility processing diff --git a/schema/vendor/golang.org/x/net/idna/tables10.0.0.go b/schema/vendor/golang.org/x/net/idna/tables10.0.0.go index d1d62ef4..54fddb4b 100644 --- a/schema/vendor/golang.org/x/net/idna/tables10.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/tables10.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package idna diff --git a/schema/vendor/golang.org/x/net/idna/tables11.0.0.go b/schema/vendor/golang.org/x/net/idna/tables11.0.0.go index 167efba7..8ce0811f 100644 --- a/schema/vendor/golang.org/x/net/idna/tables11.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/tables11.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package idna diff --git a/schema/vendor/golang.org/x/net/idna/tables12.0.0.go b/schema/vendor/golang.org/x/net/idna/tables12.0.0.go index ab40f7bc..f39f0cb4 100644 --- a/schema/vendor/golang.org/x/net/idna/tables12.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/tables12.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.14 && !go1.16 // +build go1.14,!go1.16 package idna diff --git a/schema/vendor/golang.org/x/net/idna/tables13.0.0.go b/schema/vendor/golang.org/x/net/idna/tables13.0.0.go index 390c5e56..e8c7a36d 100644 --- a/schema/vendor/golang.org/x/net/idna/tables13.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/tables13.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.16 // +build go1.16 package idna diff --git a/schema/vendor/golang.org/x/net/idna/tables9.0.0.go b/schema/vendor/golang.org/x/net/idna/tables9.0.0.go index 4074b533..8b65fa16 100644 --- a/schema/vendor/golang.org/x/net/idna/tables9.0.0.go +++ b/schema/vendor/golang.org/x/net/idna/tables9.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build !go1.10 // +build !go1.10 package idna diff --git a/schema/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go b/schema/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go index 8a7392c4..e4c62289 100644 --- a/schema/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +++ b/schema/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.10 // +build go1.10 package bidirule diff --git a/schema/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go b/schema/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go index bb0a9200..02b9e1e9 100644 --- a/schema/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +++ b/schema/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.10 // +build !go1.10 package bidirule diff --git a/schema/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go b/schema/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go index 42fa8d72..d8c94e1b 100644 --- a/schema/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package bidi diff --git a/schema/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go b/schema/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go index 56a0e1ea..16b11db5 100644 --- a/schema/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package bidi diff --git a/schema/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go b/schema/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go index 7501c975..7ffa3651 100644 --- a/schema/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.14 // +build go1.14 package bidi diff --git a/schema/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go b/schema/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go index f517fdb2..0ca0193e 100644 --- a/schema/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build !go1.10 // +build !go1.10 package bidi diff --git a/schema/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go b/schema/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go index f5a07882..26fbd55a 100644 --- a/schema/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package norm diff --git a/schema/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go b/schema/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go index cb7239c4..2c58f09b 100644 --- a/schema/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package norm diff --git a/schema/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go b/schema/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go index 23eb8c70..10f5202c 100644 --- a/schema/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.14 // +build go1.14 package norm diff --git a/schema/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/schema/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go index 0175eae5..94290692 100644 --- a/schema/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +++ b/schema/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build !go1.10 // +build !go1.10 package norm diff --git a/schema/vendor/gopkg.in/yaml.v2/readerc.go b/schema/vendor/gopkg.in/yaml.v2/readerc.go index b0c436c4..7c1f5fac 100644 --- a/schema/vendor/gopkg.in/yaml.v2/readerc.go +++ b/schema/vendor/gopkg.in/yaml.v2/readerc.go @@ -95,7 +95,7 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { // [Go] This function was changed to guarantee the requested length size at EOF. // The fact we need to do this is pretty awful, but the description above implies - // for that to be the case, and there are tests + // for that to be the case, and there are tests // If the EOF flag is set and the raw buffer is empty, do nothing. if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { diff --git a/schema/vendor/gopkg.in/yaml.v2/resolve.go b/schema/vendor/gopkg.in/yaml.v2/resolve.go index e29c364b..4120e0c9 100644 --- a/schema/vendor/gopkg.in/yaml.v2/resolve.go +++ b/schema/vendor/gopkg.in/yaml.v2/resolve.go @@ -180,7 +180,7 @@ func resolve(tag string, in string) (rtag string, out interface{}) { return yaml_INT_TAG, uintv } } else if strings.HasPrefix(plain, "-0b") { - intv, err := strconv.ParseInt("-"+plain[3:], 2, 64) + intv, err := strconv.ParseInt("-" + plain[3:], 2, 64) if err == nil { if true || intv == int64(int(intv)) { return yaml_INT_TAG, int(intv) diff --git a/schema/vendor/gopkg.in/yaml.v2/sorter.go b/schema/vendor/gopkg.in/yaml.v2/sorter.go index 2edd7340..4c45e660 100644 --- a/schema/vendor/gopkg.in/yaml.v2/sorter.go +++ b/schema/vendor/gopkg.in/yaml.v2/sorter.go @@ -52,7 +52,7 @@ func (l keyList) Less(i, j int) bool { var ai, bi int var an, bn int64 if ar[i] == '0' || br[i] == '0' { - for j := i - 1; j >= 0 && unicode.IsDigit(ar[j]); j-- { + for j := i-1; j >= 0 && unicode.IsDigit(ar[j]); j-- { if ar[j] != '0' { an = 1 bn = 1 diff --git a/schema/vendor/gopkg.in/yaml.v3/apic.go b/schema/vendor/gopkg.in/yaml.v3/apic.go index 05fd305d..ae7d049f 100644 --- a/schema/vendor/gopkg.in/yaml.v3/apic.go +++ b/schema/vendor/gopkg.in/yaml.v3/apic.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 diff --git a/schema/vendor/gopkg.in/yaml.v3/emitterc.go b/schema/vendor/gopkg.in/yaml.v3/emitterc.go index f6e50b5b..0f47c9ca 100644 --- a/schema/vendor/gopkg.in/yaml.v3/emitterc.go +++ b/schema/vendor/gopkg.in/yaml.v3/emitterc.go @@ -241,7 +241,7 @@ func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool emitter.indent += 2 } else { // Everything else aligns to the chosen indentation. - emitter.indent = emitter.best_indent * ((emitter.indent + emitter.best_indent) / emitter.best_indent) + emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) } } return true diff --git a/schema/vendor/gopkg.in/yaml.v3/readerc.go b/schema/vendor/gopkg.in/yaml.v3/readerc.go index 56af2453..b7de0a89 100644 --- a/schema/vendor/gopkg.in/yaml.v3/readerc.go +++ b/schema/vendor/gopkg.in/yaml.v3/readerc.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 diff --git a/schema/vendor/gopkg.in/yaml.v3/scannerc.go b/schema/vendor/gopkg.in/yaml.v3/scannerc.go index 037fcd53..ca007010 100644 --- a/schema/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/schema/vendor/gopkg.in/yaml.v3/scannerc.go @@ -2847,7 +2847,7 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t continue } if parser.buffer[parser.buffer_pos+peek] == '#' { - seen := parser.mark.index + peek + seen := parser.mark.index+peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false @@ -2876,7 +2876,7 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t parser.comments = append(parser.comments, yaml_comment_t{ token_mark: token_mark, start_mark: start_mark, - line: text, + line: text, }) } return true @@ -2910,7 +2910,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo // the foot is the line below it. var foot_line = -1 if scan_mark.line > 0 { - foot_line = parser.mark.line - parser.newlines + 1 + foot_line = parser.mark.line-parser.newlines+1 if parser.newlines == 0 && parser.mark.column > 1 { foot_line++ } @@ -2996,7 +2996,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo recent_empty = false // Consume until after the consumed comment line. - seen := parser.mark.index + peek + seen := parser.mark.index+peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false diff --git a/schema/vendor/gopkg.in/yaml.v3/writerc.go b/schema/vendor/gopkg.in/yaml.v3/writerc.go index 266d0b09..b8a116bf 100644 --- a/schema/vendor/gopkg.in/yaml.v3/writerc.go +++ b/schema/vendor/gopkg.in/yaml.v3/writerc.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 diff --git a/schema/vendor/gopkg.in/yaml.v3/yaml.go b/schema/vendor/gopkg.in/yaml.v3/yaml.go index 3ba221c2..8cec6da4 100644 --- a/schema/vendor/gopkg.in/yaml.v3/yaml.go +++ b/schema/vendor/gopkg.in/yaml.v3/yaml.go @@ -363,7 +363,7 @@ const ( // Address yaml.Node // } // err := yaml.Unmarshal(data, &person) -// +// // Or by itself: // // var person Node @@ -373,7 +373,7 @@ type Node struct { // Kind defines whether the node is a document, a mapping, a sequence, // a scalar value, or an alias to another node. The specific data type of // scalar nodes may be obtained via the ShortTag and LongTag methods. - Kind Kind + Kind Kind // Style allows customizing the apperance of the node in the tree. Style Style @@ -421,6 +421,7 @@ func (n *Node) IsZero() bool { n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0 } + // LongTag returns the long form of the tag that indicates the data type for // the node. If the Tag field isn't explicitly defined, one will be computed // based on the node properties. diff --git a/schema/vendor/gopkg.in/yaml.v3/yamlh.go b/schema/vendor/gopkg.in/yaml.v3/yamlh.go index 9e9afc9e..7c6d0077 100644 --- a/schema/vendor/gopkg.in/yaml.v3/yamlh.go +++ b/schema/vendor/gopkg.in/yaml.v3/yamlh.go @@ -639,6 +639,7 @@ type yaml_parser_t struct { } type yaml_comment_t struct { + scan_mark yaml_mark_t // Position where scanning for comments started token_mark yaml_mark_t // Position after which tokens will be associated with this comment start_mark yaml_mark_t // Position of '#' comment mark diff --git a/schema/vendor/gopkg.in/yaml.v3/yamlprivateh.go b/schema/vendor/gopkg.in/yaml.v3/yamlprivateh.go index dea1ba96..e88f9c54 100644 --- a/schema/vendor/gopkg.in/yaml.v3/yamlprivateh.go +++ b/schema/vendor/gopkg.in/yaml.v3/yamlprivateh.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 @@ -137,8 +137,8 @@ func is_crlf(b []byte, i int) bool { func is_breakz(b []byte, i int) bool { //return is_break(b, i) || is_z(b, i) return ( - // is_break: - b[i] == '\r' || // CR (#xD) + // is_break: + b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) @@ -151,8 +151,8 @@ func is_breakz(b []byte, i int) bool { func is_spacez(b []byte, i int) bool { //return is_space(b, i) || is_breakz(b, i) return ( - // is_space: - b[i] == ' ' || + // is_space: + b[i] == ' ' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) @@ -166,8 +166,8 @@ func is_spacez(b []byte, i int) bool { func is_blankz(b []byte, i int) bool { //return is_blank(b, i) || is_breakz(b, i) return ( - // is_blank: - b[i] == ' ' || b[i] == '\t' || + // is_blank: + b[i] == ' ' || b[i] == '\t' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) diff --git a/schema/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.deepcopy.go b/schema/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.deepcopy.go index 5bb530eb..ab474079 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.deepcopy.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go index 2e2db482..cdd9a6a7 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go @@ -20,7 +20,7 @@ import ( "encoding/json" "time" - fuzz "github.com/google/gofuzz" + "github.com/google/gofuzz" ) const RFC3339Micro = "2006-01-02T15:04:05.000000Z07:00" diff --git a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go index c0819757..06afd9b5 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go index a14fdcf1..1aa73bd2 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.defaults.go b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.defaults.go index dac177e9..cce2e603 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.defaults.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.defaults.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/schema/vendor/k8s.io/apimachinery/pkg/labels/zz_generated.deepcopy.go b/schema/vendor/k8s.io/apimachinery/pkg/labels/zz_generated.deepcopy.go index fdf4c31e..4d482947 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/labels/zz_generated.deepcopy.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/labels/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/schema/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.deepcopy.go b/schema/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.deepcopy.go index 069ea4f9..b0393839 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.deepcopy.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/schema/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/schema/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go index f4e6fe1e..6576def8 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go @@ -25,8 +25,8 @@ import ( "strconv" "strings" + "github.com/google/gofuzz" "k8s.io/klog/v2" - fuzz "knative.dev/hack/schema/vendor/github.com/google/gofuzz" ) // IntOrString is a type that can hold an int32 or a string. When used in diff --git a/schema/vendor/k8s.io/apimachinery/pkg/watch/zz_generated.deepcopy.go b/schema/vendor/k8s.io/apimachinery/pkg/watch/zz_generated.deepcopy.go index dd27d452..71ef4da3 100644 --- a/schema/vendor/k8s.io/apimachinery/pkg/watch/zz_generated.deepcopy.go +++ b/schema/vendor/k8s.io/apimachinery/pkg/watch/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/test/e2e-kind.sh b/test/e2e-kind.sh index b5c0d637..f5d0be4c 100755 --- a/test/e2e-kind.sh +++ b/test/e2e-kind.sh @@ -16,7 +16,10 @@ set -Eeo pipefail -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../e2e-tests.sh" +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script e2e-tests.sh)" +popd > /dev/null function knative_setup() { start_latest_knative_serving diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index f10eb6f6..f643172f 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -25,7 +25,10 @@ set -Eeuo pipefail -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../e2e-tests.sh" +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script e2e-tests.sh)" +popd > /dev/null function knative_setup() { start_latest_knative_serving diff --git a/test/hack/update-deps.sh b/test/hack/update-deps.sh index d7d9c82f..f14b4715 100755 --- a/test/hack/update-deps.sh +++ b/test/hack/update-deps.sh @@ -16,6 +16,9 @@ set -Eeuo pipefail -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../../library.sh" +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/../.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script library.sh)" +popd > /dev/null go_update_deps "$@" diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index 42d603db..cf0b34a3 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -23,7 +23,10 @@ set -Eeuo pipefail -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../presubmit-tests.sh" +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script presubmit-tests.sh)" +popd > /dev/null # Run our custom build tests after the standard build tests. diff --git a/test/unit/scripts/fake-prow-job.bash b/test/unit/scripts/fake-prow-job.bash index c777936a..acd308f4 100644 --- a/test/unit/scripts/fake-prow-job.bash +++ b/test/unit/scripts/fake-prow-job.bash @@ -20,3 +20,4 @@ if [[ -z "${PROW_JOB_ID:-}" ]]; then export JOB_TYPE='presubmit' export PULL_PULL_SHA='deadbeef1234567890' fi +export KNATIVE_HACK_SCRIPT_MANUAL_VERBOSE=true diff --git a/test/unit/scripts/source-e2e-tests.bash b/test/unit/scripts/source-e2e-tests.bash index 2a60102c..1d6c7d4d 100755 --- a/test/unit/scripts/source-e2e-tests.bash +++ b/test/unit/scripts/source-e2e-tests.bash @@ -14,4 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../../e2e-tests.sh" +set -Eeuo pipefail + +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/../.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script e2e-tests.sh)" +popd > /dev/null diff --git a/test/unit/scripts/source-library.bash b/test/unit/scripts/source-library.bash index 2da767d6..84314911 100755 --- a/test/unit/scripts/source-library.bash +++ b/test/unit/scripts/source-library.bash @@ -14,4 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../../library.sh" +set -Eeuo pipefail + +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/../.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script library.sh)" +popd > /dev/null diff --git a/test/unit/scripts/source-presubmit-tests.bash b/test/unit/scripts/source-presubmit-tests.bash index f5bd02f8..60ee69d6 100755 --- a/test/unit/scripts/source-presubmit-tests.bash +++ b/test/unit/scripts/source-presubmit-tests.bash @@ -14,4 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../../presubmit-tests.sh" +set -Eeuo pipefail + +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/../.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script presubmit-tests.sh)" +popd > /dev/null diff --git a/test/unit/scripts/source-release.bash b/test/unit/scripts/source-release.bash index 0c130ef7..23062b5a 100755 --- a/test/unit/scripts/source-release.bash +++ b/test/unit/scripts/source-release.bash @@ -14,7 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -source "$(dirname "${BASH_SOURCE[0]:-$0}")/../../release.sh" +set -Eeuo pipefail + +pushd "$(dirname "${BASH_SOURCE[0]:-$0}")/../.." > /dev/null +# shellcheck disable=SC1090 +source "$(go run ./cmd/script release.sh)" +popd > /dev/null function build_release() { return 0 diff --git a/test/unit/sharedlib_test.go b/test/unit/sharedlib_test.go index 8c59d3f8..235cbb12 100644 --- a/test/unit/sharedlib_test.go +++ b/test/unit/sharedlib_test.go @@ -253,6 +253,7 @@ func mockGo(responses ...response) scriptlet { callOriginals := []args{ startsWith{"run " + lstags}, startsWith{"run " + modscope}, + startsWith{"run ./"}, startsWith{"list"}, startsWith{"env"}, startsWith{"version"}, diff --git a/test/vendor/github.com/davecgh/go-spew/spew/bypass.go b/test/vendor/github.com/davecgh/go-spew/spew/bypass.go index 70ddeaad..79299478 100644 --- a/test/vendor/github.com/davecgh/go-spew/spew/bypass.go +++ b/test/vendor/github.com/davecgh/go-spew/spew/bypass.go @@ -18,7 +18,6 @@ // tag is deprecated and thus should not be used. // Go versions prior to 1.4 are disabled because they use a different layout // for interfaces which make the implementation of unsafeReflectValue more complex. -//go:build !js && !appengine && !safe && !disableunsafe && go1.4 // +build !js,!appengine,!safe,!disableunsafe,go1.4 package spew diff --git a/test/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/test/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go index 5e2d890d..205c28d6 100644 --- a/test/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go +++ b/test/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go @@ -16,7 +16,6 @@ // when the code is running on Google App Engine, compiled by GopherJS, or // "-tags safe" is added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. -//go:build js || appengine || safe || disableunsafe || !go1.4 // +build js appengine safe disableunsafe !go1.4 package spew diff --git a/test/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/test/vendor/github.com/pmezard/go-difflib/difflib/difflib.go index 3cfbc1f7..003e99fa 100644 --- a/test/vendor/github.com/pmezard/go-difflib/difflib/difflib.go +++ b/test/vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -161,12 +161,12 @@ func (m *SequenceMatcher) chainB() { m.bJunk = map[string]struct{}{} if m.IsJunk != nil { junk := m.bJunk - for s := range b2j { + for s, _ := range b2j { if m.IsJunk(s) { junk[s] = struct{}{} } } - for s := range junk { + for s, _ := range junk { delete(b2j, s) } } @@ -181,7 +181,7 @@ func (m *SequenceMatcher) chainB() { popular[s] = struct{}{} } } - for s := range popular { + for s, _ := range popular { delete(b2j, s) } } @@ -416,7 +416,7 @@ func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { } codes := m.GetOpCodes() if len(codes) == 0 { - codes = []OpCode{{'e', 0, 1, 0, 1}} + codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} } // Fixup leading and trailing groups if they show no changes. if codes[0].Tag == 'e' { diff --git a/test/vendor/github.com/stretchr/testify/require/require.go b/test/vendor/github.com/stretchr/testify/require/require.go index ffdf0ba5..880853f5 100644 --- a/test/vendor/github.com/stretchr/testify/require/require.go +++ b/test/vendor/github.com/stretchr/testify/require/require.go @@ -6,11 +6,10 @@ package require import ( + assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" - - assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/test/vendor/github.com/stretchr/testify/require/require_forward.go b/test/vendor/github.com/stretchr/testify/require/require_forward.go index e334b851..960bf6f2 100644 --- a/test/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/test/vendor/github.com/stretchr/testify/require/require_forward.go @@ -6,11 +6,10 @@ package require import ( + assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" - - assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/test/vendor/gopkg.in/yaml.v3/apic.go b/test/vendor/gopkg.in/yaml.v3/apic.go index 05fd305d..ae7d049f 100644 --- a/test/vendor/gopkg.in/yaml.v3/apic.go +++ b/test/vendor/gopkg.in/yaml.v3/apic.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 diff --git a/test/vendor/gopkg.in/yaml.v3/emitterc.go b/test/vendor/gopkg.in/yaml.v3/emitterc.go index f6e50b5b..0f47c9ca 100644 --- a/test/vendor/gopkg.in/yaml.v3/emitterc.go +++ b/test/vendor/gopkg.in/yaml.v3/emitterc.go @@ -241,7 +241,7 @@ func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool emitter.indent += 2 } else { // Everything else aligns to the chosen indentation. - emitter.indent = emitter.best_indent * ((emitter.indent + emitter.best_indent) / emitter.best_indent) + emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) } } return true diff --git a/test/vendor/gopkg.in/yaml.v3/readerc.go b/test/vendor/gopkg.in/yaml.v3/readerc.go index 56af2453..b7de0a89 100644 --- a/test/vendor/gopkg.in/yaml.v3/readerc.go +++ b/test/vendor/gopkg.in/yaml.v3/readerc.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 diff --git a/test/vendor/gopkg.in/yaml.v3/scannerc.go b/test/vendor/gopkg.in/yaml.v3/scannerc.go index 037fcd53..ca007010 100644 --- a/test/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/test/vendor/gopkg.in/yaml.v3/scannerc.go @@ -2847,7 +2847,7 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t continue } if parser.buffer[parser.buffer_pos+peek] == '#' { - seen := parser.mark.index + peek + seen := parser.mark.index+peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false @@ -2876,7 +2876,7 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t parser.comments = append(parser.comments, yaml_comment_t{ token_mark: token_mark, start_mark: start_mark, - line: text, + line: text, }) } return true @@ -2910,7 +2910,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo // the foot is the line below it. var foot_line = -1 if scan_mark.line > 0 { - foot_line = parser.mark.line - parser.newlines + 1 + foot_line = parser.mark.line-parser.newlines+1 if parser.newlines == 0 && parser.mark.column > 1 { foot_line++ } @@ -2996,7 +2996,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo recent_empty = false // Consume until after the consumed comment line. - seen := parser.mark.index + peek + seen := parser.mark.index+peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false diff --git a/test/vendor/gopkg.in/yaml.v3/writerc.go b/test/vendor/gopkg.in/yaml.v3/writerc.go index 266d0b09..b8a116bf 100644 --- a/test/vendor/gopkg.in/yaml.v3/writerc.go +++ b/test/vendor/gopkg.in/yaml.v3/writerc.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 diff --git a/test/vendor/gopkg.in/yaml.v3/yaml.go b/test/vendor/gopkg.in/yaml.v3/yaml.go index 3ba221c2..8cec6da4 100644 --- a/test/vendor/gopkg.in/yaml.v3/yaml.go +++ b/test/vendor/gopkg.in/yaml.v3/yaml.go @@ -363,7 +363,7 @@ const ( // Address yaml.Node // } // err := yaml.Unmarshal(data, &person) -// +// // Or by itself: // // var person Node @@ -373,7 +373,7 @@ type Node struct { // Kind defines whether the node is a document, a mapping, a sequence, // a scalar value, or an alias to another node. The specific data type of // scalar nodes may be obtained via the ShortTag and LongTag methods. - Kind Kind + Kind Kind // Style allows customizing the apperance of the node in the tree. Style Style @@ -421,6 +421,7 @@ func (n *Node) IsZero() bool { n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0 } + // LongTag returns the long form of the tag that indicates the data type for // the node. If the Tag field isn't explicitly defined, one will be computed // based on the node properties. diff --git a/test/vendor/gopkg.in/yaml.v3/yamlh.go b/test/vendor/gopkg.in/yaml.v3/yamlh.go index 9e9afc9e..7c6d0077 100644 --- a/test/vendor/gopkg.in/yaml.v3/yamlh.go +++ b/test/vendor/gopkg.in/yaml.v3/yamlh.go @@ -639,6 +639,7 @@ type yaml_parser_t struct { } type yaml_comment_t struct { + scan_mark yaml_mark_t // Position where scanning for comments started token_mark yaml_mark_t // Position after which tokens will be associated with this comment start_mark yaml_mark_t // Position of '#' comment mark diff --git a/test/vendor/gopkg.in/yaml.v3/yamlprivateh.go b/test/vendor/gopkg.in/yaml.v3/yamlprivateh.go index dea1ba96..e88f9c54 100644 --- a/test/vendor/gopkg.in/yaml.v3/yamlprivateh.go +++ b/test/vendor/gopkg.in/yaml.v3/yamlprivateh.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // 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 @@ -137,8 +137,8 @@ func is_crlf(b []byte, i int) bool { func is_breakz(b []byte, i int) bool { //return is_break(b, i) || is_z(b, i) return ( - // is_break: - b[i] == '\r' || // CR (#xD) + // is_break: + b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) @@ -151,8 +151,8 @@ func is_breakz(b []byte, i int) bool { func is_spacez(b []byte, i int) bool { //return is_space(b, i) || is_breakz(b, i) return ( - // is_space: - b[i] == ' ' || + // is_space: + b[i] == ' ' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) @@ -166,8 +166,8 @@ func is_spacez(b []byte, i int) bool { func is_blankz(b []byte, i int) bool { //return is_blank(b, i) || is_breakz(b, i) return ( - // is_blank: - b[i] == ' ' || b[i] == '\t' || + // is_blank: + b[i] == ' ' || b[i] == '\t' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA)