diff --git a/source/commandline.go b/source/commandline.go index b778a9e38a3cd748cbcf28bd01157c0a8afd737a..8b654e59371f4ef087f807c01c64f3def4f78cfd 100644 --- a/source/commandline.go +++ b/source/commandline.go @@ -37,6 +37,7 @@ type commandLineOptions struct { ExitCode bool `short:"e" long:"exit-code-if-no-bump" description:"exit code to use if no notable changes are found"` } `command:"predict" description:"predict the next version based on the git history. This implies --git"` Print struct { + ExitCode bool `short:"e" long:"exit-code-if-no-bump" description:"exit code to use if no notable changes are found"` } `command:"print" description:"print the current version, you can combine this with --git to print the last tag"` Version struct { } `command:"version" description:"print the version of this tool"` @@ -265,8 +266,8 @@ func executeCommand() { err = writeVersion(newVersion) if err != nil { - if activeCommand.Name == "auto" || activeCommand.Name == "predict" { - if arguments.Auto.ExitCode || arguments.Predict.ExitCode { + if activeCommand.Name == "auto" || activeCommand.Name == "predict" || activeCommand.Name == "print" { + if arguments.Auto.ExitCode || arguments.Predict.ExitCode || arguments.Print.ExitCode { os.Exit(10) } } diff --git a/source/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md b/source/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md index 469b44907a09a1f2109cbd96d12d651c76fcbb0d..65987546e2e6f9b04cd4f1ef61025a51cb20e2bd 100644 --- a/source/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md +++ b/source/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities diff --git a/source/vendor/dario.cat/mergo/CONTRIBUTING.md b/source/vendor/dario.cat/mergo/CONTRIBUTING.md index 0a1ff9f94d856b22cda7910367703c9d16c17939..e9d951708c6ff0ba3ec54fa9b3c4b8119a72cb1f 100644 --- a/source/vendor/dario.cat/mergo/CONTRIBUTING.md +++ b/source/vendor/dario.cat/mergo/CONTRIBUTING.md @@ -1,4 +1,5 @@ <!-- omit in toc --> + # Contributing to mergo First off, thanks for taking the time to contribute! â¤ï¸ @@ -6,12 +7,14 @@ First off, thanks for taking the time to contribute! â¤ï¸ All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: +> > - Star the project > - Tweet about it > - Refer this project in your project's readme > - Mention the project at local meetups and tell your friends/colleagues <!-- omit in toc --> + ## Table of Contents - [Code of Conduct](#code-of-conduct) @@ -27,7 +30,6 @@ This project and everyone participating in it is governed by the By participating, you are expected to uphold this code. Please report unacceptable behavior to <>. - ## I Have a Question > If you want to ask a question, we assume that you have read the available [Documentation](https://pkg.go.dev/github.com/imdario/mergo). @@ -45,11 +47,13 @@ We will then take care of the issue as soon as possible. ## I Want To Contribute > ### Legal Notice <!-- omit in toc --> +> > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. ### Reporting Bugs <!-- omit in toc --> + #### Before Submitting a Bug Report A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. @@ -66,16 +70,18 @@ A good bug report shouldn't leave others needing to chase you up for more inform - Can you reliably reproduce the issue? And can you also reproduce it with older versions? <!-- omit in toc --> + #### How Do I Submit a Good Bug Report? > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . + <!-- You may add a PGP key to allow the messages to be sent encrypted as well. --> We use GitHub issues to track bugs and errors. If you run into an issue with the project: - Open an [Issue](https://github.com/imdario/mergo/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. -- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. +- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. Once it's filed: @@ -89,6 +95,7 @@ Once it's filed: This section guides you through submitting an enhancement suggestion for mergo, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. <!-- omit in toc --> + #### Before Submitting an Enhancement - Make sure that you are using the latest version. @@ -97,6 +104,7 @@ This section guides you through submitting an enhancement suggestion for mergo, - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. <!-- omit in toc --> + #### How Do I Submit a Good Enhancement Suggestion? Enhancement suggestions are tracked as [GitHub issues](https://github.com/imdario/mergo/issues). @@ -108,5 +116,7 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/imdari - **Explain why this enhancement would be useful** to most mergo users. You may also want to point out the other projects that solved it better and which could serve as inspiration. <!-- omit in toc --> + ## Attribution + This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! diff --git a/source/vendor/dario.cat/mergo/README.md b/source/vendor/dario.cat/mergo/README.md index 7d0cf9f32afe36c6bff40876b190e70ec85d2fdb..165f4b63f757675732b711d2d71189cf736d7b24 100644 --- a/source/vendor/dario.cat/mergo/README.md +++ b/source/vendor/dario.cat/mergo/README.md @@ -58,7 +58,7 @@ Please keep in mind that a problematic PR broke [0.3.9](//github.com/imdario/mer Keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2), Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). I added an optional/variadic argument so that it won't break the existing code. -If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u dario.cat/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). +If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with `go get -u dario.cat/mergo`. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). ### Donations diff --git a/source/vendor/github.com/Masterminds/semver/CHANGELOG.md b/source/vendor/github.com/Masterminds/semver/CHANGELOG.md index e405c9a84d9056264d1ed8a740f7f92bb2e89978..3625f9726f6e3c0c86c819c88ec1a95fd64d3e82 100644 --- a/source/vendor/github.com/Masterminds/semver/CHANGELOG.md +++ b/source/vendor/github.com/Masterminds/semver/CHANGELOG.md @@ -18,68 +18,81 @@ - #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 +- #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 * + +- #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 @@ -89,6 +102,7 @@ # 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 @@ -102,7 +116,7 @@ # Release 1.0.1 (2015-12-31) -- Fixed #1: * constraint failing on valid versions. +- Fixed #1: \* constraint failing on valid versions. # Release 1.0.0 (2015-10-20) diff --git a/source/vendor/github.com/Masterminds/semver/README.md b/source/vendor/github.com/Masterminds/semver/README.md index 1b52d2f4362eaf28df7cfb6b3b41f5a2677e310a..cccb6d713e7231fcdaf36a2774356a9a9821e23b 100644 --- a/source/vendor/github.com/Masterminds/semver/README.md +++ b/source/vendor/github.com/Masterminds/semver/README.md @@ -2,10 +2,10 @@ 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 +- Parse semantic versions +- Sort semantic versions +- Check if a semantic version fits within a set of constraints +- Optionally work with a `v` prefix [](https://masterminds.github.io/stability/active.html) @@ -76,12 +76,12 @@ 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 +- `=`: equal (aliased to no operator) +- `!=`: not equal +- `>`: greater than +- `<`: less than +- `>=`: greater than or equal to +- `<=`: less than or equal to ## Working With Pre-release Versions @@ -115,8 +115,8 @@ the spec specifies. 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` +- `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 @@ -124,10 +124,10 @@ 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 pack 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` +- `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) @@ -135,22 +135,22 @@ 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` +- `~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. 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` -* `^0.0.1` is equivalent to `>= 0.0.1, < 1.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` +- `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` +- `^0.0.1` is equivalent to `>= 0.0.1, < 1.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` # Validation @@ -183,7 +183,7 @@ version didn't meet the constraint is returned. For example, # Fuzzing - [dvyukov/go-fuzz](https://github.com/dvyukov/go-fuzz) is used for fuzzing. +[dvyukov/go-fuzz](https://github.com/dvyukov/go-fuzz) is used for fuzzing. 1. `go-fuzz-build` 2. `go-fuzz -workdir=fuzz` diff --git a/source/vendor/github.com/Masterminds/semver/doc.go b/source/vendor/github.com/Masterminds/semver/doc.go index 6a6c24c6d6e2a80986d40bc08eb3f93ae79369d9..e87ae2ff861b577eb5eb27f21145554bd63c3d17 100644 --- a/source/vendor/github.com/Masterminds/semver/doc.go +++ b/source/vendor/github.com/Masterminds/semver/doc.go @@ -3,58 +3,58 @@ Package semver provides the ability to work with Semantic Versions (http://semve 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 + - 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 +# Parsing Semantic Versions To parse a semantic version use the `NewVersion` function. For example, - v, err := semver.NewVersion("1.2.3-beta.1+build345") + v, err := semver.NewVersion("1.2.3-beta.1+build345") If there is an error the version wasn't parseable. 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 +# 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) - } + 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 - } + vs[i] = v + } - sort.Sort(semver.Collection(vs)) + sort.Sort(semver.Collection(vs)) -Checking Version Constraints +# Checking Version Constraints 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 parseable. - } + c, err := semver.NewConstraint(">= 1.2.3") + if err != nil { + // Handle constraint not being parseable. + } - v, err := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - // Check if the version meets the constraints. The a variable will be true. - a := c.Check(v) + v, err := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parseable. + } + // Check if the version meets the constraints. The a variable will be true. + a := c.Check(v) -Basic Comparisons +# Basic Comparisons There are two elements to the comparisons. First, a comparison string is a list of comma separated and comparisons. These are then separated by || separated or @@ -64,31 +64,31 @@ 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 + - `=`: equal (aliased to no operator) + - `!=`: not equal + - `>`: greater than + - `<`: less than + - `>=`: greater than or equal to + - `<=`: less than or equal to -Hyphen Range Comparisons +# 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` + - `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 +# 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 pack 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` + - `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) @@ -96,20 +96,20 @@ 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` + - `~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. 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` + - `^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` */ package semver diff --git a/source/vendor/github.com/Masterminds/semver/version_fuzz.go b/source/vendor/github.com/Masterminds/semver/version_fuzz.go index b42bcd62b954d25d9d628a7a2d21d8a84989902c..606082c1e1faa535910df124e6bfddffdd485ce6 100644 --- a/source/vendor/github.com/Masterminds/semver/version_fuzz.go +++ b/source/vendor/github.com/Masterminds/semver/version_fuzz.go @@ -1,3 +1,4 @@ +//go:build gofuzz // +build gofuzz package semver diff --git a/source/vendor/github.com/Microsoft/go-winio/README.md b/source/vendor/github.com/Microsoft/go-winio/README.md index 7474b4f0b653a4f67ea1fda71a608cdbd49ff159..eff6dc9276c730e65a962d70fbaaa19e19bc1b0c 100644 --- a/source/vendor/github.com/Microsoft/go-winio/README.md +++ b/source/vendor/github.com/Microsoft/go-winio/README.md @@ -82,8 +82,6 @@ See [npipe](https://github.com/natefinch/npipe) for another named pipe implement [lint]: https://golangci-lint.run/ [lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration [lint-install]: https://golangci-lint.run/usage/install/#local-installation - [git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s [git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff - [natefinch]: https://github.com/natefinch diff --git a/source/vendor/github.com/Microsoft/go-winio/SECURITY.md b/source/vendor/github.com/Microsoft/go-winio/SECURITY.md index 869fdfe2b246991a053fab9cfec1bed3ab532ab1..1488eb5dc991746d7c9f1ed52f98f928a41fea68 100644 --- a/source/vendor/github.com/Microsoft/go-winio/SECURITY.md +++ b/source/vendor/github.com/Microsoft/go-winio/SECURITY.md @@ -12,19 +12,19 @@ If you believe you have found a security vulnerability in any Microsoft-owned re Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue +- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. diff --git a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go index 2d7b0cf373722d7d6b72737ff1b358acc93b07a8..0ea619de2d5944d8fb3f743ef24702bcf7d53b96 100644 --- a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go +++ b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go @@ -259,7 +259,7 @@ func (e *Entity) EncryptPrivateKeys(passphrase []byte, config *packet.Config) er var keysToEncrypt []*packet.PrivateKey // Add entity private key to encrypt. if e.PrivateKey != nil && !e.PrivateKey.Dummy() && !e.PrivateKey.Encrypted { - keysToEncrypt = append(keysToEncrypt, e.PrivateKey) + keysToEncrypt = append(keysToEncrypt, e.PrivateKey) } // Add subkeys to encrypt. @@ -284,7 +284,7 @@ func (e *Entity) DecryptPrivateKeys(passphrase []byte) error { // Add subkeys to decrypt. for _, sub := range e.Subkeys { if sub.PrivateKey != nil && !sub.PrivateKey.Dummy() && sub.PrivateKey.Encrypted { - keysToDecrypt = append(keysToDecrypt, sub.PrivateKey) + keysToDecrypt = append(keysToDecrypt, sub.PrivateKey) } } return packet.DecryptPrivateKeys(keysToDecrypt, passphrase) diff --git a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go index 2fc4386437c1de24887226b540acc7a4f6aa2f18..d42f1bb75ce268edca88921332f0e21e5c76484c 100644 --- a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go +++ b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go @@ -458,7 +458,7 @@ func (pk *PrivateKey) Decrypt(passphrase []byte) error { } // DecryptPrivateKeys decrypts all encrypted keys with the given config and passphrase. -// Avoids recomputation of similar s2k key derivations. +// Avoids recomputation of similar s2k key derivations. func DecryptPrivateKeys(keys []*PrivateKey, passphrase []byte) error { // Create a cache to avoid recomputation of key derviations for the same passphrase. s2kCache := &s2k.Cache{} @@ -485,7 +485,7 @@ func (pk *PrivateKey) encrypt(key []byte, params *s2k.Params, cipherFunction Cip if len(key) != cipherFunction.KeySize() { return errors.InvalidArgumentError("supplied encryption key has the wrong size") } - + priv := bytes.NewBuffer(nil) err := pk.serializePrivateKey(priv) if err != nil { @@ -497,7 +497,7 @@ func (pk *PrivateKey) encrypt(key []byte, params *s2k.Params, cipherFunction Cip pk.s2k, err = pk.s2kParams.Function() if err != nil { return err - } + } privateKeyBytes := priv.Bytes() pk.sha1Checksum = true @@ -581,7 +581,7 @@ func (pk *PrivateKey) Encrypt(passphrase []byte) error { S2KMode: s2k.IteratedSaltedS2K, S2KCount: 65536, Hash: crypto.SHA256, - } , + }, DefaultCipher: CipherAES256, } return pk.EncryptWithConfig(passphrase, config) diff --git a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go index a43695964b2aeff768c537773cb843bea30e939c..e7189b19ad47869cfc072e2338426b412654e428 100644 --- a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go +++ b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go @@ -87,10 +87,10 @@ func decodeCount(c uint8) int { // encodeMemory converts the Argon2 "memory" in the range parallelism*8 to // 2**31, inclusive, to an encoded memory. The return value is the // octet that is actually stored in the GPG file. encodeMemory panics -// if is not in the above range +// if is not in the above range // See OpenPGP crypto refresh Section 3.7.1.4. func encodeMemory(memory uint32, parallelism uint8) uint8 { - if memory < (8 * uint32(parallelism)) || memory > uint32(2147483648) { + if memory < (8*uint32(parallelism)) || memory > uint32(2147483648) { panic("Memory argument memory is outside the required range") } @@ -199,8 +199,8 @@ func Generate(rand io.Reader, c *Config) (*Params, error) { } params = &Params{ - mode: SaltedS2K, - hashId: hashId, + mode: SaltedS2K, + hashId: hashId, } } else { // Enforce IteratedSaltedS2K method otherwise hashId, ok := algorithm.HashToHashId(c.hash()) @@ -211,7 +211,7 @@ func Generate(rand io.Reader, c *Config) (*Params, error) { c.S2KMode = IteratedSaltedS2K } params = &Params{ - mode: IteratedSaltedS2K, + mode: IteratedSaltedS2K, hashId: hashId, countByte: c.EncodedCount(), } @@ -306,9 +306,12 @@ func (params *Params) Dummy() bool { func (params *Params) salt() []byte { switch params.mode { - case SaltedS2K, IteratedSaltedS2K: return params.saltBytes[:8] - case Argon2S2K: return params.saltBytes[:Argon2SaltSize] - default: return nil + case SaltedS2K, IteratedSaltedS2K: + return params.saltBytes[:8] + case Argon2S2K: + return params.saltBytes[:Argon2SaltSize] + default: + return nil } } diff --git a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go index 25a4442dfbd1fabafd0494a2d3b64cc31dce8e24..616e0d12c6c93d172654a65b7113d4dfa6e93ad0 100644 --- a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go +++ b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go @@ -5,7 +5,7 @@ package s2k // the same parameters. type Cache map[Params][]byte -// GetOrComputeDerivedKey tries to retrieve the key +// GetOrComputeDerivedKey tries to retrieve the key // for the given s2k parameters from the cache. // If there is no hit, it derives the key with the s2k function from the passphrase, // updates the cache, and returns the key. diff --git a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go index b40be5228fcabc81a018f09135e59c0f0e1743ad..1a6b7f1410dfb4812df5e717db2de54aff084ae3 100644 --- a/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go +++ b/source/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go @@ -50,9 +50,9 @@ type Config struct { type Argon2Config struct { NumberOfPasses uint8 DegreeOfParallelism uint8 - // The memory parameter for Argon2 specifies desired memory usage in kibibytes. + // The memory parameter for Argon2 specifies desired memory usage in kibibytes. // For example memory=64*1024 sets the memory cost to ~64 MB. - Memory uint32 + Memory uint32 } func (c *Config) Mode() Mode { @@ -115,7 +115,7 @@ func (c *Argon2Config) EncodedMemory() uint8 { } memory := c.Memory - lowerBound := uint32(c.Parallelism())*8 + lowerBound := uint32(c.Parallelism()) * 8 upperBound := uint32(2147483648) switch { diff --git a/source/vendor/github.com/cyphar/filepath-securejoin/README.md b/source/vendor/github.com/cyphar/filepath-securejoin/README.md index 4eca0f235502212731f4bf20a3ef47f232ff4d16..6a55b61c73f77248abbc4de9bd8d599a4bd2dae5 100644 --- a/source/vendor/github.com/cyphar/filepath-securejoin/README.md +++ b/source/vendor/github.com/cyphar/filepath-securejoin/README.md @@ -1,4 +1,4 @@ -## `filepath-securejoin` ## +## `filepath-securejoin` [](https://github.com/cyphar/filepath-securejoin/actions/workflows/ci.yml) @@ -7,7 +7,7 @@ standard library][go#20126]. The purpose of this function is to be a "secure" alternative to `filepath.Join`, and in particular it provides certain guarantees that are not provided by `filepath.Join`. -> **NOTE**: This code is *only* safe if you are not at risk of other processes +> **NOTE**: This code is _only_ safe if you are not at risk of other processes > modifying path components after you've used `SecureJoin`. If it is possible > for a malicious process to modify path components of the resolved path, then > you will be vulnerable to some fairly trivial TOCTOU race conditions. [There @@ -28,20 +28,20 @@ func SecureJoin(root, unsafePath string) (string, error) This library **guarantees** the following: -* If no error is set, the resulting string **must** be a child path of +- If no error is set, the resulting string **must** be a child path of `root` and will not contain any symlink path components (they will all be expanded). -* When expanding symlinks, all symlink path components **must** be resolved +- When expanding symlinks, all symlink path components **must** be resolved relative to the provided root. In particular, this can be considered a userspace implementation of how `chroot(2)` operates on file paths. Note that these symlinks will **not** be expanded lexically (`filepath.Clean` is not called on the input before processing). -* Non-existent path components are unaffected by `SecureJoin` (similar to +- Non-existent path components are unaffected by `SecureJoin` (similar to `filepath.EvalSymlinks`'s semantics). -* The returned path will always be `filepath.Clean`ed and thus not contain any +- The returned path will always be `filepath.Clean`ed and thus not contain any `..` components. A (trivial) implementation of this function on GNU/Linux systems could be done @@ -73,7 +73,7 @@ func SecureJoin(root, unsafePath string) (string, error) { [lwn-obeneath]: https://lwn.net/Articles/767547/ [go#20126]: https://github.com/golang/go/issues/20126 -### License ### +### License The license of this project is the same as Go, which is a BSD 3-clause license available in the `LICENSE` file. diff --git a/source/vendor/github.com/dprotaso/go-yit/README.md b/source/vendor/github.com/dprotaso/go-yit/README.md index 28ebf14ec48b9b19bba43a5cd9041441f5a83372..987b92d9b69b35263b3b9b20cfc8fad2798c2ed9 100644 --- a/source/vendor/github.com/dprotaso/go-yit/README.md +++ b/source/vendor/github.com/dprotaso/go-yit/README.md @@ -10,12 +10,13 @@ functional style methods for iterating over YAML documents. ## Usage Import the package + ```go import "github.com/dprotaso/go-yit" ``` - Query your YAML document + ```go package main @@ -51,4 +52,3 @@ func main() { } } ``` - diff --git a/source/vendor/github.com/emirpasic/gods/containers/iterator.go b/source/vendor/github.com/emirpasic/gods/containers/iterator.go index 73994ec82a7f4f60b1c4c135a970af2ffd0c412d..8bab70acad6df436cd0088a489914faaafeaeb56 100644 --- a/source/vendor/github.com/emirpasic/gods/containers/iterator.go +++ b/source/vendor/github.com/emirpasic/gods/containers/iterator.go @@ -72,7 +72,7 @@ type IteratorWithKey interface { // // Essentially it is the same as IteratorWithIndex, but provides additional: // -// Prev() function to enable traversal in reverse +// # Prev() function to enable traversal in reverse // // Last() function to move the iterator to the last element. // @@ -105,7 +105,7 @@ type ReverseIteratorWithIndex interface { // // Essentially it is the same as IteratorWithKey, but provides additional: // -// Prev() function to enable traversal in reverse +// # Prev() function to enable traversal in reverse // // Last() function to move the iterator to the last element. type ReverseIteratorWithKey interface { diff --git a/source/vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go b/source/vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go index 60ce4583203a4cb79f807411f315d6b4436864fb..8d0aef3c62deeb032cf99011f2078dda93a8aefe 100644 --- a/source/vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go +++ b/source/vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go @@ -102,7 +102,7 @@ func (list *List) Values() []interface{} { return newElements } -//IndexOf returns index of provided element +// IndexOf returns index of provided element func (list *List) IndexOf(value interface{}) int { if list.size == 0 { return -1 diff --git a/source/vendor/github.com/emirpasic/gods/utils/comparator.go b/source/vendor/github.com/emirpasic/gods/utils/comparator.go index 6a9afbf3466f51c85afae4f7c8c6a0e4d14799d2..b673c80183028089cbd1fe1e4ce9900d3dcf1bf8 100644 --- a/source/vendor/github.com/emirpasic/gods/utils/comparator.go +++ b/source/vendor/github.com/emirpasic/gods/utils/comparator.go @@ -10,9 +10,10 @@ import "time" // which will panic if a or b are not of the asserted type. // // Should return a number: -// negative , if a < b -// zero , if a == b -// positive , if a > b +// +// negative , if a < b +// zero , if a == b +// positive , if a > b type Comparator func(a, b interface{}) int // StringComparator provides a fast comparison on strings diff --git a/source/vendor/github.com/go-git/gcfg/doc.go b/source/vendor/github.com/go-git/gcfg/doc.go index 7bdefbf0203cf9d8352906438657ea0059f72297..3b05c96c313baf598052e55f4635de21b1f81520 100644 --- a/source/vendor/github.com/go-git/gcfg/doc.go +++ b/source/vendor/github.com/go-git/gcfg/doc.go @@ -4,29 +4,29 @@ // This package is still a work in progress; see the sections below for planned // changes. // -// Syntax +// # Syntax // // The syntax is based on that used by git config: // http://git-scm.com/docs/git-config#_syntax . // There are some (planned) differences compared to the git config format: -// - improve data portability: -// - must be encoded in UTF-8 (for now) and must not contain the 0 byte -// - include and "path" type is not supported -// (path type may be implementable as a user-defined type) -// - internationalization -// - section and variable names can contain unicode letters, unicode digits -// (as defined in http://golang.org/ref/spec#Characters ) and hyphens -// (U+002D), starting with a unicode letter -// - disallow potentially ambiguous or misleading definitions: -// - `[sec.sub]` format is not allowed (deprecated in gitconfig) -// - `[sec ""]` is not allowed -// - use `[sec]` for section name "sec" and empty subsection name -// - (planned) within a single file, definitions must be contiguous for each: -// - section: '[secA]' -> '[secB]' -> '[secA]' is an error -// - subsection: '[sec "A"]' -> '[sec "B"]' -> '[sec "A"]' is an error -// - multivalued variable: 'multi=a' -> 'other=x' -> 'multi=b' is an error -// -// Data structure +// - improve data portability: +// - must be encoded in UTF-8 (for now) and must not contain the 0 byte +// - include and "path" type is not supported +// (path type may be implementable as a user-defined type) +// - internationalization +// - section and variable names can contain unicode letters, unicode digits +// (as defined in http://golang.org/ref/spec#Characters ) and hyphens +// (U+002D), starting with a unicode letter +// - disallow potentially ambiguous or misleading definitions: +// - `[sec.sub]` format is not allowed (deprecated in gitconfig) +// - `[sec ""]` is not allowed +// - use `[sec]` for section name "sec" and empty subsection name +// - (planned) within a single file, definitions must be contiguous for each: +// - section: '[secA]' -> '[secB]' -> '[secA]' is an error +// - subsection: '[sec "A"]' -> '[sec "B"]' -> '[sec "A"]' is an error +// - multivalued variable: 'multi=a' -> 'other=x' -> 'multi=b' is an error +// +// # Data structure // // The functions in this package read values into a user-defined struct. // Each section corresponds to a struct field in the config struct, and each @@ -56,7 +56,7 @@ // or when a field is not of a suitable type (either a struct or a map with // string keys and pointer-to-struct values). // -// Parsing of values +// # Parsing of values // // The section structs in the config struct may contain single-valued or // multi-valued variables. Variables of unnamed slice type (that is, a type @@ -98,17 +98,17 @@ // The types subpackage for provides helpers for parsing "enum-like" and integer // types. // -// Error handling +// # Error handling // // There are 3 types of errors: // -// - programmer errors / panics: -// - invalid configuration structure -// - data errors: -// - fatal errors: -// - invalid configuration syntax -// - warnings: -// - data that doesn't belong to any part of the config structure +// - programmer errors / panics: +// - invalid configuration structure +// - data errors: +// - fatal errors: +// - invalid configuration syntax +// - warnings: +// - data that doesn't belong to any part of the config structure // // Programmer errors trigger panics. These are should be fixed by the programmer // before releasing code that uses gcfg. @@ -122,24 +122,23 @@ // filtered out programmatically. To ignore extra data warnings, wrap the // gcfg.Read*Into invocation into a call to gcfg.FatalOnly. // -// TODO +// # TODO // // The following is a list of changes under consideration: -// - documentation -// - self-contained syntax documentation -// - more practical examples -// - move TODOs to issue tracker (eventually) -// - syntax -// - reconsider valid escape sequences -// (gitconfig doesn't support \r in value, \t in subsection name, etc.) -// - reading / parsing gcfg files -// - define internal representation structure -// - support multiple inputs (readers, strings, files) -// - support declaring encoding (?) -// - support varying fields sets for subsections (?) -// - writing gcfg files -// - error handling -// - make error context accessible programmatically? -// - limit input size? -// +// - documentation +// - self-contained syntax documentation +// - more practical examples +// - move TODOs to issue tracker (eventually) +// - syntax +// - reconsider valid escape sequences +// (gitconfig doesn't support \r in value, \t in subsection name, etc.) +// - reading / parsing gcfg files +// - define internal representation structure +// - support multiple inputs (readers, strings, files) +// - support declaring encoding (?) +// - support varying fields sets for subsections (?) +// - writing gcfg files +// - error handling +// - make error context accessible programmatically? +// - limit input size? package gcfg // import "github.com/go-git/gcfg" diff --git a/source/vendor/github.com/go-git/gcfg/errors.go b/source/vendor/github.com/go-git/gcfg/errors.go index 853c76021de43507c71475802de5836533773bde..fe77046e16bca2744041a59998ddf5f1d548eb23 100644 --- a/source/vendor/github.com/go-git/gcfg/errors.go +++ b/source/vendor/github.com/go-git/gcfg/errors.go @@ -8,10 +8,9 @@ import ( // fatal errors. That is, errors (warnings) indicating data for unknown // sections / variables is ignored. Example invocation: // -// err := gcfg.FatalOnly(gcfg.ReadFileInto(&cfg, configFile)) -// if err != nil { -// ... -// +// err := gcfg.FatalOnly(gcfg.ReadFileInto(&cfg, configFile)) +// if err != nil { +// ... func FatalOnly(err error) error { return warnings.FatalOnly(err) } diff --git a/source/vendor/github.com/go-git/gcfg/scanner/errors.go b/source/vendor/github.com/go-git/gcfg/scanner/errors.go index a6e00f5c64e803d126537bee231644ba0c15b583..3632df998478b2577e513f3109d6932c3f758fc0 100644 --- a/source/vendor/github.com/go-git/gcfg/scanner/errors.go +++ b/source/vendor/github.com/go-git/gcfg/scanner/errors.go @@ -18,7 +18,6 @@ import ( // The position Pos, if valid, points to the beginning of // the offending token, and the error condition is described // by Msg. -// type Error struct { Pos token.Position Msg string @@ -36,7 +35,6 @@ func (e Error) Error() string { // ErrorList is a list of *Errors. // The zero value for an ErrorList is an empty ErrorList ready to use. -// type ErrorList []*Error // Add adds an Error with given position and error message to an ErrorList. @@ -66,7 +64,6 @@ func (p ErrorList) Less(i, j int) bool { // Sort sorts an ErrorList. *Error entries are sorted by position, // other errors are sorted by error message, and before any *Error // entry. -// func (p ErrorList) Sort() { sort.Sort(p) } @@ -109,7 +106,6 @@ func (p ErrorList) Err() error { // PrintError is a utility function that prints a list of errors to w, // one error per line, if the err parameter is an ErrorList. Otherwise // it prints the err string. -// func PrintError(w io.Writer, err error) { if list, ok := err.(ErrorList); ok { for _, e := range list { diff --git a/source/vendor/github.com/go-git/gcfg/set.go b/source/vendor/github.com/go-git/gcfg/set.go index dc9795dbdb2071d5fa27897b1ac1d979d2b44b8d..8dc27e75eb94ff3cda9aee9c6dacf1e22277e204 100644 --- a/source/vendor/github.com/go-git/gcfg/set.go +++ b/source/vendor/github.com/go-git/gcfg/set.go @@ -216,7 +216,7 @@ func newValue(c *warnings.Collector, sect string, vCfg reflect.Value, } func set(c *warnings.Collector, cfg interface{}, sect, sub, name string, - value string, blankValue bool, subsectPass bool) error { + value string, blankValue bool, subsectPass bool) error { // vPCfg := reflect.ValueOf(cfg) if vPCfg.Kind() != reflect.Ptr || vPCfg.Elem().Kind() != reflect.Struct { diff --git a/source/vendor/github.com/go-git/gcfg/token/position.go b/source/vendor/github.com/go-git/gcfg/token/position.go index fc45c1e7693efd56fc38784556f4c7e27d6602a3..a5ce7d244968c575f3847089dbfeb1369b60e21a 100644 --- a/source/vendor/github.com/go-git/gcfg/token/position.go +++ b/source/vendor/github.com/go-git/gcfg/token/position.go @@ -18,7 +18,6 @@ import ( // Position describes an arbitrary source position // including the file, line, and column location. // A Position is valid if the line number is > 0. -// type Position struct { Filename string // filename, if any Offset int // offset, starting at 0 @@ -35,7 +34,6 @@ func (pos *Position) IsValid() bool { return pos.Line > 0 } // line:column valid position without file name // file invalid position with file name // - invalid position without file name -// func (pos Position) String() string { s := pos.Filename if pos.IsValid() { @@ -69,14 +67,12 @@ func (pos Position) String() string { // equivalent to comparing the respective source file offsets. If p and q // are in different files, p < q is true if the file implied by p was added // to the respective file set before the file implied by q. -// type Pos int // The zero value for Pos is NoPos; there is no file and line information // associated with it, and NoPos().IsValid() is false. NoPos is always // smaller than any other Pos value. The corresponding Position value // for NoPos is the zero value for Position. -// const NoPos Pos = 0 // IsValid returns true if the position is valid. @@ -89,7 +85,6 @@ func (p Pos) IsValid() bool { // A File is a handle for a file belonging to a FileSet. // A File has a name, size, and line offset table. -// type File struct { set *FileSet name string // file name as provided to AddFile @@ -127,7 +122,6 @@ func (f *File) LineCount() int { // AddLine adds the line offset for a new line. // The line offset must be larger than the offset for the previous line // and smaller than the file size; otherwise the line offset is ignored. -// func (f *File) AddLine(offset int) { f.set.mutex.Lock() if i := len(f.lines); (i == 0 || f.lines[i-1] < offset) && offset < f.size { @@ -143,7 +137,6 @@ func (f *File) AddLine(offset int) { // Each line offset must be larger than the offset for the previous line // and smaller than the file size; otherwise SetLines fails and returns // false. -// func (f *File) SetLines(lines []int) bool { // verify validity of lines table size := f.size @@ -197,7 +190,6 @@ type lineInfo struct { // // AddLineInfo is typically used to register alternative position // information for //line filename:line comments in source files. -// func (f *File) AddLineInfo(offset int, filename string, line int) { f.set.mutex.Lock() if i := len(f.infos); i == 0 || f.infos[i-1].Offset < offset && offset < f.size { @@ -209,7 +201,6 @@ func (f *File) AddLineInfo(offset int, filename string, line int) { // Pos returns the Pos value for the given file offset; // the offset must be <= f.Size(). // f.Pos(f.Offset(p)) == p. -// func (f *File) Pos(offset int) Pos { if offset > f.size { panic("illegal file offset") @@ -220,7 +211,6 @@ func (f *File) Pos(offset int) Pos { // Offset returns the offset for the given file position p; // p must be a valid Pos value in that file. // f.Offset(f.Pos(offset)) == offset. -// func (f *File) Offset(p Pos) int { if int(p) < f.base || int(p) > f.base+f.size { panic("illegal Pos value") @@ -230,7 +220,6 @@ func (f *File) Offset(p Pos) int { // Line returns the line number for the given file position p; // p must be a Pos value in that file or NoPos. -// func (f *File) Line(p Pos) int { // TODO(gri) this can be implemented much more efficiently return f.Position(p).Line @@ -268,7 +257,6 @@ func (f *File) position(p Pos) (pos Position) { // Position returns the Position value for the given file position p; // p must be a Pos value in that file or NoPos. -// func (f *File) Position(p Pos) (pos Position) { if p != NoPos { if int(p) < f.base || int(p) > f.base+f.size { @@ -285,7 +273,6 @@ func (f *File) Position(p Pos) (pos Position) { // A FileSet represents a set of source files. // Methods of file sets are synchronized; multiple goroutines // may invoke them concurrently. -// type FileSet struct { mutex sync.RWMutex // protects the file set base int // base offset for the next file @@ -302,7 +289,6 @@ func NewFileSet() *FileSet { // Base returns the minimum base offset that must be provided to // AddFile when adding the next file. -// func (s *FileSet) Base() int { s.mutex.RLock() b := s.base @@ -325,7 +311,6 @@ func (s *FileSet) Base() int { // with offs in the range [0, size] and thus p in the range [base, base+size]. // For convenience, File.Pos may be used to create file-specific position // values from a file offset. -// func (s *FileSet) AddFile(filename string, base, size int) *File { s.mutex.Lock() defer s.mutex.Unlock() @@ -347,7 +332,6 @@ func (s *FileSet) AddFile(filename string, base, size int) *File { // Iterate calls f for the files in the file set in the order they were added // until f returns false. -// func (s *FileSet) Iterate(f func(*File) bool) { for i := 0; ; i++ { var file *File @@ -386,7 +370,6 @@ func (s *FileSet) file(p Pos) *File { // File returns the file that contains the position p. // If no such file is found (for instance for p == NoPos), // the result is nil. -// func (s *FileSet) File(p Pos) (f *File) { if p != NoPos { s.mutex.RLock() diff --git a/source/vendor/github.com/go-git/gcfg/token/token.go b/source/vendor/github.com/go-git/gcfg/token/token.go index b3c7c83fa9e6c67f59bc4ddfbf66164e9ba3b819..102df388a7a71d351756c070966489728d212aa5 100644 --- a/source/vendor/github.com/go-git/gcfg/token/token.go +++ b/source/vendor/github.com/go-git/gcfg/token/token.go @@ -7,7 +7,6 @@ // // Note that the API for the token package may change to accommodate new // features or implementation changes in gcfg. -// package token import "strconv" @@ -58,7 +57,6 @@ var tokens = [...]string{ // sequence (e.g., for the token ASSIGN, the string is "="). For all other // tokens the string corresponds to the token constant name (e.g. for the // token IDENT, the string is "IDENT"). -// func (tok Token) String() string { s := "" if 0 <= tok && tok < Token(len(tokens)) { @@ -74,10 +72,8 @@ func (tok Token) String() string { // IsLiteral returns true for tokens corresponding to identifiers // and basic type literals; it returns false otherwise. -// func (tok Token) IsLiteral() bool { return literal_beg < tok && tok < literal_end } // IsOperator returns true for tokens corresponding to operators and // delimiters; it returns false otherwise. -// func (tok Token) IsOperator() bool { return operator_beg < tok && tok < operator_end } diff --git a/source/vendor/github.com/go-git/go-billy/v5/memfs/memory.go b/source/vendor/github.com/go-git/go-billy/v5/memfs/memory.go index dab73968b63014ca93efab4282bfefd14f4ff8a8..fedd4168e32a1849fd8e544f22d746417e2fa61d 100644 --- a/source/vendor/github.com/go-git/go-billy/v5/memfs/memory.go +++ b/source/vendor/github.com/go-git/go-billy/v5/memfs/memory.go @@ -25,7 +25,7 @@ type Memory struct { tempCount int } -//New returns a new Memory filesystem. +// New returns a new Memory filesystem. func New() billy.Filesystem { fs := &Memory{s: newStorage()} return chroot.New(fs, string(separator)) diff --git a/source/vendor/github.com/go-git/go-billy/v5/util/walk.go b/source/vendor/github.com/go-git/go-billy/v5/util/walk.go index 1531bcaaaeb31fcf90ce7e7828225012279aa0cc..7412d52346e30c1c3a90e3006fce90df033d0c70 100644 --- a/source/vendor/github.com/go-git/go-billy/v5/util/walk.go +++ b/source/vendor/github.com/go-git/go-billy/v5/util/walk.go @@ -46,7 +46,7 @@ func walk(fs billy.Filesystem, path string, info os.FileInfo, walkFn filepath.Wa return nil } -// Walk walks the file tree rooted at root, calling fn for each file or +// Walk walks the file tree rooted at root, calling fn for each file or // directory in the tree, including root. All errors that arise visiting files // and directories are filtered by fn: see the WalkFunc documentation for // details. @@ -54,7 +54,7 @@ func walk(fs billy.Filesystem, path string, info os.FileInfo, walkFn filepath.Wa // The files are walked in lexical order, which makes the output deterministic // but requires Walk to read an entire directory into memory before proceeding // to walk that directory. Walk does not follow symbolic links. -// +// // Function adapted from https://github.com/golang/go/blob/3b770f2ccb1fa6fecc22ea822a19447b10b70c5c/src/path/filepath/path.go#L500 func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error { info, err := fs.Lstat(root) @@ -63,10 +63,10 @@ func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error { } else { err = walk(fs, root, info, walkFn) } - + if err == filepath.SkipDir { return nil } - + return err } diff --git a/source/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md b/source/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md index a689fa3c34adee7180ece6a02363b18a38156093..8ade00b1235a2192552ab4f62c86186fbba68418 100644 --- a/source/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md +++ b/source/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md @@ -14,21 +14,21 @@ religion, or sexual identity and orientation. Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or +- The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities @@ -71,4 +71,3 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org - diff --git a/source/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md b/source/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md index fce25328a7fb50758445f58914fa37a1ec5a0e43..bbb43c570410326e6fabe0279e0bfc17797f387e 100644 --- a/source/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md +++ b/source/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contributing Guidelines source{d} go-git project is [Apache 2.0 licensed](LICENSE) and accepts -contributions via GitHub pull requests. This document outlines some of the +contributions via GitHub pull requests. This document outlines some of the conventions on development workflow, commit message formatting, contact points, and other resources to make it easier to get your contribution accepted. @@ -10,13 +10,12 @@ and other resources to make it easier to get your contribution accepted. The official support channels, for both users and contributors, are: - [StackOverflow go-git tag](https://stackoverflow.com/questions/tagged/go-git) for user questions. -- GitHub [Issues](https://github.com/src-d/go-git/issues)* for bug reports and feature requests. +- GitHub [Issues](https://github.com/src-d/go-git/issues)\* for bug reports and feature requests. -*Before opening a new issue or submitting a new pull request, it's helpful to +\*Before opening a new issue or submitting a new pull request, it's helpful to search the project - it's likely that another user has already reported the issue you're facing, or it's a known issue that we're already aware of. - ## How to Contribute Pull Requests (PRs) are the main and exclusive way to contribute to the official go-git project. diff --git a/source/vendor/github.com/go-git/go-git/v5/EXTENDING.md b/source/vendor/github.com/go-git/go-git/v5/EXTENDING.md index a2778e34abfaac2cf854125b57015f807ec4591c..3dbf399b072f8625d64260a3f71c99b0d22dc09d 100644 --- a/source/vendor/github.com/go-git/go-git/v5/EXTENDING.md +++ b/source/vendor/github.com/go-git/go-git/v5/EXTENDING.md @@ -69,6 +69,7 @@ Two built-in implementations are `cache.ObjectLRU` and `cache.BufferLRU`. Howeve `go-git` uses the `crypto.Hash` interface to represent hash functions. The built-in implementations are `github.com/pjbgf/sha1cd` for SHA1 and Go's `crypto/SHA256`. The default hash functions can be changed by calling `hash.RegisterHash`. + ```go func init() { hash.RegisterHash(crypto.SHA1, sha1.New) diff --git a/source/vendor/github.com/go-git/go-git/v5/README.md b/source/vendor/github.com/go-git/go-git/v5/README.md index ff0c9b72bae0e2f6d0c7bf81a54dd6da777295cc..07fab95570c7e69371b1f6c8fb7dc8ce54694f4a 100644 --- a/source/vendor/github.com/go-git/go-git/v5/README.md +++ b/source/vendor/github.com/go-git/go-git/v5/README.md @@ -1,44 +1,36 @@  [](https://pkg.go.dev/github.com/go-git/go-git/v5) [](https://github.com/go-git/go-git/actions) [](https://goreportcard.com/report/github.com/go-git/go-git) -*go-git* is a highly extensible git implementation library written in **pure Go**. +_go-git_ is a highly extensible git implementation library written in **pure Go**. -It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations, thanks to the [`Storer`](https://pkg.go.dev/github.com/go-git/go-git/v5/plumbing/storer) interface. +It can be used to manipulate git repositories at low level _(plumbing)_ or high level _(porcelain)_, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations, thanks to the [`Storer`](https://pkg.go.dev/github.com/go-git/go-git/v5/plumbing/storer) interface. It's being actively developed since 2015 and is being used extensively by [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), [Gitea](https://gitea.io/en-us/) or [Pulumi](https://github.com/search?q=org%3Apulumi+go-git&type=Code), and by many other libraries and tools. -Project Status --------------- +## Project Status After the legal issues with the [`src-d`](https://github.com/src-d) organization, the lack of update for four months and the requirement to make a hard fork, the project is **now back to normality**. The project is currently actively maintained by individual contributors, including several of the original authors, but also backed by a new company, [gitsight](https://github.com/gitsight), where `go-git` is a critical component used at scale. +## Comparison with git -Comparison with git -------------------- +_go-git_ aims to be fully compatible with [git](https://github.com/git/git), all the _porcelain_ operations are implemented to work exactly as _git_ does. -*go-git* aims to be fully compatible with [git](https://github.com/git/git), all the *porcelain* operations are implemented to work exactly as *git* does. +_git_ is a humongous project with years of development by thousands of contributors, making it challenging for _go-git_ to implement all the features. You can find a comparison of _go-git_ vs _git_ in the [compatibility documentation](COMPATIBILITY.md). -*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* to implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md). +## Installation - -Installation ------------- - -The recommended way to install *go-git* is: +The recommended way to install _go-git_ is: ```go import "github.com/go-git/go-git/v5" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/go-git/go-git" // with go modules disabled ``` +## Examples -Examples --------- - -> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/go-git/go-git/blob/master/_examples/common.go#L19) just to be used in the examples. - +> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/go-git/go-git/blob/master/_examples/common.go#L19) just to be used in the examples. ### Basic example @@ -57,6 +49,7 @@ CheckIfError(err) ``` Outputs: + ``` Counting objects: 4924, done. Compressing objects: 100% (1333/1333), done. @@ -67,7 +60,6 @@ Total 4924 (delta 530), reused 6 (delta 6), pack-reused 3533 Cloning a repository into memory and printing the history of HEAD, just like `git log` does - ```go // Clones the given repository in memory, creating the remote, the local // branches and fetching the objects, exactly as: @@ -100,6 +92,7 @@ CheckIfError(err) ``` Outputs: + ``` commit ded8054fd0c3994453e9c8aacaf48d118d42991e Author: Santiago M. Mola <santi@mola.io> @@ -120,12 +113,11 @@ Date: Fri Nov 11 13:23:22 2016 +0100 You can find this [example](_examples/log/main.go) and many others in the [examples](_examples) folder. -Contribute ----------- +## Contribute [Contributions](https://github.com/go-git/go-git/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are more than welcome, if you are interested please take a look to our [Contributing Guidelines](CONTRIBUTING.md). -License -------- +## License + Apache License Version 2.0, see [LICENSE](LICENSE) diff --git a/source/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh b/source/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh index 885548f401b2ed868af944993c899df28baf9406..34796c45773bb5421000ec8ae351280240b78f38 100644 --- a/source/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh +++ b/source/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh @@ -15,21 +15,20 @@ # ################################################################################ - go mod download go get github.com/AdamKorcz/go-118-fuzz-build/testing if [ "$SANITIZER" != "coverage" ]; then - sed -i '/func (s \*DecoderSuite) TestDecode(/,/^}/ s/^/\/\//' plumbing/format/config/decoder_test.go - sed -n '35,$p' plumbing/format/packfile/common_test.go >> plumbing/format/packfile/delta_test.go - sed -n '20,53p' plumbing/object/object_test.go >> plumbing/object/tree_test.go - sed -i 's|func Test|// func Test|' plumbing/transport/common_test.go + sed -i '/func (s \*DecoderSuite) TestDecode(/,/^}/ s/^/\/\//' plumbing/format/config/decoder_test.go + sed -n '35,$p' plumbing/format/packfile/common_test.go >>plumbing/format/packfile/delta_test.go + sed -n '20,53p' plumbing/object/object_test.go >>plumbing/object/tree_test.go + sed -i 's|func Test|// func Test|' plumbing/transport/common_test.go fi -compile_native_go_fuzzer $(pwd)/internal/revision FuzzParser fuzz_parser -compile_native_go_fuzzer $(pwd)/plumbing/format/config FuzzDecoder fuzz_decoder_config -compile_native_go_fuzzer $(pwd)/plumbing/format/packfile FuzzPatchDelta fuzz_patch_delta -compile_native_go_fuzzer $(pwd)/plumbing/object FuzzParseSignedBytes fuzz_parse_signed_bytes -compile_native_go_fuzzer $(pwd)/plumbing/object FuzzDecode fuzz_decode -compile_native_go_fuzzer $(pwd)/plumbing/protocol/packp FuzzDecoder fuzz_decoder_packp -compile_native_go_fuzzer $(pwd)/plumbing/transport FuzzNewEndpoint fuzz_new_endpoint +compile_native_go_fuzzer $(pwd)/internal/revision FuzzParser fuzz_parser +compile_native_go_fuzzer $(pwd)/plumbing/format/config FuzzDecoder fuzz_decoder_config +compile_native_go_fuzzer $(pwd)/plumbing/format/packfile FuzzPatchDelta fuzz_patch_delta +compile_native_go_fuzzer $(pwd)/plumbing/object FuzzParseSignedBytes fuzz_parse_signed_bytes +compile_native_go_fuzzer $(pwd)/plumbing/object FuzzDecode fuzz_decode +compile_native_go_fuzzer $(pwd)/plumbing/protocol/packp FuzzDecoder fuzz_decoder_packp +compile_native_go_fuzzer $(pwd)/plumbing/transport FuzzNewEndpoint fuzz_new_endpoint diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go index 3986c8365816949c06bc43a0b1233fc684ac7fd9..6dad4296f8b9b75c105a585d508873b0687bc8f0 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go @@ -1,122 +1,121 @@ // Package config implements encoding and decoding of git config files. // -// Configuration File -// ------------------ -// -// The Git configuration file contains a number of variables that affect -// the Git commands' behavior. The `.git/config` file in each repository -// is used to store the configuration for that repository, and -// `$HOME/.gitconfig` is used to store a per-user configuration as -// fallback values for the `.git/config` file. The file `/etc/gitconfig` -// can be used to store a system-wide default configuration. -// -// The configuration variables are used by both the Git plumbing -// and the porcelains. The variables are divided into sections, wherein -// the fully qualified variable name of the variable itself is the last -// dot-separated segment and the section name is everything before the last -// dot. The variable names are case-insensitive, allow only alphanumeric -// characters and `-`, and must start with an alphabetic character. Some -// variables may appear multiple times; we say then that the variable is -// multivalued. -// -// Syntax -// ~~~~~~ -// -// The syntax is fairly flexible and permissive; whitespaces are mostly -// ignored. The '#' and ';' characters begin comments to the end of line, -// blank lines are ignored. -// -// The file consists of sections and variables. A section begins with -// the name of the section in square brackets and continues until the next -// section begins. Section names are case-insensitive. Only alphanumeric -// characters, `-` and `.` are allowed in section names. Each variable -// must belong to some section, which means that there must be a section -// header before the first setting of a variable. -// -// Sections can be further divided into subsections. To begin a subsection -// put its name in double quotes, separated by space from the section name, -// in the section header, like in the example below: -// -// -------- -// [section "subsection"] -// -// -------- -// -// Subsection names are case sensitive and can contain any characters except -// newline (doublequote `"` and backslash can be included by escaping them -// as `\"` and `\\`, respectively). Section headers cannot span multiple -// lines. Variables may belong directly to a section or to a given subsection. -// You can have `[section]` if you have `[section "subsection"]`, but you -// don't need to. -// -// There is also a deprecated `[section.subsection]` syntax. With this -// syntax, the subsection name is converted to lower-case and is also -// compared case sensitively. These subsection names follow the same -// restrictions as section names. -// -// All the other lines (and the remainder of the line after the section -// header) are recognized as setting variables, in the form -// 'name = value' (or just 'name', which is a short-hand to say that -// the variable is the boolean "true"). -// The variable names are case-insensitive, allow only alphanumeric characters -// and `-`, and must start with an alphabetic character. -// -// A line that defines a value can be continued to the next line by -// ending it with a `\`; the backquote and the end-of-line are -// stripped. Leading whitespaces after 'name =', the remainder of the -// line after the first comment character '#' or ';', and trailing -// whitespaces of the line are discarded unless they are enclosed in -// double quotes. Internal whitespaces within the value are retained -// verbatim. -// -// Inside double quotes, double quote `"` and backslash `\` characters -// must be escaped: use `\"` for `"` and `\\` for `\`. -// -// The following escape sequences (beside `\"` and `\\`) are recognized: -// `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB) -// and `\b` for backspace (BS). Other char escape sequences (including octal -// escape sequences) are invalid. -// -// Includes -// ~~~~~~~~ -// -// You can include one config file from another by setting the special -// `include.path` variable to the name of the file to be included. The -// variable takes a pathname as its value, and is subject to tilde -// expansion. -// -// The included file is expanded immediately, as if its contents had been -// found at the location of the include directive. If the value of the -// `include.path` variable is a relative path, the path is considered to be -// relative to the configuration file in which the include directive was -// found. See below for examples. -// -// -// Example -// ~~~~~~~ -// -// # Core variables -// [core] -// ; Don't trust file modes -// filemode = false -// -// # Our diff algorithm -// [diff] -// external = /usr/local/bin/diff-wrapper -// renames = true -// -// [branch "devel"] -// remote = origin -// merge = refs/heads/devel -// -// # Proxy settings -// [core] -// gitProxy="ssh" for "kernel.org" -// gitProxy=default-proxy ; for the rest -// -// [include] -// path = /path/to/foo.inc ; include by absolute path -// path = foo ; expand "foo" relative to the current file -// path = ~/foo ; expand "foo" in your `$HOME` directory -// +// Configuration File +// ------------------ +// +// The Git configuration file contains a number of variables that affect +// the Git commands' behavior. The `.git/config` file in each repository +// is used to store the configuration for that repository, and +// `$HOME/.gitconfig` is used to store a per-user configuration as +// fallback values for the `.git/config` file. The file `/etc/gitconfig` +// can be used to store a system-wide default configuration. +// +// The configuration variables are used by both the Git plumbing +// and the porcelains. The variables are divided into sections, wherein +// the fully qualified variable name of the variable itself is the last +// dot-separated segment and the section name is everything before the last +// dot. The variable names are case-insensitive, allow only alphanumeric +// characters and `-`, and must start with an alphabetic character. Some +// variables may appear multiple times; we say then that the variable is +// multivalued. +// +// Syntax +// ~~~~~~ +// +// The syntax is fairly flexible and permissive; whitespaces are mostly +// ignored. The '#' and ';' characters begin comments to the end of line, +// blank lines are ignored. +// +// The file consists of sections and variables. A section begins with +// the name of the section in square brackets and continues until the next +// section begins. Section names are case-insensitive. Only alphanumeric +// characters, `-` and `.` are allowed in section names. Each variable +// must belong to some section, which means that there must be a section +// header before the first setting of a variable. +// +// Sections can be further divided into subsections. To begin a subsection +// put its name in double quotes, separated by space from the section name, +// in the section header, like in the example below: +// +// -------- +// [section "subsection"] +// +// -------- +// +// Subsection names are case sensitive and can contain any characters except +// newline (doublequote `"` and backslash can be included by escaping them +// as `\"` and `\\`, respectively). Section headers cannot span multiple +// lines. Variables may belong directly to a section or to a given subsection. +// You can have `[section]` if you have `[section "subsection"]`, but you +// don't need to. +// +// There is also a deprecated `[section.subsection]` syntax. With this +// syntax, the subsection name is converted to lower-case and is also +// compared case sensitively. These subsection names follow the same +// restrictions as section names. +// +// All the other lines (and the remainder of the line after the section +// header) are recognized as setting variables, in the form +// 'name = value' (or just 'name', which is a short-hand to say that +// the variable is the boolean "true"). +// The variable names are case-insensitive, allow only alphanumeric characters +// and `-`, and must start with an alphabetic character. +// +// A line that defines a value can be continued to the next line by +// ending it with a `\`; the backquote and the end-of-line are +// stripped. Leading whitespaces after 'name =', the remainder of the +// line after the first comment character '#' or ';', and trailing +// whitespaces of the line are discarded unless they are enclosed in +// double quotes. Internal whitespaces within the value are retained +// verbatim. +// +// Inside double quotes, double quote `"` and backslash `\` characters +// must be escaped: use `\"` for `"` and `\\` for `\`. +// +// The following escape sequences (beside `\"` and `\\`) are recognized: +// `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB) +// and `\b` for backspace (BS). Other char escape sequences (including octal +// escape sequences) are invalid. +// +// Includes +// ~~~~~~~~ +// +// You can include one config file from another by setting the special +// `include.path` variable to the name of the file to be included. The +// variable takes a pathname as its value, and is subject to tilde +// expansion. +// +// The included file is expanded immediately, as if its contents had been +// found at the location of the include directive. If the value of the +// `include.path` variable is a relative path, the path is considered to be +// relative to the configuration file in which the include directive was +// found. See below for examples. +// +// +// Example +// ~~~~~~~ +// +// # Core variables +// [core] +// ; Don't trust file modes +// filemode = false +// +// # Our diff algorithm +// [diff] +// external = /usr/local/bin/diff-wrapper +// renames = true +// +// [branch "devel"] +// remote = origin +// merge = refs/heads/devel +// +// # Proxy settings +// [core] +// gitProxy="ssh" for "kernel.org" +// gitProxy=default-proxy ; for the rest +// +// [include] +// path = /path/to/foo.inc ; include by absolute path +// path = foo ; expand "foo" relative to the current file +// path = ~/foo ; expand "foo" in your `$HOME` directory package config diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go index de069aed5e78764ce1ebcdf4c522c2afb1a50618..4620dc0a54f2238f27f2534a3066cfe6f31eb11b 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go @@ -13,8 +13,9 @@ type Encoder struct { var ( subsectionReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`) - valueReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`, "\n", `\n`, "\t", `\t`, "\b", `\b`) + valueReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`, "\n", `\n`, "\t", `\t`, "\b", `\b`) ) + // NewEncoder returns a new encoder that writes to w. func NewEncoder(w io.Writer) *Encoder { return &Encoder{w} @@ -63,7 +64,7 @@ func (e *Encoder) encodeOptions(opts Options) error { for _, o := range opts { var value string if strings.ContainsAny(o.Value, "#;\"\t\n\\") || strings.HasPrefix(o.Value, " ") || strings.HasSuffix(o.Value, " ") { - value = `"`+valueReplacer.Replace(o.Value)+`"` + value = `"` + valueReplacer.Replace(o.Value) + `"` } else { value = o.Value } diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go index cad394810a15901d1eb60d5931058ede58326fd4..1e4bd77a7bb17beaf611ccf6ac08594fb765c564 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go @@ -34,7 +34,7 @@ func (opts Options) GoString() string { // Get gets the value for the given key if set, // otherwise it returns the empty string. // -// Note that there is no difference +// # Note that there is no difference // // This matches git behaviour since git v1.8.1-rc1, // if there are multiple definitions of a key, the diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go index 4625ac5837eff8434883109292f3423141efb16d..1f98813d2f048247a20afb4fe8bc358ac7e510df 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go @@ -12,7 +12,7 @@ import ( // put its name in double quotes, separated by space from the section name, // in the section header, like in the example below: // -// [section "subsection"] +// [section "subsection"] // // All the other lines (and the remainder of the line after the section header) // are recognized as option variables, in the form "name = value" (or just name, @@ -20,12 +20,11 @@ import ( // The variable names are case-insensitive, allow only alphanumeric characters // and -, and must start with an alphabetic character: // -// [section "subsection1"] -// option1 = value1 -// option2 -// [section "subsection2"] -// option3 = value2 -// +// [section "subsection1"] +// option1 = value1 +// option2 +// [section "subsection2"] +// option3 = value2 type Section struct { Name string Options Options diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go index eecd4baccb201880711e66989d9947cd34c9cb2f..24d702a50722895fef8984d6a335c7c1bf08565c 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go @@ -3,68 +3,68 @@ // priorities. It support all pattern formats as specified in the original gitignore // documentation, copied below: // -// Pattern format -// ============== +// Pattern format +// ============== // -// - A blank line matches no files, so it can serve as a separator for readability. +// - A blank line matches no files, so it can serve as a separator for readability. // -// - A line starting with # serves as a comment. Put a backslash ("\") in front of -// the first hash for patterns that begin with a hash. +// - A line starting with # serves as a comment. Put a backslash ("\") in front of +// the first hash for patterns that begin with a hash. // -// - Trailing spaces are ignored unless they are quoted with backslash ("\"). +// - Trailing spaces are ignored unless they are quoted with backslash ("\"). // -// - An optional prefix "!" which negates the pattern; any matching file excluded -// by a previous pattern will become included again. It is not possible to -// re-include a file if a parent directory of that file is excluded. -// Git doesn’t list excluded directories for performance reasons, so -// any patterns on contained files have no effect, no matter where they are -// defined. Put a backslash ("\") in front of the first "!" for patterns -// that begin with a literal "!", for example, "\!important!.txt". +// - An optional prefix "!" which negates the pattern; any matching file excluded +// by a previous pattern will become included again. It is not possible to +// re-include a file if a parent directory of that file is excluded. +// Git doesn’t list excluded directories for performance reasons, so +// any patterns on contained files have no effect, no matter where they are +// defined. Put a backslash ("\") in front of the first "!" for patterns +// that begin with a literal "!", for example, "\!important!.txt". // -// - If the pattern ends with a slash, it is removed for the purpose of the -// following description, but it would only find a match with a directory. -// In other words, foo/ will match a directory foo and paths underneath it, -// but will not match a regular file or a symbolic link foo (this is consistent -// with the way how pathspec works in general in Git). +// - If the pattern ends with a slash, it is removed for the purpose of the +// following description, but it would only find a match with a directory. +// In other words, foo/ will match a directory foo and paths underneath it, +// but will not match a regular file or a symbolic link foo (this is consistent +// with the way how pathspec works in general in Git). // -// - If the pattern does not contain a slash /, Git treats it as a shell glob -// pattern and checks for a match against the pathname relative to the location -// of the .gitignore file (relative to the toplevel of the work tree if not -// from a .gitignore file). +// - If the pattern does not contain a slash /, Git treats it as a shell glob +// pattern and checks for a match against the pathname relative to the location +// of the .gitignore file (relative to the toplevel of the work tree if not +// from a .gitignore file). // -// - Otherwise, Git treats the pattern as a shell glob suitable for consumption -// by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will -// not match a / in the pathname. For example, "Documentation/*.html" matches -// "Documentation/git.html" but not "Documentation/ppc/ppc.html" or -// "tools/perf/Documentation/perf.html". +// - Otherwise, Git treats the pattern as a shell glob suitable for consumption +// by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will +// not match a / in the pathname. For example, "Documentation/*.html" matches +// "Documentation/git.html" but not "Documentation/ppc/ppc.html" or +// "tools/perf/Documentation/perf.html". // -// - A leading slash matches the beginning of the pathname. For example, -// "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// - A leading slash matches the beginning of the pathname. For example, +// "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". // -// Two consecutive asterisks ("**") in patterns matched against full pathname -// may have special meaning: +// Two consecutive asterisks ("**") in patterns matched against full pathname +// may have special meaning: // -// - A leading "**" followed by a slash means match in all directories. -// For example, "**/foo" matches file or directory "foo" anywhere, the same as -// pattern "foo". "**/foo/bar" matches file or directory "bar" -// anywhere that is directly under directory "foo". +// - A leading "**" followed by a slash means match in all directories. +// For example, "**/foo" matches file or directory "foo" anywhere, the same as +// pattern "foo". "**/foo/bar" matches file or directory "bar" +// anywhere that is directly under directory "foo". // -// - A trailing "/**" matches everything inside. For example, "abc/**" matches -// all files inside directory "abc", relative to the location of the -// .gitignore file, with infinite depth. +// - A trailing "/**" matches everything inside. For example, "abc/**" matches +// all files inside directory "abc", relative to the location of the +// .gitignore file, with infinite depth. // -// - A slash followed by two consecutive asterisks then a slash matches -// zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", -// "a/x/y/b" and so on. +// - A slash followed by two consecutive asterisks then a slash matches +// zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", +// "a/x/y/b" and so on. // -// - Other consecutive asterisks are considered invalid. +// - Other consecutive asterisks are considered invalid. // -// Copyright and license -// ===================== +// Copyright and license +// ===================== // -// Copyright (c) Oleg Sklyar, Silvertern and source{d} +// Copyright (c) Oleg Sklyar, Silvertern and source{d} // -// The package code was donated to source{d} to include, modify and develop -// further as a part of the `go-git` project, release it on the license of -// the whole project or delete it from the project. +// The package code was donated to source{d} to include, modify and develop +// further as a part of the `go-git` project, release it on the license of +// the whole project or delete it from the project. package gitignore diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go index 1e628ab4a5e600fd9a790ac10052bedf8f21f865..20afeb772f435dce87f0892014f3903f9eb6a774 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go @@ -1,127 +1,127 @@ // Package idxfile implements encoding and decoding of packfile idx files. // -// == Original (version 1) pack-*.idx files have the following format: -// -// - The header consists of 256 4-byte network byte order -// integers. N-th entry of this table records the number of -// objects in the corresponding pack, the first byte of whose -// object name is less than or equal to N. This is called the -// 'first-level fan-out' table. -// -// - The header is followed by sorted 24-byte entries, one entry -// per object in the pack. Each entry is: -// -// 4-byte network byte order integer, recording where the -// object is stored in the packfile as the offset from the -// beginning. -// -// 20-byte object name. -// -// - The file is concluded with a trailer: -// -// A copy of the 20-byte SHA1 checksum at the end of -// corresponding packfile. -// -// 20-byte SHA1-checksum of all of the above. -// -// Pack Idx file: -// -// -- +--------------------------------+ -// fanout | fanout[0] = 2 (for example) |-. -// table +--------------------------------+ | -// | fanout[1] | | -// +--------------------------------+ | -// | fanout[2] | | -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | -// | fanout[255] = total objects |---. -// -- +--------------------------------+ | | -// main | offset | | | -// index | object name 00XXXXXXXXXXXXXXXX | | | -// tab +--------------------------------+ | | -// | offset | | | -// | object name 00XXXXXXXXXXXXXXXX | | | -// +--------------------------------+<+ | -// .-| offset | | -// | | object name 01XXXXXXXXXXXXXXXX | | -// | +--------------------------------+ | -// | | offset | | -// | | object name 01XXXXXXXXXXXXXXXX | | -// | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | -// | | offset | | -// | | object name FFXXXXXXXXXXXXXXXX | | -// --| +--------------------------------+<--+ -// trailer | | packfile checksum | -// | +--------------------------------+ -// | | idxfile checksum | -// | +--------------------------------+ -// .---------. -// | -// Pack file entry: <+ -// -// packed object header: -// 1-byte size extension bit (MSB) -// type (next 3 bit) -// size0 (lower 4-bit) -// n-byte sizeN (as long as MSB is set, each 7-bit) -// size0..sizeN form 4+7+7+..+7 bit integer, size0 -// is the least significant part, and sizeN is the -// most significant part. -// packed object data: -// If it is not DELTA, then deflated bytes (the size above -// is the size before compression). -// If it is REF_DELTA, then -// 20-byte base object name SHA1 (the size above is the -// size of the delta data that follows). -// delta data, deflated. -// If it is OFS_DELTA, then -// n-byte offset (see below) interpreted as a negative -// offset from the type-byte of the header of the -// ofs-delta entry (the size above is the size of -// the delta data that follows). -// delta data, deflated. -// -// offset encoding: -// n bytes with MSB set in all but the last one. -// The offset is then the number constructed by -// concatenating the lower 7 bit of each byte, and -// for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1)) -// to the result. -// -// == Version 2 pack-*.idx files support packs larger than 4 GiB, and -// have some other reorganizations. They have the format: -// -// - A 4-byte magic number '\377tOc' which is an unreasonable -// fanout[0] value. -// -// - A 4-byte version number (= 2) -// -// - A 256-entry fan-out table just like v1. -// -// - A table of sorted 20-byte SHA1 object names. These are -// packed together without offset values to reduce the cache -// footprint of the binary search for a specific object name. -// -// - A table of 4-byte CRC32 values of the packed object data. -// This is new in v2 so compressed data can be copied directly -// from pack to pack during repacking without undetected -// data corruption. -// -// - A table of 4-byte offset values (in network byte order). -// These are usually 31-bit pack file offsets, but large -// offsets are encoded as an index into the next table with -// the msbit set. -// -// - A table of 8-byte offset entries (empty for pack files less -// than 2 GiB). Pack files are organized with heavily used -// objects toward the front, so most object references should -// not need to refer to this table. -// -// - The same trailer as a v1 pack file: -// -// A copy of the 20-byte SHA1 checksum at the end of -// corresponding packfile. -// -// 20-byte SHA1-checksum of all of the above. +// == Original (version 1) pack-*.idx files have the following format: +// +// - The header consists of 256 4-byte network byte order +// integers. N-th entry of this table records the number of +// objects in the corresponding pack, the first byte of whose +// object name is less than or equal to N. This is called the +// 'first-level fan-out' table. +// +// - The header is followed by sorted 24-byte entries, one entry +// per object in the pack. Each entry is: +// +// 4-byte network byte order integer, recording where the +// object is stored in the packfile as the offset from the +// beginning. +// +// 20-byte object name. +// +// - The file is concluded with a trailer: +// +// A copy of the 20-byte SHA1 checksum at the end of +// corresponding packfile. +// +// 20-byte SHA1-checksum of all of the above. +// +// Pack Idx file: +// +// -- +--------------------------------+ +// fanout | fanout[0] = 2 (for example) |-. +// table +--------------------------------+ | +// | fanout[1] | | +// +--------------------------------+ | +// | fanout[2] | | +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | +// | fanout[255] = total objects |---. +// -- +--------------------------------+ | | +// main | offset | | | +// index | object name 00XXXXXXXXXXXXXXXX | | | +// tab +--------------------------------+ | | +// | offset | | | +// | object name 00XXXXXXXXXXXXXXXX | | | +// +--------------------------------+<+ | +// .-| offset | | +// | | object name 01XXXXXXXXXXXXXXXX | | +// | +--------------------------------+ | +// | | offset | | +// | | object name 01XXXXXXXXXXXXXXXX | | +// | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | +// | | offset | | +// | | object name FFXXXXXXXXXXXXXXXX | | +// --| +--------------------------------+<--+ +// trailer | | packfile checksum | +// | +--------------------------------+ +// | | idxfile checksum | +// | +--------------------------------+ +// .---------. +// | +// Pack file entry: <+ +// +// packed object header: +// 1-byte size extension bit (MSB) +// type (next 3 bit) +// size0 (lower 4-bit) +// n-byte sizeN (as long as MSB is set, each 7-bit) +// size0..sizeN form 4+7+7+..+7 bit integer, size0 +// is the least significant part, and sizeN is the +// most significant part. +// packed object data: +// If it is not DELTA, then deflated bytes (the size above +// is the size before compression). +// If it is REF_DELTA, then +// 20-byte base object name SHA1 (the size above is the +// size of the delta data that follows). +// delta data, deflated. +// If it is OFS_DELTA, then +// n-byte offset (see below) interpreted as a negative +// offset from the type-byte of the header of the +// ofs-delta entry (the size above is the size of +// the delta data that follows). +// delta data, deflated. +// +// offset encoding: +// n bytes with MSB set in all but the last one. +// The offset is then the number constructed by +// concatenating the lower 7 bit of each byte, and +// for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1)) +// to the result. +// +// == Version 2 pack-*.idx files support packs larger than 4 GiB, and +// have some other reorganizations. They have the format: +// +// - A 4-byte magic number '\377tOc' which is an unreasonable +// fanout[0] value. +// +// - A 4-byte version number (= 2) +// +// - A 256-entry fan-out table just like v1. +// +// - A table of sorted 20-byte SHA1 object names. These are +// packed together without offset values to reduce the cache +// footprint of the binary search for a specific object name. +// +// - A table of 4-byte CRC32 values of the packed object data. +// This is new in v2 so compressed data can be copied directly +// from pack to pack during repacking without undetected +// data corruption. +// +// - A table of 4-byte offset values (in network byte order). +// These are usually 31-bit pack file offsets, but large +// offsets are encoded as an index into the next table with +// the msbit set. +// +// - A table of 8-byte offset entries (empty for pack files less +// than 2 GiB). Pack files are organized with heavily used +// objects toward the front, so most object references should +// not need to refer to this table. +// +// - The same trailer as a v1 pack file: +// +// A copy of the 20-byte SHA1 checksum at the end of +// corresponding packfile. +// +// 20-byte SHA1-checksum of all of the above. // // Source: // https://www.kernel.org/pub/software/scm/git/docs/v1.7.5/technical/pack-format.txt diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go index 39ae6ad5f91fd2e4436f6c56130b255e805ceb62..26330c899dca81578e3670a5bc145d5cb97200f5 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go @@ -1,360 +1,360 @@ // Package index implements encoding and decoding of index format files. // -// Git index format -// ================ +// Git index format +// ================ // -// == The Git index file has the following format +// == The Git index file has the following format // -// All binary numbers are in network byte order. Version 2 is described -// here unless stated otherwise. +// All binary numbers are in network byte order. Version 2 is described +// here unless stated otherwise. // -// - A 12-byte header consisting of +// - A 12-byte header consisting of // -// 4-byte signature: -// The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache") +// 4-byte signature: +// The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache") // -// 4-byte version number: -// The current supported versions are 2, 3 and 4. +// 4-byte version number: +// The current supported versions are 2, 3 and 4. // -// 32-bit number of index entries. +// 32-bit number of index entries. // -// - A number of sorted index entries (see below). +// - A number of sorted index entries (see below). // -// - Extensions +// - Extensions // -// Extensions are identified by signature. Optional extensions can -// be ignored if Git does not understand them. +// Extensions are identified by signature. Optional extensions can +// be ignored if Git does not understand them. // -// Git currently supports cached tree and resolve undo extensions. +// Git currently supports cached tree and resolve undo extensions. // -// 4-byte extension signature. If the first byte is 'A'..'Z' the -// extension is optional and can be ignored. +// 4-byte extension signature. If the first byte is 'A'..'Z' the +// extension is optional and can be ignored. // -// 32-bit size of the extension +// 32-bit size of the extension // -// Extension data +// Extension data // -// - 160-bit SHA-1 over the content of the index file before this -// checksum. +// - 160-bit SHA-1 over the content of the index file before this +// checksum. // -// == Index entry +// == Index entry // -// Index entries are sorted in ascending order on the name field, -// interpreted as a string of unsigned bytes (i.e. memcmp() order, no -// localization, no special casing of directory separator '/'). Entries -// with the same name are sorted by their stage field. +// Index entries are sorted in ascending order on the name field, +// interpreted as a string of unsigned bytes (i.e. memcmp() order, no +// localization, no special casing of directory separator '/'). Entries +// with the same name are sorted by their stage field. // -// 32-bit ctime seconds, the last time a file's metadata changed -// this is stat(2) data +// 32-bit ctime seconds, the last time a file's metadata changed +// this is stat(2) data // -// 32-bit ctime nanosecond fractions -// this is stat(2) data +// 32-bit ctime nanosecond fractions +// this is stat(2) data // -// 32-bit mtime seconds, the last time a file's data changed -// this is stat(2) data +// 32-bit mtime seconds, the last time a file's data changed +// this is stat(2) data // -// 32-bit mtime nanosecond fractions -// this is stat(2) data +// 32-bit mtime nanosecond fractions +// this is stat(2) data // -// 32-bit dev -// this is stat(2) data +// 32-bit dev +// this is stat(2) data // -// 32-bit ino -// this is stat(2) data +// 32-bit ino +// this is stat(2) data // -// 32-bit mode, split into (high to low bits) +// 32-bit mode, split into (high to low bits) // -// 4-bit object type -// valid values in binary are 1000 (regular file), 1010 (symbolic link) -// and 1110 (gitlink) +// 4-bit object type +// valid values in binary are 1000 (regular file), 1010 (symbolic link) +// and 1110 (gitlink) // -// 3-bit unused +// 3-bit unused // -// 9-bit unix permission. Only 0755 and 0644 are valid for regular files. -// Symbolic links and gitlinks have value 0 in this field. +// 9-bit unix permission. Only 0755 and 0644 are valid for regular files. +// Symbolic links and gitlinks have value 0 in this field. // -// 32-bit uid -// this is stat(2) data +// 32-bit uid +// this is stat(2) data // -// 32-bit gid -// this is stat(2) data +// 32-bit gid +// this is stat(2) data // -// 32-bit file size -// This is the on-disk size from stat(2), truncated to 32-bit. +// 32-bit file size +// This is the on-disk size from stat(2), truncated to 32-bit. // -// 160-bit SHA-1 for the represented object +// 160-bit SHA-1 for the represented object // -// A 16-bit 'flags' field split into (high to low bits) +// A 16-bit 'flags' field split into (high to low bits) // -// 1-bit assume-valid flag +// 1-bit assume-valid flag // -// 1-bit extended flag (must be zero in version 2) +// 1-bit extended flag (must be zero in version 2) // -// 2-bit stage (during merge) +// 2-bit stage (during merge) // -// 12-bit name length if the length is less than 0xFFF; otherwise 0xFFF -// is stored in this field. +// 12-bit name length if the length is less than 0xFFF; otherwise 0xFFF +// is stored in this field. // -// (Version 3 or later) A 16-bit field, only applicable if the -// "extended flag" above is 1, split into (high to low bits). +// (Version 3 or later) A 16-bit field, only applicable if the +// "extended flag" above is 1, split into (high to low bits). // -// 1-bit reserved for future +// 1-bit reserved for future // -// 1-bit skip-worktree flag (used by sparse checkout) +// 1-bit skip-worktree flag (used by sparse checkout) // -// 1-bit intent-to-add flag (used by "git add -N") +// 1-bit intent-to-add flag (used by "git add -N") // -// 13-bit unused, must be zero +// 13-bit unused, must be zero // -// Entry path name (variable length) relative to top level directory -// (without leading slash). '/' is used as path separator. The special -// path components ".", ".." and ".git" (without quotes) are disallowed. -// Trailing slash is also disallowed. +// Entry path name (variable length) relative to top level directory +// (without leading slash). '/' is used as path separator. The special +// path components ".", ".." and ".git" (without quotes) are disallowed. +// Trailing slash is also disallowed. // -// The exact encoding is undefined, but the '.' and '/' characters -// are encoded in 7-bit ASCII and the encoding cannot contain a NUL -// byte (iow, this is a UNIX pathname). +// The exact encoding is undefined, but the '.' and '/' characters +// are encoded in 7-bit ASCII and the encoding cannot contain a NUL +// byte (iow, this is a UNIX pathname). // -// (Version 4) In version 4, the entry path name is prefix-compressed -// relative to the path name for the previous entry (the very first -// entry is encoded as if the path name for the previous entry is an -// empty string). At the beginning of an entry, an integer N in the -// variable width encoding (the same encoding as the offset is encoded -// for OFS_DELTA pack entries; see pack-format.txt) is stored, followed -// by a NUL-terminated string S. Removing N bytes from the end of the -// path name for the previous entry, and replacing it with the string S -// yields the path name for this entry. +// (Version 4) In version 4, the entry path name is prefix-compressed +// relative to the path name for the previous entry (the very first +// entry is encoded as if the path name for the previous entry is an +// empty string). At the beginning of an entry, an integer N in the +// variable width encoding (the same encoding as the offset is encoded +// for OFS_DELTA pack entries; see pack-format.txt) is stored, followed +// by a NUL-terminated string S. Removing N bytes from the end of the +// path name for the previous entry, and replacing it with the string S +// yields the path name for this entry. // -// 1-8 nul bytes as necessary to pad the entry to a multiple of eight bytes -// while keeping the name NUL-terminated. +// 1-8 nul bytes as necessary to pad the entry to a multiple of eight bytes +// while keeping the name NUL-terminated. // -// (Version 4) In version 4, the padding after the pathname does not -// exist. +// (Version 4) In version 4, the padding after the pathname does not +// exist. // -// Interpretation of index entries in split index mode is completely -// different. See below for details. +// Interpretation of index entries in split index mode is completely +// different. See below for details. // -// == Extensions +// == Extensions // -// === Cached tree +// === Cached tree // -// Cached tree extension contains pre-computed hashes for trees that can -// be derived from the index. It helps speed up tree object generation -// from index for a new commit. +// Cached tree extension contains pre-computed hashes for trees that can +// be derived from the index. It helps speed up tree object generation +// from index for a new commit. // -// When a path is updated in index, the path must be invalidated and -// removed from tree cache. +// When a path is updated in index, the path must be invalidated and +// removed from tree cache. // -// The signature for this extension is { 'T', 'R', 'E', 'E' }. +// The signature for this extension is { 'T', 'R', 'E', 'E' }. // -// A series of entries fill the entire extension; each of which -// consists of: +// A series of entries fill the entire extension; each of which +// consists of: // -// - NUL-terminated path component (relative to its parent directory); +// - NUL-terminated path component (relative to its parent directory); // -// - ASCII decimal number of entries in the index that is covered by the -// tree this entry represents (entry_count); +// - ASCII decimal number of entries in the index that is covered by the +// tree this entry represents (entry_count); // -// - A space (ASCII 32); +// - A space (ASCII 32); // -// - ASCII decimal number that represents the number of subtrees this -// tree has; +// - ASCII decimal number that represents the number of subtrees this +// tree has; // -// - A newline (ASCII 10); and +// - A newline (ASCII 10); and // -// - 160-bit object name for the object that would result from writing -// this span of index as a tree. +// - 160-bit object name for the object that would result from writing +// this span of index as a tree. // -// An entry can be in an invalidated state and is represented by having -// a negative number in the entry_count field. In this case, there is no -// object name and the next entry starts immediately after the newline. -// When writing an invalid entry, -1 should always be used as entry_count. +// An entry can be in an invalidated state and is represented by having +// a negative number in the entry_count field. In this case, there is no +// object name and the next entry starts immediately after the newline. +// When writing an invalid entry, -1 should always be used as entry_count. // -// The entries are written out in the top-down, depth-first order. The -// first entry represents the root level of the repository, followed by the -// first subtree--let's call this A--of the root level (with its name -// relative to the root level), followed by the first subtree of A (with -// its name relative to A), ... +// The entries are written out in the top-down, depth-first order. The +// first entry represents the root level of the repository, followed by the +// first subtree--let's call this A--of the root level (with its name +// relative to the root level), followed by the first subtree of A (with +// its name relative to A), ... // -// === Resolve undo +// === Resolve undo // -// A conflict is represented in the index as a set of higher stage entries. -// When a conflict is resolved (e.g. with "git add path"), these higher -// stage entries will be removed and a stage-0 entry with proper resolution -// is added. +// A conflict is represented in the index as a set of higher stage entries. +// When a conflict is resolved (e.g. with "git add path"), these higher +// stage entries will be removed and a stage-0 entry with proper resolution +// is added. // -// When these higher stage entries are removed, they are saved in the -// resolve undo extension, so that conflicts can be recreated (e.g. with -// "git checkout -m"), in case users want to redo a conflict resolution -// from scratch. +// When these higher stage entries are removed, they are saved in the +// resolve undo extension, so that conflicts can be recreated (e.g. with +// "git checkout -m"), in case users want to redo a conflict resolution +// from scratch. // -// The signature for this extension is { 'R', 'E', 'U', 'C' }. +// The signature for this extension is { 'R', 'E', 'U', 'C' }. // -// A series of entries fill the entire extension; each of which -// consists of: +// A series of entries fill the entire extension; each of which +// consists of: // -// - NUL-terminated pathname the entry describes (relative to the root of -// the repository, i.e. full pathname); +// - NUL-terminated pathname the entry describes (relative to the root of +// the repository, i.e. full pathname); // -// - Three NUL-terminated ASCII octal numbers, entry mode of entries in -// stage 1 to 3 (a missing stage is represented by "0" in this field); -// and +// - Three NUL-terminated ASCII octal numbers, entry mode of entries in +// stage 1 to 3 (a missing stage is represented by "0" in this field); +// and // -// - At most three 160-bit object names of the entry in stages from 1 to 3 -// (nothing is written for a missing stage). +// - At most three 160-bit object names of the entry in stages from 1 to 3 +// (nothing is written for a missing stage). // -// === Split index +// === Split index // -// In split index mode, the majority of index entries could be stored -// in a separate file. This extension records the changes to be made on -// top of that to produce the final index. +// In split index mode, the majority of index entries could be stored +// in a separate file. This extension records the changes to be made on +// top of that to produce the final index. // -// The signature for this extension is { 'l', 'i', 'n', 'k' }. +// The signature for this extension is { 'l', 'i', 'n', 'k' }. // -// The extension consists of: +// The extension consists of: // -// - 160-bit SHA-1 of the shared index file. The shared index file path -// is $GIT_DIR/sharedindex.<SHA-1>. If all 160 bits are zero, the -// index does not require a shared index file. +// - 160-bit SHA-1 of the shared index file. The shared index file path +// is $GIT_DIR/sharedindex.<SHA-1>. If all 160 bits are zero, the +// index does not require a shared index file. // -// - An ewah-encoded delete bitmap, each bit represents an entry in the -// shared index. If a bit is set, its corresponding entry in the -// shared index will be removed from the final index. Note, because -// a delete operation changes index entry positions, but we do need -// original positions in replace phase, it's best to just mark -// entries for removal, then do a mass deletion after replacement. +// - An ewah-encoded delete bitmap, each bit represents an entry in the +// shared index. If a bit is set, its corresponding entry in the +// shared index will be removed from the final index. Note, because +// a delete operation changes index entry positions, but we do need +// original positions in replace phase, it's best to just mark +// entries for removal, then do a mass deletion after replacement. // -// - An ewah-encoded replace bitmap, each bit represents an entry in -// the shared index. If a bit is set, its corresponding entry in the -// shared index will be replaced with an entry in this index -// file. All replaced entries are stored in sorted order in this -// index. The first "1" bit in the replace bitmap corresponds to the -// first index entry, the second "1" bit to the second entry and so -// on. Replaced entries may have empty path names to save space. +// - An ewah-encoded replace bitmap, each bit represents an entry in +// the shared index. If a bit is set, its corresponding entry in the +// shared index will be replaced with an entry in this index +// file. All replaced entries are stored in sorted order in this +// index. The first "1" bit in the replace bitmap corresponds to the +// first index entry, the second "1" bit to the second entry and so +// on. Replaced entries may have empty path names to save space. // -// The remaining index entries after replaced ones will be added to the -// final index. These added entries are also sorted by entry name then -// stage. +// The remaining index entries after replaced ones will be added to the +// final index. These added entries are also sorted by entry name then +// stage. // -// == Untracked cache +// == Untracked cache // -// Untracked cache saves the untracked file list and necessary data to -// verify the cache. The signature for this extension is { 'U', 'N', -// 'T', 'R' }. +// Untracked cache saves the untracked file list and necessary data to +// verify the cache. The signature for this extension is { 'U', 'N', +// 'T', 'R' }. // -// The extension starts with +// The extension starts with // -// - A sequence of NUL-terminated strings, preceded by the size of the -// sequence in variable width encoding. Each string describes the -// environment where the cache can be used. +// - A sequence of NUL-terminated strings, preceded by the size of the +// sequence in variable width encoding. Each string describes the +// environment where the cache can be used. // -// - Stat data of $GIT_DIR/info/exclude. See "Index entry" section from -// ctime field until "file size". +// - Stat data of $GIT_DIR/info/exclude. See "Index entry" section from +// ctime field until "file size". // -// - Stat data of plumbing.excludesfile +// - Stat data of plumbing.excludesfile // -// - 32-bit dir_flags (see struct dir_struct) +// - 32-bit dir_flags (see struct dir_struct) // -// - 160-bit SHA-1 of $GIT_DIR/info/exclude. Null SHA-1 means the file -// does not exist. +// - 160-bit SHA-1 of $GIT_DIR/info/exclude. Null SHA-1 means the file +// does not exist. // -// - 160-bit SHA-1 of plumbing.excludesfile. Null SHA-1 means the file does -// not exist. +// - 160-bit SHA-1 of plumbing.excludesfile. Null SHA-1 means the file does +// not exist. // -// - NUL-terminated string of per-dir exclude file name. This usually -// is ".gitignore". +// - NUL-terminated string of per-dir exclude file name. This usually +// is ".gitignore". // -// - The number of following directory blocks, variable width -// encoding. If this number is zero, the extension ends here with a -// following NUL. +// - The number of following directory blocks, variable width +// encoding. If this number is zero, the extension ends here with a +// following NUL. // -// - A number of directory blocks in depth-first-search order, each -// consists of +// - A number of directory blocks in depth-first-search order, each +// consists of // -// - The number of untracked entries, variable width encoding. +// - The number of untracked entries, variable width encoding. // -// - The number of sub-directory blocks, variable width encoding. +// - The number of sub-directory blocks, variable width encoding. // -// - The directory name terminated by NUL. +// - The directory name terminated by NUL. // -// - A number of untracked file/dir names terminated by NUL. +// - A number of untracked file/dir names terminated by NUL. // -// The remaining data of each directory block is grouped by type: +// The remaining data of each directory block is grouped by type: // -// - An ewah bitmap, the n-th bit marks whether the n-th directory has -// valid untracked cache entries. +// - An ewah bitmap, the n-th bit marks whether the n-th directory has +// valid untracked cache entries. // -// - An ewah bitmap, the n-th bit records "check-only" bit of -// read_directory_recursive() for the n-th directory. +// - An ewah bitmap, the n-th bit records "check-only" bit of +// read_directory_recursive() for the n-th directory. // -// - An ewah bitmap, the n-th bit indicates whether SHA-1 and stat data -// is valid for the n-th directory and exists in the next data. +// - An ewah bitmap, the n-th bit indicates whether SHA-1 and stat data +// is valid for the n-th directory and exists in the next data. // -// - An array of stat data. The n-th data corresponds with the n-th -// "one" bit in the previous ewah bitmap. +// - An array of stat data. The n-th data corresponds with the n-th +// "one" bit in the previous ewah bitmap. // -// - An array of SHA-1. The n-th SHA-1 corresponds with the n-th "one" bit -// in the previous ewah bitmap. +// - An array of SHA-1. The n-th SHA-1 corresponds with the n-th "one" bit +// in the previous ewah bitmap. // -// - One NUL. +// - One NUL. // -// == File System Monitor cache +// == File System Monitor cache // -// The file system monitor cache tracks files for which the core.fsmonitor -// hook has told us about changes. The signature for this extension is -// { 'F', 'S', 'M', 'N' }. +// The file system monitor cache tracks files for which the core.fsmonitor +// hook has told us about changes. The signature for this extension is +// { 'F', 'S', 'M', 'N' }. // -// The extension starts with +// The extension starts with // -// - 32-bit version number: the current supported version is 1. +// - 32-bit version number: the current supported version is 1. // -// - 64-bit time: the extension data reflects all changes through the given -// time which is stored as the nanoseconds elapsed since midnight, -// January 1, 1970. +// - 64-bit time: the extension data reflects all changes through the given +// time which is stored as the nanoseconds elapsed since midnight, +// January 1, 1970. // -// - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap. +// - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap. // -// - An ewah bitmap, the n-th bit indicates whether the n-th index entry -// is not CE_FSMONITOR_VALID. +// - An ewah bitmap, the n-th bit indicates whether the n-th index entry +// is not CE_FSMONITOR_VALID. // -// == End of Index Entry +// == End of Index Entry // -// The End of Index Entry (EOIE) is used to locate the end of the variable -// length index entries and the beginning of the extensions. Code can take -// advantage of this to quickly locate the index extensions without having -// to parse through all of the index entries. +// The End of Index Entry (EOIE) is used to locate the end of the variable +// length index entries and the beginning of the extensions. Code can take +// advantage of this to quickly locate the index extensions without having +// to parse through all of the index entries. // -// Because it must be able to be loaded before the variable length cache -// entries and other index extensions, this extension must be written last. -// The signature for this extension is { 'E', 'O', 'I', 'E' }. +// Because it must be able to be loaded before the variable length cache +// entries and other index extensions, this extension must be written last. +// The signature for this extension is { 'E', 'O', 'I', 'E' }. // -// The extension consists of: +// The extension consists of: // -// - 32-bit offset to the end of the index entries +// - 32-bit offset to the end of the index entries // -// - 160-bit SHA-1 over the extension types and their sizes (but not -// their contents). E.g. if we have "TREE" extension that is N-bytes -// long, "REUC" extension that is M-bytes long, followed by "EOIE", -// then the hash would be: +// - 160-bit SHA-1 over the extension types and their sizes (but not +// their contents). E.g. if we have "TREE" extension that is N-bytes +// long, "REUC" extension that is M-bytes long, followed by "EOIE", +// then the hash would be: // -// SHA-1("TREE" + <binary representation of N> + -// "REUC" + <binary representation of M>) +// SHA-1("TREE" + <binary representation of N> + +// "REUC" + <binary representation of M>) // -// == Index Entry Offset Table +// == Index Entry Offset Table // -// The Index Entry Offset Table (IEOT) is used to help address the CPU -// cost of loading the index by enabling multi-threading the process of -// converting cache entries from the on-disk format to the in-memory format. -// The signature for this extension is { 'I', 'E', 'O', 'T' }. +// The Index Entry Offset Table (IEOT) is used to help address the CPU +// cost of loading the index by enabling multi-threading the process of +// converting cache entries from the on-disk format to the in-memory format. +// The signature for this extension is { 'I', 'E', 'O', 'T' }. // -// The extension consists of: +// The extension consists of: // -// - 32-bit version (currently 1) +// - 32-bit version (currently 1) // -// - A number of index offset entries each consisting of: +// - A number of index offset entries each consisting of: // -// - 32-bit offset from the beginning of the file to the first cache entry -// in this block of entries. +// - 32-bit offset from the beginning of the file to the first cache entry +// in this block of entries. // -// - 32-bit count of cache entries in this blockpackage index +// - 32-bit count of cache entries in this blockpackage index package index diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go index f4c7647d343baf3f691f7ac683b94aff5742c170..d4fc431c1fd95ccb5ac9c8765ba001040b7362ea 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go @@ -203,8 +203,8 @@ type ResolveUndoEntry struct { // can take advantage of this to quickly locate the index extensions without // having to parse through all of the index entries. // -// Because it must be able to be loaded before the variable length cache -// entries and other index extensions, this extension must be written last. +// Because it must be able to be loaded before the variable length cache +// entries and other index extensions, this extension must be written last. type EndOfIndexEntry struct { // Offset to the end of the index entries Offset uint32 diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go index 2882a7f378268ec96039ef98e78fea9463d4d26b..bd96a65971829161393305e63ab3cfaa7dda943c 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go @@ -1,38 +1,37 @@ // Package packfile implements encoding and decoding of packfile format. // -// == pack-*.pack files have the following format: +// == pack-*.pack files have the following format: // -// - A header appears at the beginning and consists of the following: +// - A header appears at the beginning and consists of the following: // -// 4-byte signature: -// The signature is: {'P', 'A', 'C', 'K'} +// 4-byte signature: +// The signature is: {'P', 'A', 'C', 'K'} // -// 4-byte version number (network byte order): -// GIT currently accepts version number 2 or 3 but -// generates version 2 only. +// 4-byte version number (network byte order): +// GIT currently accepts version number 2 or 3 but +// generates version 2 only. // -// 4-byte number of objects contained in the pack (network byte order) +// 4-byte number of objects contained in the pack (network byte order) // -// Observation: we cannot have more than 4G versions ;-) and -// more than 4G objects in a pack. +// Observation: we cannot have more than 4G versions ;-) and +// more than 4G objects in a pack. // -// - The header is followed by number of object entries, each of -// which looks like this: +// - The header is followed by number of object entries, each of +// which looks like this: // -// (undeltified representation) -// n-byte type and length (3-bit type, (n-1)*7+4-bit length) -// compressed data +// (undeltified representation) +// n-byte type and length (3-bit type, (n-1)*7+4-bit length) +// compressed data // -// (deltified representation) -// n-byte type and length (3-bit type, (n-1)*7+4-bit length) -// 20-byte base object name -// compressed delta data +// (deltified representation) +// n-byte type and length (3-bit type, (n-1)*7+4-bit length) +// 20-byte base object name +// compressed delta data // -// Observation: length of each object is encoded in a variable -// length format and is not constrained to 32-bit or anything. -// -// - The trailer records 20-byte SHA1 checksum of all of the above. +// Observation: length of each object is encoded in a variable +// length format and is not constrained to 32-bit or anything. // +// - The trailer records 20-byte SHA1 checksum of all of the above. // // Source: // https://www.kernel.org/pub/software/scm/git/docs/v1.7.5/technical/pack-protocol.txt diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go index 13b1e91c9c655777dd711d73d134aee8f18427b5..317b4791ca875447979c5803d46d483fc456c0bd 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go @@ -24,18 +24,18 @@ var ErrUnsupportedObject = errors.New("unsupported object type") // Object is returned when an object can be of any type. It is frequently used // with a type cast to acquire the specific type of object: // -// func process(obj Object) { -// switch o := obj.(type) { -// case *Commit: -// // o is a Commit -// case *Tree: -// // o is a Tree -// case *Blob: -// // o is a Blob -// case *Tag: -// // o is a Tag -// } -// } +// func process(obj Object) { +// switch o := obj.(type) { +// case *Commit: +// // o is a Commit +// case *Tree: +// // o is a Tree +// case *Blob: +// // o is a Blob +// case *Tag: +// // o is a Tag +// } +// } // // This interface is intentionally different from plumbing.EncodedObject, which // is a lower level interface used by storage implementations to read and write diff --git a/source/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go b/source/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go index 8f39b39cbd3261f137ac3e7216b0030df550fb84..969135c74538b91ae291470de726c7e55e3696e6 100644 --- a/source/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go +++ b/source/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go @@ -48,6 +48,7 @@ func NewReferenceUpdateRequest() *ReferenceUpdateRequest { // - ofs-delta // - ref-delta // - delete-refs +// // It leaves up to the user to add the following capabilities later: // - atomic // - ofs-delta diff --git a/source/vendor/github.com/go-git/go-git/v5/utils/binary/read.go b/source/vendor/github.com/go-git/go-git/v5/utils/binary/read.go index b8f9df1a2444a2679238a13a16c33d75c4c9c70c..90995734b47d8d9bcfdbfe366fb164c1981d10af 100644 --- a/source/vendor/github.com/go-git/go-git/v5/utils/binary/read.go +++ b/source/vendor/github.com/go-git/go-git/v5/utils/binary/read.go @@ -80,10 +80,9 @@ func ReadUntilFromBufioReader(r *bufio.Reader, delim byte) ([]byte, error) { // // This is how the offset is saved in C: // -// dheader[pos] = ofs & 127; -// while (ofs >>= 7) -// dheader[--pos] = 128 | (--ofs & 127); -// +// dheader[pos] = ofs & 127; +// while (ofs >>= 7) +// dheader[--pos] = 128 | (--ofs & 127); func ReadVariableWidthInt(r io.Reader) (int64, error) { var c byte if err := Read(r, &c); err != nil { diff --git a/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go b/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go index 131878a1c7ac9a5f610b9589bd8fafc38c54fa52..076a37dd6bf2716b36a1ebc35b1a3a0a63e1ee38 100644 --- a/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go +++ b/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go @@ -42,8 +42,9 @@ func New(n noder.Noder) (*Frame, error) { // separated by comas. // // Examples: -// [] -// ["a", "b"] +// +// [] +// ["a", "b"] func (f *Frame) String() string { var buf bytes.Buffer _ = buf.WriteByte('[') diff --git a/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go b/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go index d75afec46433074928f5bac25b4d879e463bde79..a7fd208d757b446fc8ada0bdfa200135d7b8b551 100644 --- a/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go +++ b/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go @@ -17,15 +17,14 @@ import ( // This is the kind of traversal you will expect when listing ordinary // files and directories recursively, for example: // -// Trie Traversal order -// ---- --------------- -// . -// / | \ c -// / | \ d/ -// d c z ===> d/a -// / \ d/b -// b a z -// +// Trie Traversal order +// ---- --------------- +// . +// / | \ c +// / | \ d/ +// d c z ===> d/a +// / \ d/b +// b a z // // This iterator is somewhat especial as you can chose to skip whole // "directories" when iterating: diff --git a/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go b/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go index 6d22b8c14ece0664708504d46e974bc4886e85b7..d25467dc25697a9f8fce99bd409f4712bbf874b8 100644 --- a/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go +++ b/source/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go @@ -53,7 +53,7 @@ type Noder interface { // implement NumChildren in O(1) while Children is usually more // complex. NumChildren() (int, error) - Skip() bool + Skip() bool } // NoChildren represents the children of a noder without children. diff --git a/source/vendor/github.com/go-git/go-git/v5/worktree_bsd.go b/source/vendor/github.com/go-git/go-git/v5/worktree_bsd.go index d4682eb83beb65f4b066169596b1bd749075c868..d6c72b940dbab47ed9980fa0555acb6640cd556d 100644 --- a/source/vendor/github.com/go-git/go-git/v5/worktree_bsd.go +++ b/source/vendor/github.com/go-git/go-git/v5/worktree_bsd.go @@ -1,3 +1,4 @@ +//go:build darwin || freebsd || netbsd // +build darwin freebsd netbsd package git diff --git a/source/vendor/github.com/go-git/go-git/v5/worktree_js.go b/source/vendor/github.com/go-git/go-git/v5/worktree_js.go index 7267d055e7a49f84b4ccd3b7b2d686d81710f7de..9f3c10f35d51589cabbc38674ee32fdd33b999d1 100644 --- a/source/vendor/github.com/go-git/go-git/v5/worktree_js.go +++ b/source/vendor/github.com/go-git/go-git/v5/worktree_js.go @@ -1,3 +1,4 @@ +//go:build js // +build js package git diff --git a/source/vendor/github.com/go-git/go-git/v5/worktree_linux.go b/source/vendor/github.com/go-git/go-git/v5/worktree_linux.go index 6fcace2f93d8c079a374bb84cb6054331bc286a7..d2e4282328d003be46153f6ec90eb6bc972161cf 100644 --- a/source/vendor/github.com/go-git/go-git/v5/worktree_linux.go +++ b/source/vendor/github.com/go-git/go-git/v5/worktree_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package git diff --git a/source/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go b/source/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go index 5b16e70b70f05c9d152a56faa0e8417b53f28753..00f831ad2d26b91afbd79538cf79f48842c526df 100644 --- a/source/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go +++ b/source/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go @@ -1,3 +1,4 @@ +//go:build openbsd || dragonfly || solaris // +build openbsd dragonfly solaris package git diff --git a/source/vendor/github.com/go-git/go-git/v5/worktree_windows.go b/source/vendor/github.com/go-git/go-git/v5/worktree_windows.go index 1928f9712e95ba754adf6d9a3fb67d91d4baf83a..df7fe5d149b63b33e5f9b20df7719de529bf45f3 100644 --- a/source/vendor/github.com/go-git/go-git/v5/worktree_windows.go +++ b/source/vendor/github.com/go-git/go-git/v5/worktree_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package git diff --git a/source/vendor/github.com/jessevdk/go-flags/README.md b/source/vendor/github.com/jessevdk/go-flags/README.md index f22650b20ad4b3a74f9284277fc97ebc15cf9944..670e72288f927898c308cd5fa4d3297f35c94499 100644 --- a/source/vendor/github.com/jessevdk/go-flags/README.md +++ b/source/vendor/github.com/jessevdk/go-flags/README.md @@ -1,5 +1,4 @@ -go-flags: a go library for parsing command line arguments -========================================================= +# go-flags: a go library for parsing command line arguments [](https://godoc.org/github.com/jessevdk/go-flags) [](https://travis-ci.org/jessevdk/go-flags) [](https://coveralls.io/r/jessevdk/go-flags?branch=master) @@ -13,21 +12,22 @@ but provides more options and uses reflection to provide a convenient and succinct way of specifying command line options. Supported features: -* Options with short names (-v) -* Options with long names (--verbose) -* Options with and without arguments (bool v.s. other type) -* Options with optional arguments and default values -* Multiple option groups each containing a set of options -* Generate and print well-formatted help message -* Passing remaining command line arguments after -- (optional) -* Ignoring unknown command line options (optional) -* Supports -I/usr/include -I=/usr/include -I /usr/include option argument specification -* Supports multiple short options -aux -* Supports all primitive go types (string, int{8..64}, uint{8..64}, float) -* Supports same option multiple times (can store in slice or last option counts) -* Supports maps -* Supports function callbacks -* Supports namespaces for (nested) option groups + +- Options with short names (-v) +- Options with long names (--verbose) +- Options with and without arguments (bool v.s. other type) +- Options with optional arguments and default values +- Multiple option groups each containing a set of options +- Generate and print well-formatted help message +- Passing remaining command line arguments after -- (optional) +- Ignoring unknown command line options (optional) +- Supports -I/usr/include -I=/usr/include -I /usr/include option argument specification +- Supports multiple short options -aux +- Supports all primitive go types (string, int{8..64}, uint{8..64}, float) +- Supports same option multiple times (can store in slice or last option counts) +- Supports maps +- Supports function callbacks +- Supports namespaces for (nested) option groups The flags package uses structs, reflection and struct field tags to allow users to specify command line options. This results in very simple @@ -44,8 +44,8 @@ When either -v or --verbose is found on the command line, a 'true' value will be appended to the Verbose field. e.g. when specifying -vvv, the resulting value of Verbose will be {[true, true, true]}. -Example: --------- +## Example: + ```go var opts struct { // Slice of bool will append 'true' each time the option diff --git a/source/vendor/github.com/jessevdk/go-flags/flags.go b/source/vendor/github.com/jessevdk/go-flags/flags.go index ac2157dd6049867c5b291be746e48c01752854f1..a6acf1be1f3f5a2b2ec26e7434ae67bdf1523e47 100644 --- a/source/vendor/github.com/jessevdk/go-flags/flags.go +++ b/source/vendor/github.com/jessevdk/go-flags/flags.go @@ -8,46 +8,45 @@ The flags package is similar in functionality to the go built-in flag package but provides more options and uses reflection to provide a convenient and succinct way of specifying command line options. - -Supported features +# Supported features The following features are supported in go-flags: - Options with short names (-v) - Options with long names (--verbose) - Options with and without arguments (bool v.s. other type) - Options with optional arguments and default values - Option default values from ENVIRONMENT_VARIABLES, including slice and map values - Multiple option groups each containing a set of options - Generate and print well-formatted help message - Passing remaining command line arguments after -- (optional) - Ignoring unknown command line options (optional) - Supports -I/usr/include -I=/usr/include -I /usr/include option argument specification - Supports multiple short options -aux - Supports all primitive go types (string, int{8..64}, uint{8..64}, float) - Supports same option multiple times (can store in slice or last option counts) - Supports maps - Supports function callbacks - Supports namespaces for (nested) option groups + Options with short names (-v) + Options with long names (--verbose) + Options with and without arguments (bool v.s. other type) + Options with optional arguments and default values + Option default values from ENVIRONMENT_VARIABLES, including slice and map values + Multiple option groups each containing a set of options + Generate and print well-formatted help message + Passing remaining command line arguments after -- (optional) + Ignoring unknown command line options (optional) + Supports -I/usr/include -I=/usr/include -I /usr/include option argument specification + Supports multiple short options -aux + Supports all primitive go types (string, int{8..64}, uint{8..64}, float) + Supports same option multiple times (can store in slice or last option counts) + Supports maps + Supports function callbacks + Supports namespaces for (nested) option groups Additional features specific to Windows: - Options with short names (/v) - Options with long names (/verbose) - Windows-style options with arguments use a colon as the delimiter - Modify generated help message with Windows-style / options - Windows style options can be disabled at build time using the "forceposix" - build tag + Options with short names (/v) + Options with long names (/verbose) + Windows-style options with arguments use a colon as the delimiter + Modify generated help message with Windows-style / options + Windows style options can be disabled at build time using the "forceposix" + build tag -Basic usage +# Basic usage The flags package uses structs, reflection and struct field tags to allow users to specify command line options. This results in very simple and concise specification of your application options. For example: - type Options struct { - Verbose []bool `short:"v" long:"verbose" description:"Show verbose debug information"` - } + type Options struct { + Verbose []bool `short:"v" long:"verbose" description:"Show verbose debug information"` + } This specifies one option with a short name -v and a long name --verbose. When either -v or --verbose is found on the command line, a 'true' value @@ -60,9 +59,9 @@ whenever the option is encountered, a value is appended to the slice. Map options from string to primitive type are also supported. On the command line, you specify the value for such an option as key:value. For example - type Options struct { - AuthorInfo string[string] `short:"a"` - } + type Options struct { + AuthorInfo string[string] `short:"a"` + } Then, the AuthorInfo map can be filled with something like -a name:Jesse -a "surname:van den Kieboom". @@ -71,96 +70,94 @@ Finally, for full control over the conversion between command line argument values and options, user defined types can choose to implement the Marshaler and Unmarshaler interfaces. - -Available field tags +# Available field tags The following is a list of tags for struct fields supported by go-flags: - short: the short name of the option (single character) - long: the long name of the option - required: if non empty, makes the option required to appear on the command - line. If a required option is not present, the parser will - return ErrRequired (optional) - description: the description of the option (optional) - long-description: the long description of the option. Currently only - displayed in generated man pages (optional) - no-flag: if non-empty, this field is ignored as an option (optional) - - optional: if non-empty, makes the argument of the option optional. When an - argument is optional it can only be specified using - --option=argument (optional) - optional-value: the value of an optional option when the option occurs - without an argument. This tag can be specified multiple - times in the case of maps or slices (optional) - default: the default value of an option. This tag can be specified - multiple times in the case of slices or maps (optional) - default-mask: when specified, this value will be displayed in the help - instead of the actual default value. This is useful - mostly for hiding otherwise sensitive information from - showing up in the help. If default-mask takes the special - value "-", then no default value will be shown at all - (optional) - env: the default value of the option is overridden from the - specified environment variable, if one has been defined. - (optional) - env-delim: the 'env' default value from environment is split into - multiple values with the given delimiter string, use with - slices and maps (optional) - value-name: the name of the argument value (to be shown in the help) - (optional) - choice: limits the values for an option to a set of values. - Repeat this tag once for each allowable value. - e.g. `long:"animal" choice:"cat" choice:"dog"` - hidden: if non-empty, the option is not visible in the help or man page. - - base: a base (radix) used to convert strings to integer values, the - default base is 10 (i.e. decimal) (optional) - - ini-name: the explicit ini option name (optional) - no-ini: if non-empty this field is ignored as an ini option - (optional) - - group: when specified on a struct field, makes the struct - field a separate group with the given name (optional) - namespace: when specified on a group struct field, the namespace - gets prepended to every option's long name and - subgroup's namespace of this group, separated by - the parser's namespace delimiter (optional) - env-namespace: when specified on a group struct field, the env-namespace - gets prepended to every option's env key and - subgroup's env-namespace of this group, separated by - the parser's env-namespace delimiter (optional) - command: when specified on a struct field, makes the struct - field a (sub)command with the given name (optional) - subcommands-optional: when specified on a command struct field, makes - any subcommands of that command optional (optional) - alias: when specified on a command struct field, adds the - specified name as an alias for the command. Can be - be specified multiple times to add more than one - alias (optional) - positional-args: when specified on a field with a struct type, - uses the fields of that struct to parse remaining - positional command line arguments into (in order - of the fields). If a field has a slice type, - then all remaining arguments will be added to it. - Positional arguments are optional by default, - unless the "required" tag is specified together - with the "positional-args" tag. The "required" tag - can also be set on the individual rest argument - fields, to require only the first N positional - arguments. If the "required" tag is set on the - rest arguments slice, then its value determines - the minimum amount of rest arguments that needs to - be provided (e.g. `required:"2"`) (optional) - positional-arg-name: used on a field in a positional argument struct; name - of the positional argument placeholder to be shown in - the help (optional) + short: the short name of the option (single character) + long: the long name of the option + required: if non empty, makes the option required to appear on the command + line. If a required option is not present, the parser will + return ErrRequired (optional) + description: the description of the option (optional) + long-description: the long description of the option. Currently only + displayed in generated man pages (optional) + no-flag: if non-empty, this field is ignored as an option (optional) + + optional: if non-empty, makes the argument of the option optional. When an + argument is optional it can only be specified using + --option=argument (optional) + optional-value: the value of an optional option when the option occurs + without an argument. This tag can be specified multiple + times in the case of maps or slices (optional) + default: the default value of an option. This tag can be specified + multiple times in the case of slices or maps (optional) + default-mask: when specified, this value will be displayed in the help + instead of the actual default value. This is useful + mostly for hiding otherwise sensitive information from + showing up in the help. If default-mask takes the special + value "-", then no default value will be shown at all + (optional) + env: the default value of the option is overridden from the + specified environment variable, if one has been defined. + (optional) + env-delim: the 'env' default value from environment is split into + multiple values with the given delimiter string, use with + slices and maps (optional) + value-name: the name of the argument value (to be shown in the help) + (optional) + choice: limits the values for an option to a set of values. + Repeat this tag once for each allowable value. + e.g. `long:"animal" choice:"cat" choice:"dog"` + hidden: if non-empty, the option is not visible in the help or man page. + + base: a base (radix) used to convert strings to integer values, the + default base is 10 (i.e. decimal) (optional) + + ini-name: the explicit ini option name (optional) + no-ini: if non-empty this field is ignored as an ini option + (optional) + + group: when specified on a struct field, makes the struct + field a separate group with the given name (optional) + namespace: when specified on a group struct field, the namespace + gets prepended to every option's long name and + subgroup's namespace of this group, separated by + the parser's namespace delimiter (optional) + env-namespace: when specified on a group struct field, the env-namespace + gets prepended to every option's env key and + subgroup's env-namespace of this group, separated by + the parser's env-namespace delimiter (optional) + command: when specified on a struct field, makes the struct + field a (sub)command with the given name (optional) + subcommands-optional: when specified on a command struct field, makes + any subcommands of that command optional (optional) + alias: when specified on a command struct field, adds the + specified name as an alias for the command. Can be + be specified multiple times to add more than one + alias (optional) + positional-args: when specified on a field with a struct type, + uses the fields of that struct to parse remaining + positional command line arguments into (in order + of the fields). If a field has a slice type, + then all remaining arguments will be added to it. + Positional arguments are optional by default, + unless the "required" tag is specified together + with the "positional-args" tag. The "required" tag + can also be set on the individual rest argument + fields, to require only the first N positional + arguments. If the "required" tag is set on the + rest arguments slice, then its value determines + the minimum amount of rest arguments that needs to + be provided (e.g. `required:"2"`) (optional) + positional-arg-name: used on a field in a positional argument struct; name + of the positional argument placeholder to be shown in + the help (optional) Either the `short:` tag or the `long:` must be specified to make the field eligible as an option. - -Option groups +# Option groups Option groups are a simple way to semantically separate your options. All options in a particular group are shown together in the help under the name @@ -169,14 +166,12 @@ precisely and emphasize the options affiliation to their group. There are currently three ways to specify option groups. - 1. Use NewNamedParser specifying the various option groups. - 2. Use AddGroup to add a group to an existing parser. - 3. Add a struct field to the top-level options annotated with the - group:"group-name" tag. + 1. Use NewNamedParser specifying the various option groups. + 2. Use AddGroup to add a group to an existing parser. + 3. Add a struct field to the top-level options annotated with the + group:"group-name" tag. - - -Commands +# Commands The flags package also has basic support for commands. Commands are often used in monolithic applications that support various commands or actions. @@ -186,9 +181,9 @@ application. There are currently two ways to specify a command. - 1. Use AddCommand on an existing parser. - 2. Add a struct field to your options struct annotated with the - command:"command-name" tag. + 1. Use AddCommand on an existing parser. + 2. Add a struct field to your options struct annotated with the + command:"command-name" tag. The most common, idiomatic way to implement commands is to define a global parser instance and implement each command in a separate file. These @@ -204,15 +199,14 @@ command has been specified on the command line, in addition to the options of all the parent commands. I.e. considering a -v flag on the parser and an add command, the following are equivalent: - ./app -v add - ./app add -v + ./app -v add + ./app add -v However, if the -v flag is defined on the add command, then the first of the two examples above would fail since the -v flag is not defined before the add command. - -Completion +# Completion go-flags has builtin support to provide bash completion of flags, commands and argument values. To use completion, the binary which uses go-flags @@ -226,7 +220,7 @@ by replacing the argument parsing routine with the completion routine which outputs completions for the passed arguments. The basic invocation to complete a set of arguments is therefore: - GO_FLAGS_COMPLETION=1 ./completion-example arg1 arg2 arg3 + GO_FLAGS_COMPLETION=1 ./completion-example arg1 arg2 arg3 where `completion-example` is the binary, `arg1` and `arg2` are the current arguments, and `arg3` (the last argument) is the argument @@ -237,20 +231,20 @@ are more than 1 completion items. To use this with bash completion, a simple file can be written which calls the binary which supports go-flags completion: - _completion_example() { - # All arguments except the first one - args=("${COMP_WORDS[@]:1:$COMP_CWORD}") + _completion_example() { + # All arguments except the first one + args=("${COMP_WORDS[@]:1:$COMP_CWORD}") - # Only split on newlines - local IFS=$'\n' + # Only split on newlines + local IFS=$'\n' - # Call completion (note that the first element of COMP_WORDS is - # the executable itself) - COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}")) - return 0 - } + # Call completion (note that the first element of COMP_WORDS is + # the executable itself) + COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}")) + return 0 + } - complete -F _completion_example completion-example + complete -F _completion_example completion-example Completion requires the parser option PassDoubleDash and is therefore enforced if the environment variable GO_FLAGS_COMPLETION is set. diff --git a/source/vendor/github.com/jessevdk/go-flags/ini.go b/source/vendor/github.com/jessevdk/go-flags/ini.go index 60b36c79c44d76aa7ca7affb541f80082cfd9bb6..9c721ec77aff5d2a31e769b8cb53c39a7556d56c 100644 --- a/source/vendor/github.com/jessevdk/go-flags/ini.go +++ b/source/vendor/github.com/jessevdk/go-flags/ini.go @@ -113,18 +113,18 @@ func (i *IniParser) ParseFile(filename string) error { // // The format of the ini file is as follows: // -// [Option group name] -// option = value +// [Option group name] +// option = value // // Each section in the ini file represents an option group or command in the // flags parser. The default flags parser option group (i.e. when using // flags.Parse) is named 'Application Options'. The ini option name is matched // in the following order: // -// 1. Compared to the ini-name tag on the option struct field (if present) -// 2. Compared to the struct field name -// 3. Compared to the option long name (if present) -// 4. Compared to the option short name (if present) +// 1. Compared to the ini-name tag on the option struct field (if present) +// 2. Compared to the struct field name +// 3. Compared to the option long name (if present) +// 4. Compared to the option short name (if present) // // Sections for nested groups and commands can be addressed using a dot `.' // namespacing notation (i.e [subcommand.Options]). Group section names are diff --git a/source/vendor/github.com/jessevdk/go-flags/optstyle_other.go b/source/vendor/github.com/jessevdk/go-flags/optstyle_other.go index 56dfdae128600ae69f9d61419a043a784afc0f21..f84b69746d3b7523e9946c598c0a9c64f3d82ba6 100644 --- a/source/vendor/github.com/jessevdk/go-flags/optstyle_other.go +++ b/source/vendor/github.com/jessevdk/go-flags/optstyle_other.go @@ -1,3 +1,4 @@ +//go:build !windows || forceposix // +build !windows forceposix package flags diff --git a/source/vendor/github.com/jessevdk/go-flags/optstyle_windows.go b/source/vendor/github.com/jessevdk/go-flags/optstyle_windows.go index f3f28aeeff4b3d598f672c99c8fe8707f3c9acad..e80290420ace01716b2103956fd07c8f5f3afaf4 100644 --- a/source/vendor/github.com/jessevdk/go-flags/optstyle_windows.go +++ b/source/vendor/github.com/jessevdk/go-flags/optstyle_windows.go @@ -1,3 +1,4 @@ +//go:build !forceposix // +build !forceposix package flags diff --git a/source/vendor/github.com/jessevdk/go-flags/termsize.go b/source/vendor/github.com/jessevdk/go-flags/termsize.go index 829e477addfb5f915d12a48290019f0ea8a12391..91582e4c72d6c82e49915bfc7ee504728801f2fa 100644 --- a/source/vendor/github.com/jessevdk/go-flags/termsize.go +++ b/source/vendor/github.com/jessevdk/go-flags/termsize.go @@ -1,3 +1,4 @@ +//go:build !windows && !plan9 && !appengine && !wasm // +build !windows,!plan9,!appengine,!wasm package flags diff --git a/source/vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go b/source/vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go index c1ff18673b1e807cce7540d7d0accad1adf340e8..9b51b72ec3b0a4398b88b0bb21477a7a96bd6224 100644 --- a/source/vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go +++ b/source/vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go @@ -1,3 +1,4 @@ +//go:build plan9 || appengine || wasm // +build plan9 appengine wasm package flags diff --git a/source/vendor/github.com/jessevdk/go-flags/termsize_windows.go b/source/vendor/github.com/jessevdk/go-flags/termsize_windows.go index 5c0fa6ba2720c07048292f742b82913b206e1d19..189a1b3fafef432db14a2994587f54168ebfba74 100644 --- a/source/vendor/github.com/jessevdk/go-flags/termsize_windows.go +++ b/source/vendor/github.com/jessevdk/go-flags/termsize_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package flags diff --git a/source/vendor/github.com/kevinburke/ssh_config/CHANGELOG.md b/source/vendor/github.com/kevinburke/ssh_config/CHANGELOG.md index d32a3f5106c38e17d1a5a58f14e8a2b025a54ef3..d6f6613d78785effe9f20b2ea1236181611e79f5 100644 --- a/source/vendor/github.com/kevinburke/ssh_config/CHANGELOG.md +++ b/source/vendor/github.com/kevinburke/ssh_config/CHANGELOG.md @@ -12,7 +12,7 @@ Host example # A comment ``` Prior to version 1.2, the value for Host would have been "example " and the -value for HostName would have been "example.com ". Both of these are +value for HostName would have been "example.com ". Both of these are unintuitive. Instead, we strip the trailing whitespace in the configuration, which leads to diff --git a/source/vendor/github.com/kevinburke/ssh_config/config.go b/source/vendor/github.com/kevinburke/ssh_config/config.go index 00d815c1a9229ea3b06b37e206016b60d3d24921..fc307ba147a6d3c1ff4edaacadfaacd4cb9745cc 100644 --- a/source/vendor/github.com/kevinburke/ssh_config/config.go +++ b/source/vendor/github.com/kevinburke/ssh_config/config.go @@ -8,7 +8,7 @@ // the host name to match on ("example.com"), and the second argument is the key // you want to retrieve ("Port"). The keywords are case insensitive. // -// port := ssh_config.Get("myhost", "Port") +// port := ssh_config.Get("myhost", "Port") // // You can also manipulate an SSH config file and then print it or write it back // to disk. diff --git a/source/vendor/github.com/pjbgf/sha1cd/README.md b/source/vendor/github.com/pjbgf/sha1cd/README.md index 378cf78cf7d6a754d98bb64c59fd4e023a8a3f9b..f4fd5530f581428db291c57ff5d6ef136a4b2b48 100644 --- a/source/vendor/github.com/pjbgf/sha1cd/README.md +++ b/source/vendor/github.com/pjbgf/sha1cd/README.md @@ -1,7 +1,7 @@ # sha1cd A Go implementation of SHA1 with counter-cryptanalysis, which detects -collision attacks. +collision attacks. The `cgo/lib` code is a carbon copy of the [original code], based on the award winning [white paper] by Marc Stevens. @@ -39,18 +39,20 @@ func test(){ } ``` -Note that the algorithm will automatically avoid collision, by +Note that the algorithm will automatically avoid collision, by extending the SHA1 to 240-steps, instead of 80 when a collision attempt is detected. Therefore, inputs that contains the unavoidable bit conditions will yield a different hash from `sha1cd`, when compared with results using `crypto/sha1`. Valid inputs will have matching the outputs. ## References + - https://shattered.io/ - https://github.com/cr-marcstevens/sha1collisiondetection - https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Secure-Hashing#shavs ## Use of the Original Implementation + - https://github.com/git/git/commit/28dc98e343ca4eb370a29ceec4c19beac9b5c01e - https://github.com/libgit2/libgit2/pull/4136 diff --git a/source/vendor/github.com/skeema/knownhosts/README.md b/source/vendor/github.com/skeema/knownhosts/README.md index 36b847614ca5d24058512c0efd254c995951d25a..41bfe34a6bfe106061afc8068f0cb864b5a28a5e 100644 --- a/source/vendor/github.com/skeema/knownhosts/README.md +++ b/source/vendor/github.com/skeema/knownhosts/README.md @@ -3,23 +3,22 @@ [](https://github.com/skeema/knownhosts/actions) [](https://pkg.go.dev/github.com/skeema/knownhosts) - > This repo is brought to you by [Skeema](https://github.com/skeema/skeema), a > declarative pure-SQL schema management system for MySQL and MariaDB. Our > premium products include extensive [SSH tunnel](https://www.skeema.io/docs/options/#ssh) > functionality, which internally makes use of this package. Go provides excellent functionality for OpenSSH known_hosts files in its -external package [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts). +external package [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts). However, that package is somewhat low-level, making it difficult to implement full known_hosts management similar to command-line `ssh`'s behavior for `StrictHostKeyChecking=no` configuration. This repo ([github.com/skeema/knownhosts](https://github.com/skeema/knownhosts)) is a thin wrapper package around [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts), adding the following functionality: -* Look up known_hosts public keys for any given host -* Auto-populate ssh.ClientConfig.HostKeyAlgorithms easily based on known_hosts, providing a solution for [golang/go#29286](https://github.com/golang/go/issues/29286) -* Write new known_hosts entries to an io.Writer -* Properly format/normalize new known_hosts entries containing ipv6 addresses, providing a solution for [golang/go#53463](https://github.com/golang/go/issues/53463) -* Determine if an ssh.HostKeyCallback's error corresponds to a host whose key has changed (indicating potential MitM attack) vs a host that just isn't known yet +- Look up known_hosts public keys for any given host +- Auto-populate ssh.ClientConfig.HostKeyAlgorithms easily based on known_hosts, providing a solution for [golang/go#29286](https://github.com/golang/go/issues/29286) +- Write new known_hosts entries to an io.Writer +- Properly format/normalize new known_hosts entries containing ipv6 addresses, providing a solution for [golang/go#53463](https://github.com/golang/go/issues/53463) +- Determine if an ssh.HostKeyCallback's error corresponds to a host whose key has changed (indicating potential MitM attack) vs a host that just isn't known yet ## How host key lookup works @@ -29,7 +28,7 @@ By using this technique, [github.com/skeema/knownhosts](https://github.com/skeem ## Populating ssh.ClientConfig.HostKeyAlgorithms based on known_hosts -Hosts often have multiple public keys, each of a different type (algorithm). This can be [problematic](https://github.com/golang/go/issues/29286) in [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts): if a host's first public key is *not* in known_hosts, but a key of a different type *is*, the HostKeyCallback returns an error. The solution is to populate `ssh.ClientConfig.HostKeyAlgorithms` based on the algorithms of the known_hosts entries for that host, but +Hosts often have multiple public keys, each of a different type (algorithm). This can be [problematic](https://github.com/golang/go/issues/29286) in [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts): if a host's first public key is _not_ in known_hosts, but a key of a different type _is_, the HostKeyCallback returns an error. The solution is to populate `ssh.ClientConfig.HostKeyAlgorithms` based on the algorithms of the known_hosts entries for that host, but [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts) does not provide an obvious way to do so. diff --git a/source/vendor/github.com/tidwall/gjson/README.md b/source/vendor/github.com/tidwall/gjson/README.md index 96b2e4dc33033260a93d2b765255eb72561cfd4f..e05b68a123344eaf38e75e015d8d923fd8383e1d 100644 --- a/source/vendor/github.com/tidwall/gjson/README.md +++ b/source/vendor/github.com/tidwall/gjson/README.md @@ -20,8 +20,7 @@ This README is a quick overview of how to use GJSON, for more information check GJSON is also available for [Python](https://github.com/volans-/gjson-py) and [Rust](https://github.com/tidwall/gjson.rs) -Getting Started -=============== +# Getting Started ## Installing @@ -34,7 +33,8 @@ $ go get -u github.com/tidwall/gjson This will retrieve the library. ## Get a value -Get searches json for the specified path. A path is in dot syntax, such as "name.last" or "age". When the value is found it's returned immediately. + +Get searches json for the specified path. A path is in dot syntax, such as "name.last" or "age". When the value is found it's returned immediately. ```go package main @@ -54,7 +54,8 @@ This will print: ``` Prichard ``` -*There's also the [GetMany](#get-multiple-values-at-once) function to get multiple values at once, and [GetBytes](#working-with-bytes) for working with JSON byte slices.* + +_There's also the [GetMany](#get-multiple-values-at-once) function to get multiple values at once, and [GetBytes](#working-with-bytes) for working with JSON byte slices._ ## Path Syntax @@ -69,17 +70,23 @@ The dot and wildcard characters can be escaped with '\\'. ```json { - "name": {"first": "Tom", "last": "Anderson"}, - "age":37, - "children": ["Sara","Alex","Jack"], + "name": { "first": "Tom", "last": "Anderson" }, + "age": 37, + "children": ["Sara", "Alex", "Jack"], "fav.movie": "Deer Hunter", "friends": [ - {"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]}, - {"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]}, - {"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]} + { + "first": "Dale", + "last": "Murphy", + "age": 44, + "nets": ["ig", "fb", "tw"] + }, + { "first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"] }, + { "first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"] } ] } ``` + ``` "name.last" >> "Anderson" "age" >> 37 @@ -93,9 +100,9 @@ The dot and wildcard characters can be escaped with '\\'. "friends.1.last" >> "Craig" ``` -You can also query an array for the first match by using `#(...)`, or find all -matches with `#(...)#`. Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` -comparison operators and the simple pattern matching `%` (like) and `!%` +You can also query an array for the first match by using `#(...)`, or find all +matches with `#(...)#`. Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` +comparison operators and the simple pattern matching `%` (like) and `!%` (not like) operators. ``` @@ -107,15 +114,15 @@ friends.#(first!%"D*").last >> "Craig" friends.#(nets.#(=="fb"))#.first >> ["Dale","Roger"] ``` -*Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was +_Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was changed in v1.3.0 as to avoid confusion with the new -[multipath](SYNTAX.md#multipaths) syntax. For backwards compatibility, -`#[...]` will continue to work until the next major release.* +[multipath](SYNTAX.md#multipaths) syntax. For backwards compatibility, +`#[...]` will continue to work until the next major release._ ## Result Type -GJSON supports the json types `string`, `number`, `bool`, and `null`. -Arrays and Objects are returned as their raw json types. +GJSON supports the json types `string`, `number`, `bool`, and `null`. +Arrays and Objects are returned as their raw json types. The `Result` type holds one of these: @@ -179,14 +186,14 @@ result.Int() int64 // -9223372036854775808 to 9223372036854775807 result.Uint() uint64 // 0 to 18446744073709551615 ``` -## Modifiers and path chaining +## Modifiers and path chaining New in version 1.2 is support for modifier functions and path chaining. -A modifier is a path component that performs custom processing on the +A modifier is a path component that performs custom processing on the json. -Multiple paths can be "chained" together using the pipe character. +Multiple paths can be "chained" together using the pipe character. This is useful for getting results from a modified query. For example, using the built-in `@reverse` modifier on the above json document, @@ -215,33 +222,33 @@ There are currently the following built-in modifiers: ### Modifier arguments -A modifier may accept an optional argument. The argument can be a valid JSON +A modifier may accept an optional argument. The argument can be a valid JSON document or just characters. -For example, the `@pretty` modifier takes a json object as its argument. +For example, the `@pretty` modifier takes a json object as its argument. ``` -@pretty:{"sortKeys":true} +@pretty:{"sortKeys":true} ``` Which makes the json pretty and orders all of its keys. ```json { - "age":37, - "children": ["Sara","Alex","Jack"], + "age": 37, + "children": ["Sara", "Alex", "Jack"], "fav.movie": "Deer Hunter", "friends": [ - {"age": 44, "first": "Dale", "last": "Murphy"}, - {"age": 68, "first": "Roger", "last": "Craig"}, - {"age": 47, "first": "Jane", "last": "Murphy"} + { "age": 44, "first": "Dale", "last": "Murphy" }, + { "age": 68, "first": "Roger", "last": "Craig" }, + { "age": 47, "first": "Jane", "last": "Murphy" } ], - "name": {"first": "Tom", "last": "Anderson"} + "name": { "first": "Tom", "last": "Anderson" } } ``` -*The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`. -Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information.* +_The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`. +Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information._ ### Custom modifiers @@ -269,7 +276,7 @@ gjson.AddModifier("case", func(json, arg string) string { ## JSON Lines -There's support for [JSON Lines](http://jsonlines.org/) using the `..` prefix, which treats a multilined document as an array. +There's support for [JSON Lines](http://jsonlines.org/) using the `..` prefix, which treats a multilined document as an array. For example: @@ -305,14 +312,16 @@ Suppose you want all the last names from the following json: { "programmers": [ { - "firstName": "Janet", - "lastName": "McLaughlin", - }, { - "firstName": "Elliotte", - "lastName": "Hunter", - }, { - "firstName": "Jason", - "lastName": "Harold", + "firstName": "Janet", + "lastName": "McLaughlin" + }, + { + "firstName": "Elliotte", + "lastName": "Hunter" + }, + { + "firstName": "Jason", + "lastName": "Harold" } ] } @@ -336,7 +345,7 @@ println(name.String()) // prints "Elliotte" ## Iterate through an object or array -The `ForEach` function allows for quickly iterating through an object or array. +The `ForEach` function allows for quickly iterating through an object or array. The key and value are passed to the iterator function for objects. Only the value is passed for arrays. Returning `false` from an iterator will stop iteration. @@ -344,7 +353,7 @@ Returning `false` from an iterator will stop iteration. ```go result := gjson.Get(json, "programmers") result.ForEach(func(key, value gjson.Result) bool { - println(value.String()) + println(value.String()) return true // keep iterating }) ``` @@ -363,7 +372,7 @@ gjson.Get(json, "name.last") ## Check for the existence of a value -Sometimes you just want to know if a value exists. +Sometimes you just want to know if a value exists. ```go value := gjson.Get(json, "name.last") @@ -429,8 +438,8 @@ This is a best-effort no allocation sub slice of the original json. This method ## Performance -Benchmarks of GJSON alongside [encoding/json](https://golang.org/pkg/encoding/json/), -[ffjson](https://github.com/pquerna/ffjson), +Benchmarks of GJSON alongside [encoding/json](https://golang.org/pkg/encoding/json/), +[ffjson](https://github.com/pquerna/ffjson), [EasyJSON](https://github.com/mailru/easyjson), [jsonparser](https://github.com/buger/jsonparser), and [json-iterator](https://github.com/json-iterator/go) @@ -459,7 +468,7 @@ JSON document used: "width": 500, "height": 500 }, - "image": { + "image": { "src": "Images/Sun.png", "hOffset": 250, "vOffset": 250, @@ -474,7 +483,7 @@ JSON document used: "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" } } -} +} ``` Each operation was rotated through one of the following search paths: @@ -485,4 +494,4 @@ widget.image.hOffset widget.text.onMouseUp ``` -*These benchmarks were run on a MacBook Pro 16" 2.4 GHz Intel Core i9 using Go 1.17 and can be found [here](https://github.com/tidwall/gjson-benchmarks).* +_These benchmarks were run on a MacBook Pro 16" 2.4 GHz Intel Core i9 using Go 1.17 and can be found [here](https://github.com/tidwall/gjson-benchmarks)._ diff --git a/source/vendor/github.com/tidwall/gjson/SYNTAX.md b/source/vendor/github.com/tidwall/gjson/SYNTAX.md index 6721d7f51434c279e257dde584224d16bb4f211d..f7e03e8e5817f6834fe47b1d1971f648ce6a0697 100644 --- a/source/vendor/github.com/tidwall/gjson/SYNTAX.md +++ b/source/vendor/github.com/tidwall/gjson/SYNTAX.md @@ -20,7 +20,7 @@ Use the [GJSON Playground](https://gjson.dev) to experiment with the syntax onli ## Path structure -A GJSON Path is intended to be easily expressed as a series of components seperated by a `.` character. +A GJSON Path is intended to be easily expressed as a series of components seperated by a `.` character. Along with `.` character, there are a few more that have special meaning, including `|`, `#`, `@`, `\`, `*`, `!`, and `?`. @@ -30,21 +30,26 @@ Given this JSON ```json { - "name": {"first": "Tom", "last": "Anderson"}, - "age":37, - "children": ["Sara","Alex","Jack"], + "name": { "first": "Tom", "last": "Anderson" }, + "age": 37, + "children": ["Sara", "Alex", "Jack"], "fav.movie": "Deer Hunter", "friends": [ - {"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]}, - {"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]}, - {"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]} + { + "first": "Dale", + "last": "Murphy", + "age": 44, + "nets": ["ig", "fb", "tw"] + }, + { "first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"] }, + { "first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"] } ] } ``` The following GJSON Paths evaluate to the accompanying values. -### Basic +### Basic In many cases you'll just want to retreive values by object name or array index. @@ -61,7 +66,7 @@ friends.1.first "Roger" ### Wildcards -A key may contain the special wildcard characters `*` and `?`. +A key may contain the special wildcard characters `*` and `?`. The `*` will match on any zero+ characters, and `?` matches on any one character. ```go @@ -71,7 +76,7 @@ c?ildren.0 "Sara" ### Escape character -Special purpose characters, such as `.`, `*`, and `?` can be escaped with `\`. +Special purpose characters, such as `.`, `*`, and `?` can be escaped with `\`. ```go fav\.movie "Deer Hunter" @@ -82,16 +87,15 @@ You'll also need to make sure that the `\` character is correctly escaped when h ```go // Go val := gjson.Get(json, "fav\\.movie") // must escape the slash -val := gjson.Get(json, `fav\.movie`) // no need to escape the slash +val := gjson.Get(json, `fav\.movie`) // no need to escape the slash ``` ```rust // Rust let val = gjson::get(json, "fav\\.movie") // must escape the slash -let val = gjson::get(json, r#"fav\.movie"#) // no need to escape the slash +let val = gjson::get(json, r#"fav\.movie"#) // no need to escape the slash ``` - ### Arrays The `#` character allows for digging into JSON Arrays. @@ -105,8 +109,8 @@ friends.#.age [44,68,47] ### Queries -You can also query an array for the first match by using `#(...)`, or find all matches with `#(...)#`. -Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` comparison operators, +You can also query an array for the first match by using `#(...)`, or find all matches with `#(...)#`. +Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` comparison operators, and the simple pattern matching `%` (like) and `!%` (not like) operators. ```go @@ -130,10 +134,10 @@ Nested queries are allowed. friends.#(nets.#(=="fb"))#.first >> ["Dale","Roger"] ``` -*Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was -changed in v1.3.0 as to avoid confusion with the new [multipath](#multipaths) +_Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was +changed in v1.3.0 as to avoid confusion with the new [multipath](#multipaths) syntax. For backwards compatibility, `#[...]` will continue to work until the -next major release.* +next major release._ The `~` (tilde) operator will convert a value to a boolean before comparison. @@ -185,9 +189,9 @@ vals.#(b!=~*)#.a >> [11] ### Dot vs Pipe -The `.` is standard separator, but it's also possible to use a `|`. +The `.` is standard separator, but it's also possible to use a `|`. In most cases they both end up returning the same results. -The cases where`|` differs from `.` is when it's used after the `#` for [Arrays](#arrays) and [Queries](#queries). +The cases where`|` differs from `.` is when it's used after the `#` for [Arrays](#arrays) and [Queries](#queries). Here are some examples @@ -212,23 +216,26 @@ Let's break down a few of these. The path `friends.#(last="Murphy")#` all by itself results in ```json -[{"first": "Dale", "last": "Murphy", "age": 44},{"first": "Jane", "last": "Murphy", "age": 47}] +[ + { "first": "Dale", "last": "Murphy", "age": 44 }, + { "first": "Jane", "last": "Murphy", "age": 47 } +] ``` -The `.first` suffix will process the `first` path on each array element *before* returning the results. Which becomes +The `.first` suffix will process the `first` path on each array element _before_ returning the results. Which becomes ```json -["Dale","Jane"] +["Dale", "Jane"] ``` -But the `|first` suffix actually processes the `first` path *after* the previous result. -Since the previous result is an array, not an object, it's not possible to process +But the `|first` suffix actually processes the `first` path _after_ the previous result. +Since the previous result is an array, not an object, it's not possible to process because `first` does not exist. Yet, `|0` suffix returns ```json -{"first": "Dale", "last": "Murphy", "age": 44} +{ "first": "Dale", "last": "Murphy", "age": 44 } ``` Because `0` is the first index of the previous result. @@ -274,24 +281,24 @@ Which makes the json pretty and orders all of its keys. ```json { - "age":37, - "children": ["Sara","Alex","Jack"], + "age": 37, + "children": ["Sara", "Alex", "Jack"], "fav.movie": "Deer Hunter", "friends": [ - {"age": 44, "first": "Dale", "last": "Murphy"}, - {"age": 68, "first": "Roger", "last": "Craig"}, - {"age": 47, "first": "Jane", "last": "Murphy"} + { "age": 44, "first": "Dale", "last": "Murphy" }, + { "age": 68, "first": "Roger", "last": "Craig" }, + { "age": 47, "first": "Jane", "last": "Murphy" } ], - "name": {"first": "Tom", "last": "Anderson"} + "name": { "first": "Tom", "last": "Anderson" } } ``` -*The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`. -Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information.* +_The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`. +Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information._ #### Custom modifiers -You can also add custom modifiers. +You can also add custom modifiers. For example, here we create a modifier which makes the entire JSON payload upper or lower case. @@ -309,7 +316,7 @@ gjson.AddModifier("case", func(json, arg string) string { "children.@case:lower.@reverse" ["jack","alex","sara"] ``` -*Note: Custom modifiers are not yet available in the Rust version* +_Note: Custom modifiers are not yet available in the Rust version_ ### Multipaths @@ -323,25 +330,25 @@ For example, using the given multipath: {name.first,age,"the_murphys":friends.#(last="Murphy")#.first} ``` -Here we selected the first name, age, and the first name for friends with the +Here we selected the first name, age, and the first name for friends with the last name "Murphy". -You'll notice that an optional key can be provided, in this case -"the_murphys", to force assign a key to a value. Otherwise, the name of the +You'll notice that an optional key can be provided, in this case +"the*murphys", to force assign a key to a value. Otherwise, the name of the actual field will be used, in this case "first". If a name cannot be -determined, then "_" is used. +determined, then "*" is used. This results in ```json -{"first":"Tom","age":37,"the_murphys":["Dale","Jane"]} +{ "first": "Tom", "age": 37, "the_murphys": ["Dale", "Jane"] } ``` ### Literals -Starting with v1.12.0, GJSON added support of json literals, which provides a way for constructing static blocks of json. This is can be particularly useful when constructing a new json document using [multipaths](#multipaths). +Starting with v1.12.0, GJSON added support of json literals, which provides a way for constructing static blocks of json. This is can be particularly useful when constructing a new json document using [multipaths](#multipaths). -A json literal begins with the '!' declaration character. +A json literal begins with the '!' declaration character. For example, using the given multipath: @@ -351,10 +358,10 @@ For example, using the given multipath: Here we selected the first name and age. Then add two new fields, "company" and "employed". -This results in +This results in ```json -{"first":"Tom","age":37,"company":"Happysoft","employed":true} +{ "first": "Tom", "age": 37, "company": "Happysoft", "employed": true } ``` -*See issue [#249](https://github.com/tidwall/gjson/issues/249) for additional context on JSON Literals.* +_See issue [#249](https://github.com/tidwall/gjson/issues/249) for additional context on JSON Literals._ diff --git a/source/vendor/github.com/tidwall/match/README.md b/source/vendor/github.com/tidwall/match/README.md index 5fdd4cf63db6c519d29c8be526e1c8674450a198..1f7fbcada2eb5b3f3200db3627076a7f4c8b4ea1 100644 --- a/source/vendor/github.com/tidwall/match/README.md +++ b/source/vendor/github.com/tidwall/match/README.md @@ -2,7 +2,7 @@ [](https://godoc.org/github.com/tidwall/match) -Match is a very simple pattern matcher where '*' matches on any +Match is a very simple pattern matcher where '\*' matches on any number characters and '?' matches on any one character. ## Installing @@ -14,12 +14,11 @@ go get -u github.com/tidwall/match ## Example ```go -match.Match("hello", "*llo") -match.Match("jello", "?ello") -match.Match("hello", "h*o") +match.Match("hello", "*llo") +match.Match("jello", "?ello") +match.Match("hello", "h*o") ``` - ## Contact Josh Baker [@tidwall](http://twitter.com/tidwall) diff --git a/source/vendor/github.com/tidwall/match/match.go b/source/vendor/github.com/tidwall/match/match.go index 11da28f1b9832a7af49d75d4bc34ee5975a98c8e..d41013a38bf759f84c1a74f7d8915e19cf795c5c 100644 --- a/source/vendor/github.com/tidwall/match/match.go +++ b/source/vendor/github.com/tidwall/match/match.go @@ -10,13 +10,15 @@ import ( // and '?' matches on any one character. // // pattern: -// { term } +// +// { term } +// // term: -// '*' matches any sequence of non-Separator characters -// '?' matches any single non-Separator character -// c matches character c (c != '*', '?', '\\') -// '\\' c matches character c // +// '*' matches any sequence of non-Separator characters +// '?' matches any single non-Separator character +// c matches character c (c != '*', '?', '\\') +// '\\' c matches character c func Match(str, pattern string) bool { if pattern == "*" { return true diff --git a/source/vendor/github.com/tidwall/pretty/README.md b/source/vendor/github.com/tidwall/pretty/README.md index 76c06a5e5f9b81a7aa98390efd872e3ee0357d20..4b5a0fb8c6a3fbd04133c5c6958be42a24469d31 100644 --- a/source/vendor/github.com/tidwall/pretty/README.md +++ b/source/vendor/github.com/tidwall/pretty/README.md @@ -1,11 +1,10 @@ # Pretty -[](https://pkg.go.dev/github.com/tidwall/pretty) +[](https://pkg.go.dev/github.com/tidwall/pretty) Pretty is a Go package that provides [fast](#performance) methods for formatting JSON for human readability, or to compact JSON for smaller payloads. -Getting Started -=============== +# Getting Started ## Installing @@ -22,14 +21,17 @@ This will retrieve the library. Using this example: ```json -{"name": {"first":"Tom","last":"Anderson"}, "age":37, -"children": ["Sara","Alex","Jack"], -"fav.movie": "Deer Hunter", "friends": [ - {"first": "Janet", "last": "Murphy", "age": 44} - ]} +{ + "name": { "first": "Tom", "last": "Anderson" }, + "age": 37, + "children": ["Sara", "Alex", "Jack"], + "fav.movie": "Deer Hunter", + "friends": [{ "first": "Janet", "last": "Murphy", "age": 44 }] +} ``` The following code: + ```go result = pretty.Pretty(example) ``` @@ -57,7 +59,7 @@ Will format the json to: ## Color -Color will colorize the json for outputing to the screen. +Color will colorize the json for outputing to the screen. ```go result = pretty.Color(json, nil) @@ -69,15 +71,16 @@ The second param is used for a customizing the style, and passing nil will use t ## Ugly The following code: + ```go result = pretty.Ugly(example) ``` Will format the json to: -```json +````json {"name":{"first":"Tom","last":"Anderson"},"age":37,"children":["Sara","Alex","Jack"],"fav.movie":"Deer Hunter","friends":[{"first":"Janet","last":"Murphy","age":44}]}``` -``` +```` ## Customized output @@ -99,9 +102,11 @@ type Options struct { SortKeys bool } ``` + ## Performance Benchmarks of Pretty alongside the builtin `encoding/json` Indent/Compact methods. + ``` BenchmarkPretty-16 1000000 1034 ns/op 720 B/op 2 allocs/op BenchmarkPrettySortKeys-16 586797 1983 ns/op 2848 B/op 14 allocs/op @@ -111,12 +116,12 @@ BenchmarkJSONIndent-16 450654 2687 ns/op 1221 B/op 0 allocs/op BenchmarkJSONCompact-16 685111 1699 ns/op 442 B/op 0 allocs/op ``` -*These benchmarks were run on a MacBook Pro 2.4 GHz 8-Core Intel Core i9.* +_These benchmarks were run on a MacBook Pro 2.4 GHz 8-Core Intel Core i9._ ## Contact + Josh Baker [@tidwall](http://twitter.com/tidwall) ## License Pretty source code is available under the MIT [License](/LICENSE). - diff --git a/source/vendor/github.com/tidwall/sjson/README.md b/source/vendor/github.com/tidwall/sjson/README.md index 4598424efa038be3f6663e545161814aca7ed7cb..30f2789e763c5859fcf62f06757e3dd4d76fa175 100644 --- a/source/vendor/github.com/tidwall/sjson/README.md +++ b/source/vendor/github.com/tidwall/sjson/README.md @@ -13,11 +13,9 @@ For quickly retrieving json values check out [GJSON](https://github.com/tidwall/ For a command line interface check out [JJ](https://github.com/tidwall/jj). -Getting Started -=============== +# Getting Started -Installing ----------- +## Installing To start using SJSON, install Go and run `go get`: @@ -27,11 +25,11 @@ $ go get -u github.com/tidwall/sjson This will retrieve the library. -Set a value ------------ -Set sets the value for the specified path. -A path is in dot syntax, such as "name.last" or "age". -This function expects that the json is well-formed and validated. +## Set a value + +Set sets the value for the specified path. +A path is in dot syntax, such as "name.last" or "age". +This function expects that the json is well-formed and validated. Invalid json will not panic, but it may return back unexpected results. Invalid paths may return an error. @@ -51,27 +49,27 @@ func main() { This will print: ```json -{"name":{"first":"Janet","last":"Anderson"},"age":47} +{ "name": { "first": "Janet", "last": "Anderson" }, "age": 47 } ``` -Path syntax ------------ +## Path syntax A path is a series of keys separated by a dot. -The dot and colon characters can be escaped with ``\``. +The dot and colon characters can be escaped with `\`. ```json { - "name": {"first": "Tom", "last": "Anderson"}, - "age":37, - "children": ["Sara","Alex","Jack"], + "name": { "first": "Tom", "last": "Anderson" }, + "age": 37, + "children": ["Sara", "Alex", "Jack"], "fav.movie": "Deer Hunter", "friends": [ - {"first": "James", "last": "Murphy"}, - {"first": "Roger", "last": "Craig"} + { "first": "James", "last": "Murphy" }, + { "first": "Roger", "last": "Craig" } ] } ``` + ``` "name.last" >> "Anderson" "age" >> 37 @@ -89,9 +87,9 @@ Normally number keys are used to modify arrays, but it's possible to force a num ```json { - "users":{ - "2313":{"name":"Sara"}, - "7839":{"name":"Andy"} + "users": { + "2313": { "name": "Sara" }, + "7839": { "name": "Andy" } } } ``` @@ -102,8 +100,7 @@ A colon path would look like: "users.:2313.name" >> "Sara" ``` -Supported types ---------------- +## Supported types Pretty much any type is supported: @@ -119,11 +116,10 @@ sjson.Set(`{"key":true}`, "key", map[string]interface{}{"hello":"world"}) When a type is not recognized, SJSON will fallback to the `encoding/json` Marshaller. - -Examples --------- +## Examples Set a value from empty document: + ```go value, _ := sjson.Set("", "name", "Tom") println(value) @@ -133,6 +129,7 @@ println(value) ``` Set a nested value from empty document: + ```go value, _ := sjson.Set("", "name.last", "Anderson") println(value) @@ -142,6 +139,7 @@ println(value) ``` Set a new value: + ```go value, _ := sjson.Set(`{"name":{"last":"Anderson"}}`, "name.first", "Sara") println(value) @@ -151,6 +149,7 @@ println(value) ``` Update an existing value: + ```go value, _ := sjson.Set(`{"name":{"last":"Anderson"}}`, "name.last", "Smith") println(value) @@ -160,6 +159,7 @@ println(value) ``` Set a new array value: + ```go value, _ := sjson.Set(`{"friends":["Andy","Carol"]}`, "friends.2", "Sara") println(value) @@ -169,6 +169,7 @@ println(value) ``` Append an array value by using the `-1` key in a path: + ```go value, _ := sjson.Set(`{"friends":["Andy","Carol"]}`, "friends.-1", "Sara") println(value) @@ -178,6 +179,7 @@ println(value) ``` Append an array value that is past the end: + ```go value, _ := sjson.Set(`{"friends":["Andy","Carol"]}`, "friends.4", "Sara") println(value) @@ -187,6 +189,7 @@ println(value) ``` Delete a value: + ```go value, _ := sjson.Delete(`{"name":{"first":"Sara","last":"Anderson"}}`, "name.first") println(value) @@ -196,6 +199,7 @@ println(value) ``` Delete an array value: + ```go value, _ := sjson.Delete(`{"friends":["Andy","Carol"]}`, "friends.1") println(value) @@ -205,6 +209,7 @@ println(value) ``` Delete the last array value: + ```go value, _ := sjson.Delete(`{"friends":["Andy","Carol"]}`, "friends.-1") println(value) @@ -215,8 +220,8 @@ println(value) ## Performance -Benchmarks of SJSON alongside [encoding/json](https://golang.org/pkg/encoding/json/), -[ffjson](https://github.com/pquerna/ffjson), +Benchmarks of SJSON alongside [encoding/json](https://golang.org/pkg/encoding/json/), +[ffjson](https://github.com/pquerna/ffjson), [EasyJSON](https://github.com/mailru/easyjson), and [Gabs](https://github.com/Jeffail/gabs) @@ -242,7 +247,7 @@ JSON document used: "width": 500, "height": 500 }, - "image": { + "image": { "src": "Images/Sun.png", "hOffset": 250, "vOffset": 250, @@ -257,7 +262,7 @@ JSON document used: "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" } } -} +} ``` Each operation was rotated though one of the following search paths: @@ -268,9 +273,10 @@ widget.image.hOffset widget.text.onMouseUp ``` -*These benchmarks were run on a MacBook Pro 15" 2.8 GHz Intel Core i7 using Go 1.7 and can be be found [here](https://github.com/tidwall/sjson-benchmarks)*. +_These benchmarks were run on a MacBook Pro 15" 2.8 GHz Intel Core i7 using Go 1.7 and can be be found [here](https://github.com/tidwall/sjson-benchmarks)_. ## Contact + Josh Baker [@tidwall](http://twitter.com/tidwall) ## License diff --git a/source/vendor/github.com/tidwall/sjson/sjson.go b/source/vendor/github.com/tidwall/sjson/sjson.go index a55eef3fdb841a1d4ab1001562bb19ec902a1b9d..3e8f8081f76ddfe875a751af49fc1e6b11573c6f 100644 --- a/source/vendor/github.com/tidwall/sjson/sjson.go +++ b/source/vendor/github.com/tidwall/sjson/sjson.go @@ -427,19 +427,18 @@ func isOptimisticPath(path string) bool { // // A path is a series of keys separated by a dot. // -// { -// "name": {"first": "Tom", "last": "Anderson"}, -// "age":37, -// "children": ["Sara","Alex","Jack"], -// "friends": [ -// {"first": "James", "last": "Murphy"}, -// {"first": "Roger", "last": "Craig"} -// ] -// } -// "name.last" >> "Anderson" -// "age" >> 37 -// "children.1" >> "Alex" -// +// { +// "name": {"first": "Tom", "last": "Anderson"}, +// "age":37, +// "children": ["Sara","Alex","Jack"], +// "friends": [ +// {"first": "James", "last": "Murphy"}, +// {"first": "Roger", "last": "Craig"} +// ] +// } +// "name.last" >> "Anderson" +// "age" >> 37 +// "children.1" >> "Alex" func Set(json, path string, value interface{}) (string, error) { return SetOptions(json, path, value, nil) } diff --git a/source/vendor/github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath/filter_parser.go b/source/vendor/github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath/filter_parser.go index 48a1c7af57a16afab5d48ad130239eab82c7dfcd..945e62b883b1abc58d8119963c3df3fdd50a90c9 100644 --- a/source/vendor/github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath/filter_parser.go +++ b/source/vendor/github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath/filter_parser.go @@ -7,61 +7,61 @@ package yamlpath /* - filterNode represents a node of a filter expression parse tree. Each node is labelled with a lexeme. +filterNode represents a node of a filter expression parse tree. Each node is labelled with a lexeme. - Terminal nodes have one of the following lexemes: root, lexemeFilterAt, lexemeFilterIntegerLiteral, - lexemeFilterFloatLiteral, lexemeFilterStringLiteral, lexemeFilterBooleanLiteral. - root and lexemeFilterAt nodes also have a slice of lexemes representing the subpath of `$`` or `@``, - respectively. +Terminal nodes have one of the following lexemes: root, lexemeFilterAt, lexemeFilterIntegerLiteral, +lexemeFilterFloatLiteral, lexemeFilterStringLiteral, lexemeFilterBooleanLiteral. +root and lexemeFilterAt nodes also have a slice of lexemes representing the subpath of `$“ or `@“, +respectively. - Non-terminal nodes represent either basic filters (simpler predicates of one or two terminal - nodes) or filter expressions (more complex predicates of basic filters). A filter existence expression - is represented as a terminal node with lexemeFilterAt or (less commonly) root. +Non-terminal nodes represent either basic filters (simpler predicates of one or two terminal +nodes) or filter expressions (more complex predicates of basic filters). A filter existence expression +is represented as a terminal node with lexemeFilterAt or (less commonly) root. - The following examples illustrate the approach. +The following examples illustrate the approach. - The basic filter `@.child > 3` is represented as the following parse tree (where each node is indicated by - its lexeme and `<...>` represents the node's children): +The basic filter `@.child > 3` is represented as the following parse tree (where each node is indicated by +its lexeme and `<...>` represents the node's children): - lexemeFilterGreaterThan<lexemeFilterAt,lexemeFilterIntegerLiteral> + lexemeFilterGreaterThan<lexemeFilterAt,lexemeFilterIntegerLiteral> - or, graphically: +or, graphically: - > - / \ - @.child 3 + > + / \ + @.child 3 - The filter expression `@.child > 3 && @.other` is represented as the parse tree: +The filter expression `@.child > 3 && @.other` is represented as the parse tree: - lexemeFilterConjunction<lexemeFilterGreaterThan<lexemeFilterAt,lexemeFilterIntegerLiteral>,lexemeFilterAt> + lexemeFilterConjunction<lexemeFilterGreaterThan<lexemeFilterAt,lexemeFilterIntegerLiteral>,lexemeFilterAt> - or, graphically: +or, graphically: - && - / \ - > @.other - / \ - @.child 3 + && + / \ + > @.other + / \ + @.child 3 - The filter expression `(@.child < 5 || @.child > 10) && @.other == 'x'` is represented as the parse tree: +The filter expression `(@.child < 5 || @.child > 10) && @.other == 'x'` is represented as the parse tree: - lexemeFilterConjunction<lexemeFilterDisjunction<lexemeFilterLessThan<lexemeFilterAt,lexemeFilterIntegerLiteral>, - lexemeFilterGreaterThan<lexemeFilterAt,lexemeFilterIntegerLiteral> - >, - lexemeFilterEquality<lexemeFilterAt,lexemeFilterStringLiteral> - > + lexemeFilterConjunction<lexemeFilterDisjunction<lexemeFilterLessThan<lexemeFilterAt,lexemeFilterIntegerLiteral>, + lexemeFilterGreaterThan<lexemeFilterAt,lexemeFilterIntegerLiteral> + >, + lexemeFilterEquality<lexemeFilterAt,lexemeFilterStringLiteral> + > - or, graphically: +or, graphically: - && - / \ - || == - / \ / \ - < > @.other 'x' - / \ / \ - @.child 5 @.child 10 + && + / \ + || == + / \ / \ + < > @.other 'x' + / \ / \ + @.child 5 @.child 10 - Note that brackets do not appear in the parse tree. +Note that brackets do not appear in the parse tree. */ type filterNode struct { lexeme lexeme diff --git a/source/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh b/source/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh index 1ba22a8b4c9a28c8d64d56db596e8d4595a9e4c7..bfd37592f711e74f7ebaa5830f48d42737fc49ec 100644 --- a/source/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh +++ b/source/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh @@ -10,10 +10,10 @@ LAST_SYNC_REF=$(cat $LOCAL_PATH/sync.checkpoint) git fetch https://go.googlesource.com/go master if git diff --quiet $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH; then - echo "No changes." + echo "No changes." else - NEW_REF=$(git rev-parse FETCH_HEAD | tee $LOCAL_PATH/sync.checkpoint) - echo "Applying changes from $LAST_SYNC_REF to $NEW_REF..." - git diff $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH | \ - git apply -3 --directory=$LOCAL_PATH + NEW_REF=$(git rev-parse FETCH_HEAD | tee $LOCAL_PATH/sync.checkpoint) + echo "Applying changes from $LAST_SYNC_REF to $NEW_REF..." + git diff $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH | + git apply -3 --directory=$LOCAL_PATH fi diff --git a/source/vendor/golang.org/x/sys/unix/README.md b/source/vendor/golang.org/x/sys/unix/README.md index 7d3c060e12213c48b017dfd2846fb9b1cf413d31..bf7fab85702884b59f43586b83250b8da842e3cd 100644 --- a/source/vendor/golang.org/x/sys/unix/README.md +++ b/source/vendor/golang.org/x/sys/unix/README.md @@ -66,11 +66,13 @@ They must be called from within the docker container. The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system call dispatch. There are three entry points: + ``` func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) ``` + The first and second are the standard ones; they differ only in how many arguments can be passed to the kernel. The third is for low-level use by the ForkExec wrapper. Unlike the first two, it does not call into the scheduler to @@ -156,11 +158,11 @@ from the generated architecture-specific files listed below, and merge these into a common file for each OS. The merge is performed in the following steps: + 1. Construct the set of common code that is idential in all architecture-specific files. 2. Write this common code to the merged file. 3. Remove the common code from all architecture-specific files. - ## Generated files ### `zerrors_${GOOS}_${GOARCH}.go` diff --git a/source/vendor/golang.org/x/sys/unix/mkall.sh b/source/vendor/golang.org/x/sys/unix/mkall.sh index e6f31d374df52cc72d798a871ec05b95d4f7e4f2..ac293201ea6d3d7c5d170ab67b38e14a0d443222 100644 --- a/source/vendor/golang.org/x/sys/unix/mkall.sh +++ b/source/vendor/golang.org/x/sys/unix/mkall.sh @@ -23,11 +23,10 @@ cmd="" case "$1" in -syscalls) - for i in zsyscall*go - do + for i in zsyscall*go; do # Run the command line that appears in the first line # of the generated file to regenerate it. - sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i + sed 1q $i | sed 's;^// ;;' | sh >_$i && gofmt <_$i >$i rm _$i done exit 0 @@ -36,14 +35,15 @@ case "$1" in run="cat" cmd="echo" shift + ;; esac case "$#" in -0) - ;; +0) ;; *) echo 'usage: mkall.sh [-n]' 1>&2 exit 2 + ;; esac if [[ "$GOOS" = "linux" ]]; then @@ -207,7 +207,7 @@ solaris_amd64) mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; illumos_amd64) - mksyscall="go run mksyscall_solaris.go" + mksyscall="go run mksyscall_solaris.go" mkerrors= mksysnum= mktypes="GOARCH=$GOARCH go tool cgo -godefs" @@ -231,16 +231,17 @@ esac if [ -n "$mksyscall" ]; then if [ "$GOOSARCH" == "aix_ppc64" ]; then # aix/ppc64 script generates files instead of writing to stdin. - echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ; + echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " elif [ "$GOOS" == "illumos" ]; then - # illumos code generation requires a --illumos switch - echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go"; - # illumos implies solaris, so solaris code generation is also required - echo "$mksyscall -tags solaris,$GOARCH syscall_solaris.go syscall_solaris_$GOARCH.go |gofmt >zsyscall_solaris_$GOARCH.go"; + # illumos code generation requires a --illumos switch + echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go" + # illumos implies solaris, so solaris code generation is also required + echo "$mksyscall -tags solaris,$GOARCH syscall_solaris.go syscall_solaris_$GOARCH.go |gofmt >zsyscall_solaris_$GOARCH.go" else - echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; + echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go" fi fi + ;; esac if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi diff --git a/source/vendor/golang.org/x/sys/unix/mkerrors.sh b/source/vendor/golang.org/x/sys/unix/mkerrors.sh index fdcaa974d23b3f298e7ac7c2c16dbecdc31d4ab7..471e4862113b024ea4908359709b699d47b087f6 100644 --- a/source/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/source/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -432,7 +432,6 @@ includes_SunOS=' #include <termios.h> ' - includes=' #include <sys/types.h> #include <sys/file.h> @@ -467,7 +466,7 @@ ccflags="$@" # The gcc command line prints all the #defines # it encounters while processing the input echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | - awk ' + awk ' $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers @@ -644,16 +643,16 @@ ccflags="$@" # Pull out the error names for later. errors=$( echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | - sort + awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | + sort ) # Pull out the signal names for later. signals=$( echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | - grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | - sort + awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | + grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | + sort ) # Again, writing regexps to a file. @@ -705,8 +704,7 @@ struct tuple { struct tuple errors[] = { " - for i in $errors - do + for i in $errors; do echo -E ' {'$i', "'$i'" },' done @@ -715,8 +713,7 @@ struct tuple errors[] = { struct tuple signals[] = { " - for i in $signals - do + for i in $signals; do echo -E ' {'$i', "'$i'" },' done diff --git a/source/vendor/golang.org/x/sys/windows/mkerrors.bash b/source/vendor/golang.org/x/sys/windows/mkerrors.bash index 58e0188fb71f802180ea330dd13828884e4d3001..53cc8378c458635cd1d2d7774d00b4479ec93111 100644 --- a/source/vendor/golang.org/x/sys/windows/mkerrors.bash +++ b/source/vendor/golang.org/x/sys/windows/mkerrors.bash @@ -8,9 +8,15 @@ set -e shopt -s nullglob winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" -[[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } +[[ -n $winerror ]] || { + echo "Unable to find winerror.h" >&2 + exit 1 +} ntstatus="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/ntstatus.h | sort -Vr | head -n 1)" -[[ -n $ntstatus ]] || { echo "Unable to find ntstatus.h" >&2; exit 1; } +[[ -n $ntstatus ]] || { + echo "Unable to find ntstatus.h" >&2 + exit 1 +} declare -A errors @@ -59,12 +65,12 @@ declare -A errors fi echo "$key $vtype = $value" - done < "$winerror" + done <"$winerror" while read -r line; do [[ $line =~ ^#define\ (STATUS_[^\s]+)\ +\(\(NTSTATUS\)((0x)?[0-9a-fA-F]+)L?\) ]] || continue echo "${BASH_REMATCH[1]} NTStatus = ${BASH_REMATCH[2]}" - done < "$ntstatus" + done <"$ntstatus" echo ")" -} | gofmt > "zerrors_windows.go" +} | gofmt >"zerrors_windows.go" diff --git a/source/vendor/golang.org/x/sys/windows/mkknownfolderids.bash b/source/vendor/golang.org/x/sys/windows/mkknownfolderids.bash index ab8924e936f5c79b1b15c27150bf3239672dc115..5704edbcdddf92e92a348cd49a0aa31080e86d40 100644 --- a/source/vendor/golang.org/x/sys/windows/mkknownfolderids.bash +++ b/source/vendor/golang.org/x/sys/windows/mkknownfolderids.bash @@ -8,7 +8,10 @@ set -e shopt -s nullglob knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" -[[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } +[[ -n $knownfolders ]] || { + echo "Unable to find KnownFolders.h" >&2 + exit 1 +} { echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." @@ -19,9 +22,9 @@ knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Inclu while read -r line; do [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ - "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ - $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ - $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) - done < "$knownfolders" + "${BASH_REMATCH[1]}" $(("${BASH_REMATCH[2]}")) $(("${BASH_REMATCH[3]}")) $(("${BASH_REMATCH[4]}")) \ + $(("${BASH_REMATCH[5]}")) $(("${BASH_REMATCH[6]}")) $(("${BASH_REMATCH[7]}")) $(("${BASH_REMATCH[8]}")) \ + $(("${BASH_REMATCH[9]}")) $(("${BASH_REMATCH[10]}")) $(("${BASH_REMATCH[11]}")) $(("${BASH_REMATCH[12]}")) + done <"$knownfolders" echo ")" -} | gofmt > "zknownfolderids_windows.go" +} | gofmt >"zknownfolderids_windows.go" diff --git a/source/vendor/gopkg.in/warnings.v0/warnings.go b/source/vendor/gopkg.in/warnings.v0/warnings.go index b849d1e3d9a2b5f8f3433ca6ba1d52af30245396..ee5cebc2d66cf109f9c03d3acc97e6b44072a7fe 100644 --- a/source/vendor/gopkg.in/warnings.v0/warnings.go +++ b/source/vendor/gopkg.in/warnings.v0/warnings.go @@ -2,19 +2,19 @@ // // A recurring pattern in Go programming is the following: // -// func myfunc(params) error { -// if err := doSomething(...); err != nil { -// return err -// } -// if err := doSomethingElse(...); err != nil { -// return err -// } -// if ok := doAnotherThing(...); !ok { -// return errors.New("my error") -// } -// ... -// return nil -// } +// func myfunc(params) error { +// if err := doSomething(...); err != nil { +// return err +// } +// if err := doSomethingElse(...); err != nil { +// return err +// } +// if ok := doAnotherThing(...); !ok { +// return errors.New("my error") +// } +// ... +// return nil +// } // // This pattern allows interrupting the flow on any received error. But what if // there are errors that should be noted but still not fatal, for which the flow @@ -27,57 +27,56 @@ // along the way. The only requirement is that fatal and non-fatal errors can be // distinguished programmatically; that is a function such as // -// IsFatal(error) bool +// IsFatal(error) bool // // must be implemented. The following is an example of what the above snippet // could look like using the warnings package: // -// import "gopkg.in/warnings.v0" +// import "gopkg.in/warnings.v0" // -// func isFatal(err error) bool { -// _, ok := err.(WarningType) -// return !ok -// } +// func isFatal(err error) bool { +// _, ok := err.(WarningType) +// return !ok +// } // -// func myfunc(params) error { -// c := warnings.NewCollector(isFatal) -// c.FatalWithWarnings = true -// if err := c.Collect(doSomething()); err != nil { -// return err -// } -// if err := c.Collect(doSomethingElse(...)); err != nil { -// return err -// } -// if ok := doAnotherThing(...); !ok { -// if err := c.Collect(errors.New("my error")); err != nil { -// return err -// } -// } -// ... -// return c.Done() -// } +// func myfunc(params) error { +// c := warnings.NewCollector(isFatal) +// c.FatalWithWarnings = true +// if err := c.Collect(doSomething()); err != nil { +// return err +// } +// if err := c.Collect(doSomethingElse(...)); err != nil { +// return err +// } +// if ok := doAnotherThing(...); !ok { +// if err := c.Collect(errors.New("my error")); err != nil { +// return err +// } +// } +// ... +// return c.Done() +// } // // For an example of a non-trivial code base using this library, see // gopkg.in/gcfg.v1 // // Rules for using warnings // -// - ensure that warnings are programmatically distinguishable from fatal -// errors (i.e. implement an isFatal function and any necessary error types) -// - ensure that there is a single Collector instance for a call of each -// exported function -// - ensure that all errors (fatal or warning) are fed through Collect -// - ensure that every time an error is returned, it is one returned by a -// Collector (from Collect or Done) -// - ensure that Collect is never called after Done +// - ensure that warnings are programmatically distinguishable from fatal +// errors (i.e. implement an isFatal function and any necessary error types) +// - ensure that there is a single Collector instance for a call of each +// exported function +// - ensure that all errors (fatal or warning) are fed through Collect +// - ensure that every time an error is returned, it is one returned by a +// Collector (from Collect or Done) +// - ensure that Collect is never called after Done // // TODO // -// - optionally limit the number of warnings (e.g. stop after 20 warnings) (?) -// - consider interaction with contexts -// - go vet-style invocations verifier -// - semi-automatic code converter -// +// - optionally limit the number of warnings (e.g. stop after 20 warnings) (?) +// - consider interaction with contexts +// - go vet-style invocations verifier +// - semi-automatic code converter package warnings // import "gopkg.in/warnings.v0" import ( diff --git a/source/vendor/gopkg.in/yaml.v3/README.md b/source/vendor/gopkg.in/yaml.v3/README.md index 08eb1babddfac3d8f4e006448496d0e0d1f8d720..2bb5edaab4365db7c6916da94b2f53806d65fa66 100644 --- a/source/vendor/gopkg.in/yaml.v3/README.md +++ b/source/vendor/gopkg.in/yaml.v3/README.md @@ -1,7 +1,6 @@ # YAML support for the Go language -Introduction ------------- +## Introduction The yaml package enables Go programs to comfortably encode and decode YAML values. It was developed within [Canonical](https://www.canonical.com) as @@ -9,22 +8,21 @@ part of the [juju](https://juju.ubuntu.com) project, and is based on a pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) C library to parse and generate YAML data quickly and reliably. -Compatibility -------------- +## Compatibility The yaml package supports most of YAML 1.2, but preserves some behavior from 1.1 for backwards compatibility. Specifically, as of v3 of the yaml package: - - YAML 1.1 bools (_yes/no, on/off_) are supported as long as they are being - decoded into a typed bool value. Otherwise they behave as a string. Booleans - in YAML 1.2 are _true/false_ only. - - Octals encode and decode as _0777_ per YAML 1.1, rather than _0o777_ - as specified in YAML 1.2, because most parsers still use the old format. - Octals in the _0o777_ format are supported though, so new files work. - - Does not support base-60 floats. These are gone from YAML 1.2, and were - actually never supported by this package as it's clearly a poor choice. +- YAML 1.1 bools (_yes/no, on/off_) are supported as long as they are being + decoded into a typed bool value. Otherwise they behave as a string. Booleans + in YAML 1.2 are _true/false_ only. +- Octals encode and decode as _0777_ per YAML 1.1, rather than _0o777_ + as specified in YAML 1.2, because most parsers still use the old format. + Octals in the _0o777_ format are supported though, so new files work. +- Does not support base-60 floats. These are gone from YAML 1.2, and were + actually never supported by this package as it's clearly a poor choice. and offers backwards compatibility with YAML 1.1 in some cases. @@ -33,37 +31,30 @@ anchors, tags, map merging, etc. Multi-document unmarshalling is not yet implemented, and base-60 floats from YAML 1.1 are purposefully not supported since they're a poor design and are gone in YAML 1.2. -Installation and usage ----------------------- +## Installation and usage -The import path for the package is *gopkg.in/yaml.v3*. +The import path for the package is _gopkg.in/yaml.v3_. To install it, run: go get gopkg.in/yaml.v3 -API documentation ------------------ +## API documentation If opened in a browser, the import path itself leads to the API documentation: - - [https://gopkg.in/yaml.v3](https://gopkg.in/yaml.v3) +- [https://gopkg.in/yaml.v3](https://gopkg.in/yaml.v3) -API stability -------------- +## API stability The package API for yaml v3 will remain stable as described in [gopkg.in](https://gopkg.in). - -License -------- +## License The yaml package is licensed under the MIT and Apache License 2.0 licenses. Please see the LICENSE file for details. - -Example -------- +## Example ```Go package main @@ -94,27 +85,27 @@ type T struct { func main() { t := T{} - + err := yaml.Unmarshal([]byte(data), &t) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- t:\n%v\n\n", t) - + d, err := yaml.Marshal(&t) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- t dump:\n%s\n\n", string(d)) - + m := make(map[interface{}]interface{}) - + err = yaml.Unmarshal([]byte(data), &m) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- m:\n%v\n\n", m) - + d, err = yaml.Marshal(&m) if err != nil { log.Fatalf("error: %v", err) @@ -147,4 +138,3 @@ b: - 3 - 4 ``` - diff --git a/source/vendor/gopkg.in/yaml.v3/apic.go b/source/vendor/gopkg.in/yaml.v3/apic.go index ae7d049f182ae2419ded608e4c763487c99dff52..05fd305da1658adcbb42fe1ca1be2d80b8aeb27b 100644 --- a/source/vendor/gopkg.in/yaml.v3/apic.go +++ b/source/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/source/vendor/gopkg.in/yaml.v3/emitterc.go b/source/vendor/gopkg.in/yaml.v3/emitterc.go index 0f47c9ca8addf8e9d2e454e02842927ae825d0e9..dde20e5079dd8510f2b3446a98732d991ed796f3 100644 --- a/source/vendor/gopkg.in/yaml.v3/emitterc.go +++ b/source/vendor/gopkg.in/yaml.v3/emitterc.go @@ -162,10 +162,9 @@ func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool { // Check if we need to accumulate more events before emitting. // // We accumulate extra -// - 1 event for DOCUMENT-START -// - 2 events for SEQUENCE-START -// - 3 events for MAPPING-START -// +// - 1 event for DOCUMENT-START +// - 2 events for SEQUENCE-START +// - 3 events for MAPPING-START func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool { if emitter.events_head == len(emitter.events) { return true @@ -241,7 +240,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/source/vendor/gopkg.in/yaml.v3/parserc.go b/source/vendor/gopkg.in/yaml.v3/parserc.go index 268558a0d6328a00db835512ca6d72369e2051d0..25fe823637abc1c2f55ff7fd800745cbd816d999 100644 --- a/source/vendor/gopkg.in/yaml.v3/parserc.go +++ b/source/vendor/gopkg.in/yaml.v3/parserc.go @@ -227,7 +227,8 @@ func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool // Parse the production: // stream ::= STREAM-START implicit_document? explicit_document* STREAM-END -// ************ +// +// ************ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -249,9 +250,12 @@ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) // Parse the productions: // implicit_document ::= block_node DOCUMENT-END* -// * +// +// * +// // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// ************************* +// +// ************************* func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { token := peek_token(parser) @@ -356,8 +360,8 @@ func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t // Parse the productions: // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// *********** // +// *********** func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -379,9 +383,10 @@ func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event // Parse the productions: // implicit_document ::= block_node DOCUMENT-END* -// ************* -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // +// ************* +// +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -428,30 +433,41 @@ func yaml_parser_set_event_comments(parser *yaml_parser_t, event *yaml_event_t) // Parse the productions: // block_node_or_indentless_sequence ::= -// ALIAS -// ***** -// | properties (block_content | indentless_block_sequence)? -// ********** * -// | block_content | indentless_block_sequence -// * +// +// ALIAS +// ***** +// | properties (block_content | indentless_block_sequence)? +// ********** * +// | block_content | indentless_block_sequence +// * +// // block_node ::= ALIAS -// ***** -// | properties block_content? -// ********** * -// | block_content -// * +// +// ***** +// | properties block_content? +// ********** * +// | block_content +// * +// // flow_node ::= ALIAS -// ***** -// | properties flow_content? -// ********** * -// | flow_content -// * +// +// ***** +// | properties flow_content? +// ********** * +// | flow_content +// * +// // properties ::= TAG ANCHOR? | ANCHOR TAG? -// ************************* +// +// ************************* +// // block_content ::= block_collection | flow_collection | SCALAR -// ****** +// +// ****** +// // flow_content ::= flow_collection | SCALAR -// ****** +// +// ****** func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() @@ -682,8 +698,8 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i // Parse the productions: // block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END -// ******************** *********** * ********* // +// ******************** *********** * ********* func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -740,7 +756,8 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e // Parse the productions: // indentless_sequence ::= (BLOCK-ENTRY block_node?)+ -// *********** * +// +// *********** * func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -805,14 +822,14 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { // Parse the productions: // block_mapping ::= BLOCK-MAPPING_START -// ******************* -// ((KEY block_node_or_indentless_sequence?)? -// *** * -// (VALUE block_node_or_indentless_sequence?)?)* // -// BLOCK-END -// ********* +// ******************* +// ((KEY block_node_or_indentless_sequence?)? +// *** * +// (VALUE block_node_or_indentless_sequence?)?)* // +// BLOCK-END +// ********* func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -881,13 +898,11 @@ func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_even // Parse the productions: // block_mapping ::= BLOCK-MAPPING_START // -// ((KEY block_node_or_indentless_sequence?)? -// -// (VALUE block_node_or_indentless_sequence?)?)* -// ***** * -// BLOCK-END -// +// ((KEY block_node_or_indentless_sequence?)? // +// (VALUE block_node_or_indentless_sequence?)?)* +// ***** * +// BLOCK-END func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -915,16 +930,18 @@ func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_ev // Parse the productions: // flow_sequence ::= FLOW-SEQUENCE-START -// ******************* -// (flow_sequence_entry FLOW-ENTRY)* -// * ********** -// flow_sequence_entry? -// * -// FLOW-SEQUENCE-END -// ***************** +// +// ******************* +// (flow_sequence_entry FLOW-ENTRY)* +// * ********** +// flow_sequence_entry? +// * +// FLOW-SEQUENCE-END +// ***************** +// // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * // +// * func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -987,11 +1004,10 @@ func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_ev return true } -// // Parse the productions: // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// *** * // +// *** * func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1011,8 +1027,8 @@ func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, ev // Parse the productions: // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// ***** * // +// ***** * func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1035,8 +1051,8 @@ func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, // Parse the productions: // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * // +// * func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1053,16 +1069,17 @@ func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, ev // Parse the productions: // flow_mapping ::= FLOW-MAPPING-START -// ****************** -// (flow_mapping_entry FLOW-ENTRY)* -// * ********** -// flow_mapping_entry? -// ****************** -// FLOW-MAPPING-END -// **************** -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * *** * // +// ****************** +// (flow_mapping_entry FLOW-ENTRY)* +// * ********** +// flow_mapping_entry? +// ****************** +// FLOW-MAPPING-END +// **************** +// +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// - *** * func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -1128,8 +1145,7 @@ func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event // Parse the productions: // flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * ***** * -// +// - ***** * func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool { token := peek_token(parser) if token == nil { diff --git a/source/vendor/gopkg.in/yaml.v3/readerc.go b/source/vendor/gopkg.in/yaml.v3/readerc.go index b7de0a89c462af605f889bc46ce165e5d4238add..56af245366f2888dc7d10867a846402582ad1fad 100644 --- a/source/vendor/gopkg.in/yaml.v3/readerc.go +++ b/source/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/source/vendor/gopkg.in/yaml.v3/scannerc.go b/source/vendor/gopkg.in/yaml.v3/scannerc.go index ca0070108f4ebe6a09a222075267e0ffca996e72..30b1f08920a0d9a9d56e4e2d078731dabfd17218 100644 --- a/source/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/source/vendor/gopkg.in/yaml.v3/scannerc.go @@ -1614,11 +1614,11 @@ func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { // Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. // // Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// %YAML 1.1 # a comment \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool { // Eat '%'. start_mark := parser.mark @@ -1719,11 +1719,11 @@ func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool // Scan the directive name. // // Scope: -// %YAML 1.1 # a comment \n -// ^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^ // +// %YAML 1.1 # a comment \n +// ^^^^ +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^ func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool { // Consume the directive name. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { @@ -1758,8 +1758,9 @@ func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark // Scan the value of VERSION-DIRECTIVE. // // Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^ +// +// %YAML 1.1 # a comment \n +// ^^^^^^ func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool { // Eat whitespaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { @@ -1797,10 +1798,11 @@ const max_number_length = 2 // Scan the version number of VERSION-DIRECTIVE. // // Scope: -// %YAML 1.1 # a comment \n -// ^ -// %YAML 1.1 # a comment \n -// ^ +// +// %YAML 1.1 # a comment \n +// ^ +// %YAML 1.1 # a comment \n +// ^ func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool { // Repeat while the next character is digit. @@ -1834,9 +1836,9 @@ func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark // Scan the value of a TAG-DIRECTIVE token. // // Scope: -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool { var handle_value, prefix_value []byte @@ -2847,7 +2849,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 +2878,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 +2912,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 +2998,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/source/vendor/gopkg.in/yaml.v3/writerc.go b/source/vendor/gopkg.in/yaml.v3/writerc.go index b8a116bf9a22b9911958f44904289a8c6b482bd2..266d0b092c031a2c685045942b1ec19587fb15c0 100644 --- a/source/vendor/gopkg.in/yaml.v3/writerc.go +++ b/source/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/source/vendor/gopkg.in/yaml.v3/yaml.go b/source/vendor/gopkg.in/yaml.v3/yaml.go index 8cec6da48d3ec4d8858ca622383c75e359faee1f..f0bedf3d63c969ecfec9185535e27fb377b56d6e 100644 --- a/source/vendor/gopkg.in/yaml.v3/yaml.go +++ b/source/vendor/gopkg.in/yaml.v3/yaml.go @@ -17,8 +17,7 @@ // // Source code and other details for the project are available at GitHub: // -// https://github.com/go-yaml/yaml -// +// https://github.com/go-yaml/yaml package yaml import ( @@ -75,16 +74,15 @@ type Marshaler interface { // // For example: // -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// var t T -// yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) +// type T struct { +// F int `yaml:"a,omitempty"` +// B int +// } +// var t T +// yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) // // See the documentation of Marshal for the format of tags and a list of // supported tag options. -// func Unmarshal(in []byte, out interface{}) (err error) { return unmarshal(in, out, false) } @@ -185,36 +183,35 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) { // // The field tag format accepted is: // -// `(...) yaml:"[<key>][,<flag1>[,<flag2>]]" (...)` +// `(...) yaml:"[<key>][,<flag1>[,<flag2>]]" (...)` // // The following flags are currently supported: // -// omitempty Only include the field if it's not set to the zero -// value for the type or to empty slices or maps. -// Zero valued structs will be omitted if all their public -// fields are zero, unless they implement an IsZero -// method (see the IsZeroer interface type), in which -// case the field will be excluded if IsZero returns true. +// omitempty Only include the field if it's not set to the zero +// value for the type or to empty slices or maps. +// Zero valued structs will be omitted if all their public +// fields are zero, unless they implement an IsZero +// method (see the IsZeroer interface type), in which +// case the field will be excluded if IsZero returns true. // -// flow Marshal using a flow style (useful for structs, -// sequences and maps). +// flow Marshal using a flow style (useful for structs, +// sequences and maps). // -// inline Inline the field, which must be a struct or a map, -// causing all of its fields or keys to be processed as if -// they were part of the outer struct. For maps, keys must -// not conflict with the yaml keys of other struct fields. +// inline Inline the field, which must be a struct or a map, +// causing all of its fields or keys to be processed as if +// they were part of the outer struct. For maps, keys must +// not conflict with the yaml keys of other struct fields. // // In addition, if the key is "-", the field is ignored. // // For example: // -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" -// yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" -// +// type T struct { +// F int `yaml:"a,omitempty"` +// B int +// } +// yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" +// yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" func Marshal(in interface{}) (out []byte, err error) { defer handleErr(&err) e := newEncoder() @@ -358,22 +355,21 @@ const ( // // For example: // -// var person struct { -// Name string -// Address yaml.Node -// } -// err := yaml.Unmarshal(data, &person) -// -// Or by itself: +// var person struct { +// Name string +// Address yaml.Node +// } +// err := yaml.Unmarshal(data, &person) // -// var person Node -// err := yaml.Unmarshal(data, &person) +// Or by itself: // +// var person Node +// err := yaml.Unmarshal(data, &person) 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,7 +417,6 @@ 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/source/vendor/gopkg.in/yaml.v3/yamlh.go b/source/vendor/gopkg.in/yaml.v3/yamlh.go index 7c6d0077061933c97979f6c84cb659b17391e1a3..ddcd5513ba77062dde7003043fb69ef155c0b395 100644 --- a/source/vendor/gopkg.in/yaml.v3/yamlh.go +++ b/source/vendor/gopkg.in/yaml.v3/yamlh.go @@ -438,7 +438,9 @@ type yaml_document_t struct { // The number of written bytes should be set to the size_read variable. // // [in,out] data A pointer to an application data specified by -// yaml_parser_set_input(). +// +// yaml_parser_set_input(). +// // [out] buffer The buffer to write the data from the source. // [in] size The size of the buffer. // [out] size_read The actual number of bytes read from the source. @@ -639,7 +641,6 @@ 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 @@ -659,13 +660,14 @@ type yaml_comment_t struct { // @a buffer to the output. // // @param[in,out] data A pointer to an application data specified by -// yaml_emitter_set_output(). +// +// yaml_emitter_set_output(). +// // @param[in] buffer The buffer with bytes to be written. // @param[in] size The size of the buffer. // // @returns On success, the handler should return @c 1. If the handler failed, // the returned value should be @c 0. -// type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error type yaml_emitter_state_t int diff --git a/source/vendor/gopkg.in/yaml.v3/yamlprivateh.go b/source/vendor/gopkg.in/yaml.v3/yamlprivateh.go index e88f9c54aecb54ed42665b2a08b66a4f03d999bc..dea1ba9610dfd0f361c55d93339dd0d29ca5cfe0 100644 --- a/source/vendor/gopkg.in/yaml.v3/yamlprivateh.go +++ b/source/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)