[
  {
    "path": ".github/release.yml",
    "content": "changelog:\n  exclude:\n    labels:\n      - tagpr\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: build\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  test:\n    name: Test\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      DEBUG: 1\n    steps:\n      - name: Check out source code\n        uses: actions/checkout@v4\n\n      - name: Set up Go\n        uses: actions/setup-go@v5\n        with:\n          go-version-file: go.mod\n          cache: true\n\n      - name: Run lint\n        uses: reviewdog/action-golangci-lint@v2\n\n      - name: Run tests\n        run: make ci\n\n      - name: Run octocov\n        uses: k1LoW/octocov-action@v1\n\n      - name: Run Trivy vulnerability scanner in repo mode\n        uses: aquasecurity/trivy-action@master\n        with:\n          scan-type: 'fs'\n\n  setup-test:\n    name: Set up test\n    if: github.event_name == 'pull_request'\n    strategy:\n      matrix:\n        platform: [ubuntu-latest, macos-latest, windows-latest]\n    runs-on: ${{ matrix.platform }}\n    env:\n      DEBUG: 1\n    steps:\n      - name: Check out source code\n        uses: actions/checkout@v4\n\n      - name: Set up Go\n        uses: actions/setup-go@v5\n        with:\n          go-version-file: go.mod\n          cache: true\n\n      - name: Run tests\n        run: make test-setup\n        shell: bash\n"
  },
  {
    "path": ".github/workflows/tagpr.yml",
    "content": "name: tagpr\non:\n  push:\n    branches:\n      - main\n\njobs:\n  tagpr:\n    runs-on: ubuntu-latest\n    outputs:\n      tagpr-tag: ${{ steps.run-tagpr.outputs.tag }}\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - name: Check out source code\n        uses: actions/checkout@v4\n\n      - name: Set up Go\n        uses: actions/setup-go@v5\n        with:\n          go-version-file: go.mod\n          cache: true\n\n      - id: run-tagpr\n        name: Run tagpr\n        uses: Songmu/tagpr@v1\n\n  release:\n    needs: tagpr\n    if: needs.tagpr.outputs.tagpr-tag != ''\n    runs-on: macos-latest\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - name: Check out source code\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Set up Go\n        uses: actions/setup-go@v5\n        with:\n          go-version-file: go.mod\n          cache: true\n\n      - name: Run GoReleaser\n        uses: goreleaser/goreleaser-action@v6\n        with:\n          distribution: goreleaser\n          version: latest\n          args: --clean\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n  dockerimage:\n    needs: tagpr\n    if: needs.tagpr.outputs.tagpr-tag != ''\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - name: Check out source code\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Get latest version\n        id: latest_version\n        run: |\n          echo -n 'version=' > $GITHUB_OUTPUT\n          gh release list --limit 1 | cut -f 1 >> $GITHUB_OUTPUT\n          cat $GITHUB_OUTPUT\n\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v2\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v2\n\n      - name: Login to ghcr.io\n        uses: docker/login-action@v2\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Build and push\n        uses: docker/build-push-action@v2\n        with:\n          context: .\n          file: Dockerfile\n          platforms: linux/amd64,linux/arm64\n          push: true\n          tags: |\n            ghcr.io/k1low/gh-grep:${{ steps.latest_version.outputs.version }}\n            ghcr.io/k1low/gh-grep:latest\n          labels: |\n            org.opencontainers.image.name=gh-grep\n            org.opencontainers.image.revision=${{ github.sha }}\n            org.opencontainers.image.version=${{ steps.latest_version.outputs.version }}\n            org.opencontainers.image.source=https://github.com/k1LoW/gh-grep\n"
  },
  {
    "path": ".gitignore",
    "content": "/grep\n/dist\n/gh-grep-e\n/bin\n/coverage.out\n"
  },
  {
    "path": ".golangci.yml",
    "content": "version: \"2\"\nlinters:\n  enable:\n    - errorlint\n    - godot\n    - gosec\n    - misspell\n    - revive\n  settings:\n    errcheck:\n      check-type-assertions: true\n    misspell:\n      locale: US\n    revive:\n      rules:\n        - name: unexported-return\n          disabled: true\n        - name: exported\n          disabled: false\n  exclusions:\n    generated: lax\n    presets:\n      - comments\n      - common-false-positives\n      - legacy\n      - std-error-handling\n    paths:\n      - third_party$\n      - builtin$\n      - examples$\nformatters:\n  exclusions:\n    generated: lax\n    paths:\n      - third_party$\n      - builtin$\n      - examples$\n"
  },
  {
    "path": ".goreleaser.yml",
    "content": "version: 2\nbefore:\n  hooks:\n    - go mod download\n    - go mod tidy\nbuilds:\n-\n  id: gh-grep-linux\n  env:\n    - CGO_ENABLED=0\n  goos:\n    - linux\n  goarch:\n    - amd64\n    - arm64\n  ldflags:\n    - -s -w -X github.com/k1LoW/gh-grep.version={{.Version}} -X github.com/k1LoW/gh-grep.commit={{.FullCommit}} -X github.com/k1LoW/gh-grep.date={{.Date}} -X github.com/k1LoW/gh-grep/version.Version={{.Version}}\n-\n  id: gh-grep-darwin\n  env:\n    - CGO_ENABLED=0\n  goos:\n    - darwin\n  goarch:\n    - amd64\n    - arm64\n  ldflags:\n    - -s -w -X github.com/k1LoW/gh-grep.version={{.Version}} -X github.com/k1LoW/gh-grep.commit={{.FullCommit}} -X github.com/k1LoW/gh-grep.date={{.Date}} -X github.com/k1LoW/gh-grep/version.Version={{.Version}}\n-\n  id: gh-grep-windows\n  env:\n    - CGO_ENABLED=0\n  goos:\n    - windows\n  goarch:\n    - amd64\n  ldflags:\n    - -s -w -X github.com/k1LoW/gh-grep.version={{.Version}} -X github.com/k1LoW/gh-grep.commit={{.FullCommit}} -X github.com/k1LoW/gh-grep.date={{.Date}} -X github.com/k1LoW/gh-grep/version.Version={{.Version}}\narchives:\n-\n  id: gh-grep-archive\n  name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'\n  format_overrides:\n    - goos: darwin\n      format: zip\n  files:\n    - LICENSE\n    - CREDITS\n    - README.md\n    - CHANGELOG.md\n-\n  id: gh-grep-binary\n  name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'\n  format: binary\nchecksum:\n  name_template: 'checksums.txt'\nsnapshot:\n  name_template: \"{{ .Version }}-next\"\nchangelog:\nnfpms:\n  - id: gh-grep-nfpms\n    file_name_template: \"{{ .ProjectName }}_{{ .Version }}-1_{{ .Arch }}\"\n    builds:\n      - gh-grep-linux\n    homepage: https://github.com/k1LoW/gh-grep\n    maintainer: Ken'ichiro Oyama <k1lowxb@gmail.com>\n    description: Print lines matching a pattern in repositories using GitHub API\n    license: MIT\n    formats:\n      - apk\n      - deb\n      - rpm\n    bindir: /usr/bin\n    epoch: 1\n"
  },
  {
    "path": ".octocov.yml",
    "content": "# generated by octocov init\ncoverage:\n  if: true\ncodeToTestRatio:\n  code:\n    - '**/*.go'\n    - '!**/*_test.go'\n  test:\n    - '**/*_test.go'\ntestExecutionTime:\n  if: true\ndiff:\n  datastores:\n    - artifact://${GITHUB_REPOSITORY}\ncomment:\n  if: is_pull_request\nreport:\n  if: is_default_branch\n  datastores:\n    - artifact://${GITHUB_REPOSITORY}\n"
  },
  {
    "path": ".tagpr",
    "content": "# config file for the tagpr in git config format\n# The tagpr generates the initial configuration, which you can rewrite to suit your environment.\n# CONFIGURATIONS:\n#   tagpr.releaseBranch\n#       Generally, it is \"main.\" It is the branch for releases. The pcpr tracks this branch,\n#       creates or updates a pull request as a release candidate, or tags when they are merged.\n#\n#   tagpr.versionFile\n#       Versioning file containing the semantic version needed to be updated at release.\n#       It will be synchronized with the \"git tag\".\n#       Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc.\n#       Sometimes the source code file, such as version.go or Bar.pm, is used.\n#       If you do not want to use versioning files but only git tags, specify the \"-\" string here.\n#       You can specify multiple version files by comma separated strings.\n#\n#   tagpr.vPrefix\n#       Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true)\n#       This is only a tagging convention, not how it is described in the version file.\n#\n#   tagpr.changelog (Optional)\n#       Flag whether or not changelog is added or changed during the release.\n#\n#   tagpr.command (Optional)\n#       Command to change files just before release.\n#\n#   tagpr.tmplate (Optional)\n#       Pull request template in go template format\n#\n#   tagpr.release (Optional)\n#       GitHub Release creation behavior after tagging [true, draft, false]\n#       If this value is not set, the release is to be created.\n[tagpr]\n\tvPrefix = true\n\treleaseBranch = main\n\tversionFile = version/version.go\n\tcommand = \"make prerelease_for_tagpr\"\n\tmajorLabels = \"tagpr:major\"\n\tminorLabels = \"tagpr:minor\"\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "## [v1.2.5](https://github.com/k1LoW/gh-grep/compare/v1.2.4...v1.2.5) - 2025-05-31\n- Bump github.com/cli/go-gh/v2 from 2.11.1 to 2.12.1 by @dependabot in https://github.com/k1LoW/gh-grep/pull/60\n\n## [v1.2.4](https://github.com/k1LoW/gh-grep/compare/v1.2.3...v1.2.4) - 2025-03-22\n- Bump github.com/golang-jwt/jwt/v4 from 4.5.1 to 4.5.2 by @dependabot in https://github.com/k1LoW/gh-grep/pull/58\n\n## [v1.2.3](https://github.com/k1LoW/gh-grep/compare/v1.2.2...v1.2.3) - 2024-12-12\n\n## [v1.2.2](https://github.com/k1LoW/gh-grep/compare/v1.2.1...v1.2.2) - 2024-12-12\n- Bump golang.org/x/crypto from 0.14.0 to 0.17.0 by @dependabot in https://github.com/k1LoW/gh-grep/pull/49\n- Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 by @dependabot in https://github.com/k1LoW/gh-grep/pull/51\n- Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 by @dependabot in https://github.com/k1LoW/gh-grep/pull/52\n- Bump golang.org/x/net from 0.17.0 to 0.23.0 by @dependabot in https://github.com/k1LoW/gh-grep/pull/53\n- Bump golang.org/x/crypto from 0.21.0 to 0.31.0 by @dependabot in https://github.com/k1LoW/gh-grep/pull/56\n- Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 by @dependabot in https://github.com/k1LoW/gh-grep/pull/54\n\n## [v1.2.1](https://github.com/k1LoW/gh-grep/compare/v1.2.0...v1.2.1) - 2023-10-12\n- Bump golang.org/x/net from 0.12.0 to 0.17.0 by @dependabot in https://github.com/k1LoW/gh-grep/pull/47\n\n## [v1.2.0](https://github.com/k1LoW/gh-grep/compare/v1.1.1...v1.2.0) - 2023-07-08\n- Set up gh-grep without gh command by @k1LoW in https://github.com/k1LoW/gh-grep/pull/43\n- Support linux aarch64 by @k1LoW in https://github.com/k1LoW/gh-grep/pull/45\n- Update pkgs by @k1LoW in https://github.com/k1LoW/gh-grep/pull/46\n\n## [v1.1.1](https://github.com/k1LoW/gh-grep/compare/v1.1.0...v1.1.1) - 2023-07-04\n- Pin the API for getting release information to `api.github.com` by @k1LoW in https://github.com/k1LoW/gh-grep/pull/38\n- Fix omissions by @k1LoW in https://github.com/k1LoW/gh-grep/pull/39\n- Setup tagpr by @k1LoW in https://github.com/k1LoW/gh-grep/pull/40\n\n## [v1.1.0](https://github.com/k1LoW/gh-grep/compare/v1.0.1...v1.1.0) (2023-03-09)\n\n* Update go and pkgs [#36](https://github.com/k1LoW/gh-grep/pull/36) ([k1LoW](https://github.com/k1LoW))\n* Bump golang.org/x/net from 0.5.0 to 0.7.0 [#34](https://github.com/k1LoW/gh-grep/pull/34) ([dependabot[bot]](https://github.com/apps/dependabot))\n* Bump golang.org/x/crypto from 0.0.0-20210817164053-32db794688a5 to 0.1.0 [#33](https://github.com/k1LoW/gh-grep/pull/33) ([dependabot[bot]](https://github.com/apps/dependabot))\n\n## [v1.0.1](https://github.com/k1LoW/gh-grep/compare/v1.0.0...v1.0.1) (2023-02-12)\n\n* Fix handling no patterns error [#32](https://github.com/k1LoW/gh-grep/pull/32) ([k1LoW](https://github.com/k1LoW))\n\n## [v1.0.0](https://github.com/k1LoW/gh-grep/compare/v0.11.1...v1.0.0) (2023-02-12)\n\n* Bump up go-github-client (and mote) version [#31](https://github.com/k1LoW/gh-grep/pull/31) ([k1LoW](https://github.com/k1LoW))\n* Fix handling args [#30](https://github.com/k1LoW/gh-grep/pull/30) ([k1LoW](https://github.com/k1LoW))\n* Use `gh release` for detecting latest tag [#29](https://github.com/k1LoW/gh-grep/pull/29) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.11.1](https://github.com/k1LoW/gh-grep/compare/v0.11.0...v0.11.1) (2023-02-03)\n\n* Update pkgs [#28](https://github.com/k1LoW/gh-grep/pull/28) ([k1LoW](https://github.com/k1LoW))\n* FIX README [#26](https://github.com/k1LoW/gh-grep/pull/26) ([pyama86](https://github.com/pyama86))\n* git.io deprecation [#25](https://github.com/k1LoW/gh-grep/pull/25) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.11.0](https://github.com/k1LoW/gh-grep/compare/v0.10.0...v0.11.0) (2022-03-29)\n\n* Use bufio.NewReader instead of bufio.NewScanner [#24](https://github.com/k1LoW/gh-grep/pull/24) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.10.0](https://github.com/k1LoW/gh-grep/compare/v0.9.0...v0.10.0) (2021-11-16)\n\n* Update packages and Go [#22](https://github.com/k1LoW/gh-grep/pull/22) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.9.0](https://github.com/k1LoW/gh-grep/compare/v0.8.0...v0.9.0) (2021-11-07)\n\n* Add options `--branch` and `--tag` [#20](https://github.com/k1LoW/gh-grep/pull/20) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.8.0](https://github.com/k1LoW/gh-grep/compare/v0.7.0...v0.8.0) (2021-11-06)\n\n* Use k1LoW/ghfs instead of johejo/ghfs [#19](https://github.com/k1LoW/gh-grep/pull/19) ([k1LoW](https://github.com/k1LoW))\n* README: add MacPorts install info [#18](https://github.com/k1LoW/gh-grep/pull/18) ([herbygillot](https://github.com/herbygillot))\n\n## [v0.7.0](https://github.com/k1LoW/gh-grep/compare/v0.6.0...v0.7.0) (2021-11-03)\n\n* Add option `--only-matching` [#17](https://github.com/k1LoW/gh-grep/pull/17) ([k1LoW](https://github.com/k1LoW))\n* Add option `--count` [#16](https://github.com/k1LoW/gh-grep/pull/16) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.6.0](https://github.com/k1LoW/gh-grep/compare/v0.5.0...v0.6.0) (2021-11-02)\n\n* Fix script [#14](https://github.com/k1LoW/gh-grep/pull/14) ([mattn](https://github.com/mattn))\n* Support colors on Windows [#13](https://github.com/k1LoW/gh-grep/pull/13) ([mattn](https://github.com/mattn))\n* Add option `--url` [#15](https://github.com/k1LoW/gh-grep/pull/15) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.5.0](https://github.com/k1LoW/gh-grep/compare/v0.4.0...v0.5.0) (2021-11-01)\n\n* Add options `--name-only` `--repo-only` [#12](https://github.com/k1LoW/gh-grep/pull/12) ([k1LoW](https://github.com/k1LoW))\n* Add option `--ignore-case` [#11](https://github.com/k1LoW/gh-grep/pull/11) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.4.0](https://github.com/k1LoW/gh-grep/compare/v0.3.0...v0.4.0) (2021-11-01)\n\n* Add option `-e` [#10](https://github.com/k1LoW/gh-grep/pull/10) ([k1LoW](https://github.com/k1LoW))\n* Add option `--line-number` [#9](https://github.com/k1LoW/gh-grep/pull/9) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.3.0](https://github.com/k1LoW/gh-grep/compare/v0.2.2...v0.3.0) (2021-11-01)\n\n* Color matched word [#8](https://github.com/k1LoW/gh-grep/pull/8) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.2.2](https://github.com/k1LoW/gh-grep/compare/v0.2.1...v0.2.2) (2021-11-01)\n\n* Color the output delimiter. [#7](https://github.com/k1LoW/gh-grep/pull/7) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.2.1](https://github.com/k1LoW/gh-grep/compare/v0.2.0...v0.2.1) (2021-11-01)\n\n\n## [v0.2.0](https://github.com/k1LoW/gh-grep/compare/v0.1.1...v0.2.0) (2021-11-01)\n\n* Fix list repositories when org [#6](https://github.com/k1LoW/gh-grep/pull/6) ([k1LoW](https://github.com/k1LoW))\n* Add debug log [#5](https://github.com/k1LoW/gh-grep/pull/5) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.1.1](https://github.com/k1LoW/gh-grep/compare/v0.1.0...v0.1.1) (2021-11-01)\n\n* Fix handling of environment variables. [#4](https://github.com/k1LoW/gh-grep/pull/4) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.1.0](https://github.com/k1LoW/gh-grep/compare/v0.0.2...v0.1.0) (2021-11-01)\n\n\n## [v0.0.2](https://github.com/k1LoW/gh-grep/compare/v0.0.1...v0.0.2) (2021-11-01)\n\n* Add gh-extension setting [#3](https://github.com/k1LoW/gh-grep/pull/3) ([k1LoW](https://github.com/k1LoW))\n\n## [v0.0.1](https://github.com/k1LoW/gh-grep/compare/a30357888af0...v0.0.1) (2021-10-31)\n\n* Add release setting [#2](https://github.com/k1LoW/gh-grep/pull/2) ([k1LoW](https://github.com/k1LoW))\n* Support `GH_*` tokens [#1](https://github.com/k1LoW/gh-grep/pull/1) ([k1LoW](https://github.com/k1LoW))\n"
  },
  {
    "path": "CREDITS",
    "content": "Go (the standard library)\nhttps://golang.org/\n----------------------------------------------------------------\nCopyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/bmatcuk/doublestar/v4\nhttps://github.com/bmatcuk/doublestar/v4\n----------------------------------------------------------------\nThe MIT License (MIT)\n\nCopyright (c) 2014 Bob Matcuk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n================================================================\n\ngithub.com/bradleyfalzon/ghinstallation/v2\nhttps://github.com/bradleyfalzon/ghinstallation/v2\n----------------------------------------------------------------\n\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2019 ghinstallation AUTHORS\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n================================================================\n\ngithub.com/cli/go-gh\nhttps://github.com/cli/go-gh\n----------------------------------------------------------------\nMIT License\n\nCopyright (c) 2021 GitHub Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n================================================================\n\ngithub.com/cli/safeexec\nhttps://github.com/cli/safeexec\n----------------------------------------------------------------\nBSD 2-Clause License\n\nCopyright (c) 2020, GitHub Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/davecgh/go-spew\nhttps://github.com/davecgh/go-spew\n----------------------------------------------------------------\nISC License\n\nCopyright (c) 2012-2016 Dave Collins <dave@davec.name>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n================================================================\n\ngithub.com/fatih/color\nhttps://github.com/fatih/color\n----------------------------------------------------------------\nThe MIT License (MIT)\n\nCopyright (c) 2013 Fatih Arslan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n================================================================\n\ngithub.com/golang-jwt/jwt/v4\nhttps://github.com/golang-jwt/jwt/v4\n----------------------------------------------------------------\nCopyright (c) 2012 Dave Grijalva\nCopyright (c) 2021 golang-jwt maintainers\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n================================================================\n\ngithub.com/golang/protobuf\nhttps://github.com/golang/protobuf\n----------------------------------------------------------------\nCopyright 2010 The Go Authors.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n    * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n================================================================\n\ngithub.com/google/go-cmp\nhttps://github.com/google/go-cmp\n----------------------------------------------------------------\nCopyright (c) 2017 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/google/go-github/v50\nhttps://github.com/google/go-github/v50\n----------------------------------------------------------------\nCopyright (c) 2013 The go-github AUTHORS. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/google/go-querystring\nhttps://github.com/google/go-querystring\n----------------------------------------------------------------\nCopyright (c) 2013 Google. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/gorilla/mux\nhttps://github.com/gorilla/mux\n----------------------------------------------------------------\nCopyright (c) 2012-2018 The Gorilla Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n\t * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\t * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n\t * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/inconshreveable/mousetrap\nhttps://github.com/inconshreveable/mousetrap\n----------------------------------------------------------------\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2022 Alan Shreve (@inconshreveable)\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n================================================================\n\ngithub.com/k1LoW/ghfs\nhttps://github.com/k1LoW/ghfs\n----------------------------------------------------------------\nThe MIT License (MIT)\n\nCopyright © 2021 Ken'ichiro Oyama <k1lowxb@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n================================================================\n\ngithub.com/k1LoW/go-github-client/v50\nhttps://github.com/k1LoW/go-github-client/v50\n----------------------------------------------------------------\nThe MIT License (MIT)\n\nCopyright © 2021 Ken'ichiro Oyama <k1lowxb@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n================================================================\n\ngithub.com/kr/pretty\nhttps://github.com/kr/pretty\n----------------------------------------------------------------\nThe MIT License (MIT)\n\nCopyright 2012 Keith Rarick\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n================================================================\n\ngithub.com/kr/text\nhttps://github.com/kr/text\n----------------------------------------------------------------\nCopyright 2012 Keith Rarick\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n================================================================\n\ngithub.com/mattn/go-colorable\nhttps://github.com/mattn/go-colorable\n----------------------------------------------------------------\nThe MIT License (MIT)\n\nCopyright (c) 2016 Yasuhiro Matsumoto\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n================================================================\n\ngithub.com/mattn/go-isatty\nhttps://github.com/mattn/go-isatty\n----------------------------------------------------------------\nCopyright (c) Yasuhiro MATSUMOTO <mattn.jp@gmail.com>\n\nMIT License (Expat)\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n================================================================\n\ngithub.com/migueleliasweb/go-github-mock\nhttps://github.com/migueleliasweb/go-github-mock\n----------------------------------------------------------------\nMIT License\n\nCopyright (c) 2021 Miguel Elias dos Santos\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n================================================================\n\ngithub.com/pmezard/go-difflib\nhttps://github.com/pmezard/go-difflib\n----------------------------------------------------------------\nCopyright (c) 2013, Patrick Mezard\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n    The names of its contributors may not be used to endorse or promote\nproducts derived from this software without specific prior written\npermission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/spf13/cobra\nhttps://github.com/spf13/cobra\n----------------------------------------------------------------\n                                Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n================================================================\n\ngithub.com/spf13/pflag\nhttps://github.com/spf13/pflag\n----------------------------------------------------------------\nCopyright (c) 2012 Alex Ogier. All rights reserved.\nCopyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngithub.com/stretchr/testify\nhttps://github.com/stretchr/testify\n----------------------------------------------------------------\nMIT License\n\nCopyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n================================================================\n\ngolang.org/x/crypto\nhttps://golang.org/x/crypto\n----------------------------------------------------------------\nCopyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngolang.org/x/net\nhttps://golang.org/x/net\n----------------------------------------------------------------\nCopyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngolang.org/x/oauth2\nhttps://golang.org/x/oauth2\n----------------------------------------------------------------\nCopyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngolang.org/x/sys\nhttps://golang.org/x/sys\n----------------------------------------------------------------\nCopyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngoogle.golang.org/appengine\nhttps://google.golang.org/appengine\n----------------------------------------------------------------\n\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n================================================================\n\ngoogle.golang.org/protobuf\nhttps://google.golang.org/protobuf\n----------------------------------------------------------------\nCopyright (c) 2018 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngopkg.in/check.v1\nhttps://gopkg.in/check.v1\n----------------------------------------------------------------\nGocheck - A rich testing framework for Go\n \nCopyright (c) 2010-2013 Gustavo Niemeyer <gustavo@niemeyer.net>\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met: \n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer. \n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution. \n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n================================================================\n\ngopkg.in/yaml.v3\nhttps://gopkg.in/yaml.v3\n----------------------------------------------------------------\n\nThis project is covered by two different licenses: MIT and Apache.\n\n#### MIT License ####\n\nThe following files were ported to Go from C files of libyaml, and thus\nare still covered by their original MIT license, with the additional\ncopyright staring in 2011 when the project was ported over:\n\n    apic.go emitterc.go parserc.go readerc.go scannerc.go\n    writerc.go yamlh.go yamlprivateh.go\n\nCopyright (c) 2006-2010 Kirill Simonov\nCopyright (c) 2006-2011 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n### Apache License ###\n\nAll the remaining project files are covered by the Apache license:\n\nCopyright (c) 2011-2019 Canonical Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n================================================================\n\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM golang:1-bullseye AS builder\n\nWORKDIR /workdir/\nCOPY . /workdir/\n\nRUN apt-get update\n\nRUN update-ca-certificates\n\nRUN make build\n\nFROM debian:bullseye-slim\n\nRUN apt-get update \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists/*\n\nCOPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/\nCOPY --from=builder /workdir/ghgrep ./usr/bin/gh-grep\n\nENTRYPOINT [\"/entrypoint.sh\"]\n\nCOPY scripts/entrypoint.sh /entrypoint.sh\nRUN chmod +x /entrypoint.sh\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright © 2021 Ken'ichiro Oyama <k1lowxb@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": "PKG = github.com/k1LoW/gh-grep\nCOMMIT = $$(git describe --tags --always)\nOSNAME=${shell uname -s}\nifeq ($(OSNAME),Darwin)\n\tDATE = $$(gdate --utc '+%Y-%m-%d_%H:%M:%S')\nelse\n\tDATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')\nendif\n\nexport GO111MODULE=on\nexport CGO_ENABLED=0\n\nBUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)\n\ndefault: test\n\nci: depsdev test\n\ntest:\n\tgo test ./... -coverprofile=coverage.out -covermode=count\n\nlint:\n\tgolangci-lint run ./...\n\ntest-setup:\n\t./gh-grep --help\n\nbuild:\n\tgo build -ldflags=\"$(BUILD_LDFLAGS)\" -o ghgrep\n\ndepsdev:\n\tgo install github.com/Songmu/ghch/cmd/ghch@latest\n\tgo install github.com/Songmu/gocredits/cmd/gocredits@latest\n\nprerelease:\n\tgit pull origin main --tag\n\tgo mod tidy\n\tghch -w -N ${VER}\n\tgocredits -w .\n\tgit add CHANGELOG.md CREDITS go.mod go.sum gh-grep\n\tgit commit -m'Bump up version number'\n\tgit tag ${VER}\n\nprerelease_for_tagpr:\n\tgocredits -w .\n\tgit add CHANGELOG.md CREDITS go.mod go.sum\n\nrelease:\n\tgit push origin main --tag\n\tgoreleaser --clean\n\n.PHONY: default test\n"
  },
  {
    "path": "README.md",
    "content": "# gh-grep\n\n:octocat: Print lines matching a pattern in repositories using GitHub API\n\n## Usage\n\n``` console\n$ gh grep func.*schema.Schema --include=**/*.go --owner k1LoW --repo tbls\nk1LoW/tbls:cmd/doc.go:func withDot(s *schema.Schema, c *config.Config, force bool) (e error) {\nk1LoW/tbls:cmd/doc.go:func outputErExists(s *schema.Schema, path string) bool {\nk1LoW/tbls:config/config.go:func (c *Config) ModifySchema(s *schema.Schema) error {\nk1LoW/tbls:config/config.go:func (c *Config) MergeAdditionalData(s *schema.Schema) error {\nk1LoW/tbls:config/config.go:func (c *Config) FilterTables(s *schema.Schema) error {\nk1LoW/tbls:config/config.go:func (c *Config) mergeDictFromSchema(s *schema.Schema) {\nk1LoW/tbls:config/config.go:func excludeTableFromSchema(name string, s *schema.Schema) error {\n[...]\n```\n\n( Do grep the codes (`**/*.go`) of [k1LoW/tbls](https://github.com/k1LoW/tbls) with the pattern `func.*schema.Schema` )\n\n``` console\n$ gh grep --help\nPrint lines matching a pattern in repositories using GitHub API\n\nUsage:\n  gh-grep [PATTERN] [flags]\n\nFlags:\n  -e, -- strings         match pattern\n      --branch string    branch name\n  -c, --count            show the number of matches instead of matching lines\n      --exclude string   skip files and directories matching pattern\n  -h, --help             help for gh-grep\n  -i, --ignore-case      case insensitive matching\n      --include string   search only files that match pattern (default \"**/*\")\n  -n, --line-number      show line numbers\n      --name-only        show only repository:filenames\n  -o, --only-matching    show only matching parts of a line\n      --owner string     repository owner or org\n      --repo strings     repository name\n      --repo-only        show only repositories\n      --tag string       tag name\n      --url              show URL\n  -v, --version          version for gh-grep\n```\n\n#### :warning: Notice :warning:\n\n**`gh-grep` is very slow because it does all its scanning through the GitHub API.**\n\n**It is recommended to specify the `--include` option to get the results in a realistic time.**\n\n## Examples\n\n### List base Docker images used in the Dockerfile of the project root\n\n``` console\n$ gh grep ^FROM --include=Dockerfile --owner k1LoW\nk1LoW/centve:Dockerfile:FROM centos:7\nk1LoW/docker-alpine-pandoc-ja:Dockerfile:FROM frolvlad/alpine-glibc\nk1LoW/docker-sshd:Dockerfile:FROM docker.io/alpine:3.9\nk1LoW/gh-grep:Dockerfile:FROM debian:buster-slim\nk1LoW/ghdag:Dockerfile:FROM debian:buster-slim\nk1LoW/ghdag-action:Dockerfile:FROM ghcr.io/k1low/ghdag:v0.16.0\nk1LoW/ghput:Dockerfile:FROM alpine:3.13\nk1LoW/ghput-release-action:Dockerfile:FROM ghcr.io/k1low/ghput:v0.12.0\nk1LoW/github-script-ruby:Dockerfile:FROM ghcr.io/k1low/github-script-ruby-base:v1.1.0\n[...]\n```\n\n### List Actions you are using\n\n``` console\n$ gh grep uses: --include=.github/workflows/* --owner k1LoW | sed -e 's/.*uses:\\s*//g' | sort | uniq -c\n   9 ./\n   1 EndBug/add-and-commit@v7\n   2 actions/checkout@master\n  10 actions/checkout@v1\n  50 actions/checkout@v2\n  18 actions/setup-go@v1\n  21 actions/setup-go@v2\n   4 aquasecurity/trivy-action@master\n[...]\n```\n\n### Open the matched lines in a browser.\n\n``` console\n$ gh grep 'ioutil\\.' --include=**/*.go --owner k1LoW --repo ghput --url\nhttps://github.com/k1LoW/ghput/blob/main/gh/gh.go#L300\nhttps://github.com/k1LoW/ghput/blob/main/gh/gh.go#L313\n$ gh grep 'ioutil\\.' --include=**/*.go --owner k1LoW --repo ghput --url | xargs open\n```\n\n*`open` command only works on macOS.\n\n## Install\n\n`gh-grep` can be installed as a standalone command or as [a GitHub CLI extension](https://cli.github.com/manual/gh_extension)\n\n### Install as a GitHub CLI extension\n\n``` console\n$ gh extension install k1LoW/gh-grep\n```\n\n### Install as a standalone command\n\nRun `gh-grep` instead of `gh grep`.\n\n**deb:**\n\n``` console\n$ export GH_GREP_VERSION=X.X.X\n$ curl -o gh-grep.deb -L https://github.com/k1LoW/gh-grep/releases/download/v$GH_GREP_VERSION/gh-grep_$GH_GREP_VERSION-1_amd64.deb\n$ dpkg -i gh-grep.deb\n```\n\n**RPM:**\n\n``` console\n$ export GH_GREP_VERSION=X.X.X\n$ yum install https://github.com/k1LoW/gh-grep/releases/download/v$GH_GREP_VERSION/gh-grep_$GH_GREP_VERSION-1_amd64.rpm\n```\n\n**apk:**\n\n``` console\n$ export GH_GREP_VERSION=X.X.X\n$ curl -o gh-grep.apk -L https://github.com/k1LoW/gh-grep/releases/download/v$GH_GREP_VERSION/gh-grep_$GH_GREP_VERSION-1_amd64.apk\n$ apk add gh-grep.apk\n```\n\n**homebrew tap:**\n\n```console\n$ brew install k1LoW/tap/gh-grep\n```\n\n**macports:**\n\n```console\n$ sudo port install gh-grep\n```\n\nMaintainer: @herbygillot\n\n**manually:**\n\nDownload binary from [releases page](https://github.com/k1LoW/gh-grep/releases)\n\n**go get:**\n\n```console\n$ go get github.com/k1LoW/gh-grep\n```\n\n**docker:**\n\n```console\n$ docker pull ghcr.io/k1low/gh-grep:latest\n```\n"
  },
  {
    "path": "cmd/root.go",
    "content": "/*\nCopyright © 2021 Ken'ichiro Oyama <k1lowxb@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\npackage cmd\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"regexp\"\n\n\t\"github.com/k1LoW/gh-grep/gh\"\n\t\"github.com/k1LoW/gh-grep/scanner\"\n\t\"github.com/k1LoW/gh-grep/version\"\n\t\"github.com/k1LoW/ghfs\"\n\t\"github.com/mattn/go-colorable\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar (\n\topts       scanner.Opts\n\tpatterns   []string\n\trepos      []string\n\tignoreCase bool\n\tbranch     string\n\ttag        string\n\tstdout     = colorable.NewColorableStdout()\n\tstderr     = colorable.NewColorableStderr()\n)\n\nvar rootCmd = &cobra.Command{\n\tUse:          \"gh-grep [PATTERN]\",\n\tShort:        \"Print lines matching a pattern in repositories using GitHub API\",\n\tLong:         `Print lines matching a pattern in repositories using GitHub API`,\n\tVersion:      version.Version,\n\tSilenceUsage: true,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tctx := context.Background()\n\t\tif len(patterns) == 0 && len(args) > 0 {\n\t\t\tpatterns = []string{args[0]}\n\t\t}\n\t\tif len(patterns) == 0 {\n\t\t\treturn errors.New(\"no patterns\")\n\t\t}\n\n\t\topts.Patterns = []*regexp.Regexp{}\n\t\tfor _, p := range patterns {\n\t\t\tif ignoreCase {\n\t\t\t\tp = \"(?i)\" + p\n\t\t\t}\n\t\t\tre, err := regexp.Compile(p)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts.Patterns = append(opts.Patterns, re)\n\t\t}\n\n\t\tg, err := gh.New()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\topts.Gh = g\n\t\tif len(repos) == 0 {\n\t\t\trepos, err = g.Repositories(ctx, opts.Owner)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tfsOpts := []ghfs.Option{ghfs.Client(g.Client())}\n\t\tif branch != \"\" {\n\t\t\tfsOpts = append(fsOpts, ghfs.Branch(branch))\n\t\t}\n\t\tif tag != \"\" {\n\t\t\tfsOpts = append(fsOpts, ghfs.Tag(tag))\n\t\t}\n\n\t\tfor _, repo := range repos {\n\t\t\tlog.Printf(\"In %s/%s\\n\", opts.Owner, repo)\n\t\t\tfsys, err := ghfs.New(opts.Owner, repo, fsOpts...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts.Repo = repo\n\t\t\tif err := scanner.Scan(ctx, fsys, stdout, &opts); err != nil {\n\t\t\t\tif errors.Is(err, &scanner.RepoOnlyError{}) {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t},\n}\n\nfunc Execute() {\n\trootCmd.SetOut(stdout)\n\trootCmd.SetErr(stderr)\n\n\tlog.SetOutput(io.Discard)\n\tif env := os.Getenv(\"DEBUG\"); env != \"\" {\n\t\tlog.SetOutput(os.Stderr)\n\t}\n\n\tif err := rootCmd.Execute(); err != nil {\n\t\tos.Exit(1)\n\t}\n}\n\nfunc init() {\n\trootCmd.Flags().StringVarP(&opts.Owner, \"owner\", \"\", \"\", \"repository owner or org\")\n\tif err := rootCmd.MarkFlagRequired(\"owner\"); err != nil {\n\t\tpanic(err)\n\t}\n\trootCmd.Flags().StringSliceVarP(&repos, \"repo\", \"\", []string{}, \"repository name\")\n\trootCmd.Flags().StringVarP(&branch, \"branch\", \"\", \"\", \"branch name\")\n\trootCmd.Flags().StringVarP(&tag, \"tag\", \"\", \"\", \"tag name\")\n\trootCmd.Flags().StringVarP(&opts.Include, \"include\", \"\", \"**/*\", \"search only files that match pattern\")\n\trootCmd.Flags().StringVarP(&opts.Exclude, \"exclude\", \"\", \"\", \"skip files and directories matching pattern\")\n\trootCmd.Flags().BoolVarP(&opts.LineNumber, \"line-number\", \"n\", false, \"show line numbers\")\n\trootCmd.Flags().BoolVarP(&ignoreCase, \"ignore-case\", \"i\", false, \"case insensitive matching\")\n\trootCmd.Flags().BoolVarP(&opts.NameOnly, \"name-only\", \"\", false, \"show only repository:filenames\")\n\trootCmd.Flags().BoolVarP(&opts.RepoOnly, \"repo-only\", \"\", false, \"show only repositories\")\n\trootCmd.Flags().BoolVarP(&opts.URL, \"url\", \"\", false, \"show URL\")\n\trootCmd.Flags().BoolVarP(&opts.Count, \"count\", \"c\", false, \"show the number of matches instead of matching lines\")\n\trootCmd.Flags().BoolVarP(&opts.OnlyMatching, \"only-matching\", \"o\", false, \"show only matching parts of a line\")\n\trootCmd.Flags().StringSliceVarP(&patterns, \"\", \"e\", []string{}, \"match pattern\")\n}\n"
  },
  {
    "path": "gh/gh.go",
    "content": "package gh\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/google/go-github/v58/github\"\n\t\"github.com/k1LoW/go-github-client/v58/factory\"\n)\n\ntype Gh struct {\n\tclient *github.Client\n}\n\nfunc New() (*Gh, error) {\n\tclient, err := factory.NewGithubClient()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Gh{\n\t\tclient: client,\n\t}, nil\n}\n\nfunc (g *Gh) Client() *github.Client {\n\treturn g.client\n}\n\nfunc (g *Gh) Repositories(ctx context.Context, owner string) ([]string, error) {\n\trepos := []string{}\n\n\tu, _, err := g.client.Users.Get(ctx, owner)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif u.GetType() == \"User\" {\n\t\t// User\n\t\tpage := 1\n\t\tfor {\n\t\t\trs, res, err := g.client.Repositories.ListByUser(ctx, owner, &github.RepositoryListByUserOptions{\n\t\t\t\tListOptions: github.ListOptions{\n\t\t\t\t\tPage:    page,\n\t\t\t\t\tPerPage: 100,\n\t\t\t\t},\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfor _, r := range rs {\n\t\t\t\trepos = append(repos, *r.Name)\n\t\t\t}\n\t\t\tif res.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tpage = res.NextPage\n\t\t}\n\t} else {\n\t\t// Organization\n\t\tpage := 1\n\t\tfor {\n\t\t\trs, res, err := g.client.Repositories.ListByOrg(ctx, owner, &github.RepositoryListByOrgOptions{\n\t\t\t\tListOptions: github.ListOptions{\n\t\t\t\t\tPage:    page,\n\t\t\t\t\tPerPage: 100,\n\t\t\t\t},\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfor _, r := range rs {\n\t\t\t\trepos = append(repos, *r.Name)\n\t\t\t}\n\t\t\tif res.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tpage = res.NextPage\n\t\t}\n\t}\n\n\treturn repos, nil\n}\n\nfunc (g *Gh) ContentURL(ctx context.Context, owner, repo, path string) (string, error) {\n\tfc, _, _, err := g.client.Repositories.GetContents(ctx, owner, repo, path, &github.RepositoryContentGetOptions{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif fc == nil {\n\t\treturn \"\", fmt.Errorf(\"%s is not file\", path)\n\t}\n\treturn fc.GetHTMLURL(), nil\n}\n"
  },
  {
    "path": "gh-grep",
    "content": "#!/usr/bin/env bash\nset -e\n\n# Get extension repository path\nextPath=\"$(dirname \"$0\")\"\n\n# Get latest version\ncd \"${extPath}\" > /dev/null\nver=\"$(git tag | grep ^v | sort --version-sort | tail -1)\"\nif [ \"${ver}\" = \"\" ]; then\n  git fetch --tags > /dev/null 2>&1\n  ver=\"$(git tag | grep ^v | sort --version-sort | tail -1)\"\nfi\ncd - > /dev/null\n\n# Get arch\narch=\"$(uname -m)\"\n\n# Get binary file name\nexe=\"gh-grep\" # default\nif uname -a | grep Msys > /dev/null; then\n  if [ \"${arch}\" = \"x86_64\" ]; then\n    exe=\"gh-grep_${ver}_windows_amd64.exe\"\n  fi\nelif uname -a | grep Darwin > /dev/null; then\n  if [ \"${arch}\" = \"x86_64\" ]; then\n    exe=\"gh-grep_${ver}_darwin_amd64\"\n  elif [ \"${arch}\" = \"arm64\" ]; then\n    exe=\"gh-grep_${ver}_darwin_arm64\"\n  fi\nelif uname -a | grep Linux > /dev/null; then\n  if [ \"${arch}\" = \"x86_64\" ]; then\n    exe=\"gh-grep_${ver}_linux_amd64\"\n  elif [ \"${arch}\" = \"arm64\" ] || [ \"${arch}\" = \"aarch64\" ]; then\n    exe=\"gh-grep_${ver}_linux_arm64\"\n  fi\nfi\n\n# Cleanup bin/ dir\nrm -f \"${extPath}/bin/*\"\nmkdir -p \"${extPath}/bin\"\n\nbinPath=\"${extPath}/bin/${exe}\"\n\nif [ \"${exe}\" == \"gh-grep\" ]; then\n  # Build binary\n  if [ \"$(which go)\" = \"\" ]; then\n    echo \"go must be installed to use this gh extension on this platform\"\n    exit 1\n  fi\n\n  exe=\"cmd.out\"\n\n  cd \"${extPath}\" > /dev/null\n  go build -o \"${binPath}\"\n  cd - > /dev/null\nelse\n  # Download release binary\n  if [[ ! -x \"${binPath}\" ]]; then\n    if [ \"$(which curl)\" = \"\" ]; then\n      echo \"curl must be installed to use this gh extension on this platform\"\n      exit 1\n    fi\n    curl -sL -o \"${binPath}\" \"https://github.com/k1LoW/gh-grep/releases/download/${ver}/${exe}\"\n  fi\nfi\nchmod +x \"${binPath}\"\n\nexec \"${binPath}\" \"$@\"\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/k1LoW/gh-grep\n\ngo 1.23.0\n\nrequire (\n\tgithub.com/bmatcuk/doublestar/v4 v4.7.1\n\tgithub.com/fatih/color v1.18.0\n\tgithub.com/google/go-cmp v0.6.0\n\tgithub.com/google/go-github/v58 v58.0.0\n\tgithub.com/k1LoW/ghfs v1.3.2\n\tgithub.com/k1LoW/go-github-client/v58 v58.0.13\n\tgithub.com/mattn/go-colorable v0.1.13\n\tgithub.com/spf13/cobra v1.8.1\n)\n\nrequire (\n\tgithub.com/bradleyfalzon/ghinstallation/v2 v2.12.0 // indirect\n\tgithub.com/cli/go-gh/v2 v2.12.1 // indirect\n\tgithub.com/cli/safeexec v1.0.1 // indirect\n\tgithub.com/golang-jwt/jwt/v4 v4.5.2 // indirect\n\tgithub.com/google/go-github/v66 v66.0.0 // indirect\n\tgithub.com/google/go-querystring v1.1.0 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/kr/pretty v0.3.1 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgithub.com/spf13/pflag v1.0.5 // indirect\n\tgolang.org/x/sys v0.31.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q=\ngithub.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=\ngithub.com/bradleyfalzon/ghinstallation/v2 v2.12.0 h1:k8oVjGhZel2qmCUsYwSE34jPNT9DL2wCBOtugsHv26g=\ngithub.com/bradleyfalzon/ghinstallation/v2 v2.12.0/go.mod h1:V4gJcNyAftH0rXpRp1SUVUuh+ACxOH1xOk/ZzkRHltg=\ngithub.com/cli/go-gh/v2 v2.12.1 h1:SVt1/afj5FRAythyMV3WJKaUfDNsxXTIe7arZbwTWKA=\ngithub.com/cli/go-gh/v2 v2.12.1/go.mod h1:+5aXmEOJsH9fc9mBHfincDwnS02j2AIA/DsTH0Bk5uw=\ngithub.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00=\ngithub.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=\ngithub.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=\ngithub.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=\ngithub.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=\ngithub.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=\ngithub.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=\ngithub.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw=\ngithub.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4=\ngithub.com/google/go-github/v64 v64.0.0 h1:4G61sozmY3eiPAjjoOHponXDBONm+utovTKbyUb2Qdg=\ngithub.com/google/go-github/v64 v64.0.0/go.mod h1:xB3vqMQNdHzilXBiO2I+M7iEFtHf+DP/omBOv6tQzVo=\ngithub.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M=\ngithub.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4=\ngithub.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=\ngithub.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=\ngithub.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=\ngithub.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/k1LoW/ghfs v1.3.2 h1:0gerdLZ2acRQXLoIlx7Vr9JzSh4mbC9knflmd8T2VTA=\ngithub.com/k1LoW/ghfs v1.3.2/go.mod h1:OGOLqoOBxqVdqe7gJDAVQbzAs+s/9+y63xQrvgDcIBc=\ngithub.com/k1LoW/go-github-client/v58 v58.0.13 h1:iTZdV3EQBVSaTyF5dEPEyrULxgienSRDur571yoIgcI=\ngithub.com/k1LoW/go-github-client/v58 v58.0.13/go.mod h1:KRNfRyjoqVrYPYSVOtNOQBLXQS5tJ+yWNoGDjH5uXZ0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=\ngithub.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=\ngithub.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/migueleliasweb/go-github-mock v1.0.1 h1:amLEECVny28RCD1ElALUpQxrAimamznkg9rN2O7t934=\ngithub.com/migueleliasweb/go-github-mock v1.0.1/go.mod h1:8PJ7MpMoIiCBBNpuNmvndHm0QicjsE+hjex1yMGmjYQ=\ngithub.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=\ngithub.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=\ngithub.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=\ngithub.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=\ngithub.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngolang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=\ngolang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=\ngolang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=\ngolang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=\ngopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "internal/color.go",
    "content": "package internal\n\nimport (\n\t\"unicode/utf8\"\n\n\t\"github.com/fatih/color\"\n)\n\nfunc PrintLine(line string, matches [][]int, c *color.Color) string {\n\tif !utf8.Valid([]byte(line)) {\n\t\treturn line\n\t}\n\tif len(matches) == 0 {\n\t\treturn line\n\t}\n\tpos := 0\n\tcolored := \"\"\n\tfor _, m := range matches {\n\t\tif pos < m[0] {\n\t\t\tcolored += line[pos:m[0]]\n\t\t}\n\t\tcolored += c.Sprint(line[m[0]:m[1]])\n\t\tpos = m[1]\n\t}\n\tcolored += line[pos:]\n\n\treturn colored\n}\n\nfunc PrintOnlyMatches(line string, matches [][]int, c *color.Color) string {\n\tif !utf8.Valid([]byte(line)) {\n\t\treturn \"\"\n\t}\n\tif len(matches) == 0 {\n\t\treturn \"\"\n\t}\n\tfor _, m := range matches {\n\t\treturn c.Sprint(line[m[0]:m[1]])\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "main.go",
    "content": "/*\nCopyright © 2021 Ken'ichiro Oyama <k1lowxb@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\npackage main\n\nimport \"github.com/k1LoW/gh-grep/cmd\"\n\nfunc main() {\n\tcmd.Execute()\n}\n"
  },
  {
    "path": "scanner/scanner.go",
    "content": "package scanner\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bmatcuk/doublestar/v4\"\n\t\"github.com/fatih/color\"\n\t\"github.com/k1LoW/gh-grep/gh\"\n\t\"github.com/k1LoW/gh-grep/internal\"\n)\n\nvar (\n\tmatchc    = color.New(color.FgRed, color.Bold)\n\tdelimiter = color.New(color.FgCyan).Sprint(\":\")\n)\n\ntype RepoOnlyError struct{}\n\nfunc (e *RepoOnlyError) Error() string {\n\treturn \"repository name already displayed\"\n}\n\ntype Opts struct {\n\tPatterns     []*regexp.Regexp\n\tOwner        string\n\tRepo         string\n\tInclude      string\n\tExclude      string\n\tLineNumber   bool\n\tNameOnly     bool\n\tRepoOnly     bool\n\tURL          bool\n\tCount        bool\n\tOnlyMatching bool\n\tGh           *gh.Gh\n}\n\nfunc Scan(ctx context.Context, fsys fs.FS, w io.Writer, opts *Opts) error {\n\treturn doublestar.GlobWalk(fsys, opts.Include, func(path string, d fs.DirEntry) error {\n\t\tif d.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tif opts.Exclude != \"\" {\n\t\t\tmatch, err := doublestar.PathMatch(opts.Exclude, path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif match {\n\t\t\t\tlog.Printf(\"Exclude %s\\n\", path)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tlog.Printf(\"Search %s\\n\", path)\n\t\tf, err := fsys.Open(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer f.Close()\n\t\t// TODO: detect encoding\n\t\tr := bufio.NewReader(f)\n\t\tn := 1\n\t\tc := 0\n\t\tfor {\n\t\t\tstr, err := r.ReadString('\\n')\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t} else if err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tline := strings.TrimRight(str, \"\\n\")\n\n\t\t\tmatches := [][]int{}\n\t\t\tfor _, re := range opts.Patterns {\n\t\t\t\tmatches = append(matches, re.FindAllStringIndex(line, -1)...)\n\t\t\t}\n\n\t\t\tsort.Slice(matches, func(i, j int) bool {\n\t\t\t\treturn matches[i][0] < matches[j][0]\n\t\t\t})\n\n\t\t\t// TODO: refactor\n\t\t\ti := 0\n\t\t\tf := [][]int{}\n\t\t\tfor {\n\t\t\t\tif i+1 == len(matches) {\n\t\t\t\t\tf = append(f, matches[i])\n\t\t\t\t\tbreak\n\t\t\t\t} else if i+1 > len(matches) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif matches[i][1] < matches[i+1][0] {\n\t\t\t\t\tf = append(f, matches[i])\n\t\t\t\t} else if matches[i][1] >= matches[i+1][0] {\n\t\t\t\t\tf = append(f, matches[i])\n\t\t\t\t\ti += 1\n\t\t\t\t}\n\t\t\t\ti += 1\n\t\t\t}\n\t\t\tmatches = f\n\n\t\t\tif len(matches) > 0 {\n\n\t\t\t\t// --count\n\t\t\t\tif opts.Count {\n\t\t\t\t\tc += 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// --repo-only\n\t\t\t\tif opts.RepoOnly {\n\t\t\t\t\tif _, err := fmt.Fprintf(w, \"%s/%s\\n\", opts.Owner, opts.Repo); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\treturn new(RepoOnlyError)\n\t\t\t\t}\n\n\t\t\t\t// --name-only\n\t\t\t\tif opts.NameOnly {\n\t\t\t\t\tif _, err := fmt.Fprintf(w, \"%s/%s%s%s\\n\", opts.Owner, opts.Repo, delimiter, path); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t// --url\n\t\t\t\tif opts.URL {\n\t\t\t\t\tu, err := opts.Gh.ContentURL(ctx, opts.Owner, opts.Repo, path)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif _, err := fmt.Fprintf(w, \"%s#L%d\\n\", u, n); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tn += 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// --line-number\n\t\t\t\tif opts.LineNumber {\n\t\t\t\t\tif _, err := fmt.Fprintf(w, \"%s/%s%s%s%s%d%s%s\\n\", opts.Owner, opts.Repo, delimiter, path, delimiter, n, delimiter, internal.PrintLine(line, matches, matchc)); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tn += 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// --only-matching\n\t\t\t\tif opts.OnlyMatching {\n\t\t\t\t\tif _, err := fmt.Fprintf(w, \"%s/%s%s%s%s%s\\n\", opts.Owner, opts.Repo, delimiter, path, delimiter, internal.PrintOnlyMatches(line, matches, matchc)); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tn += 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// default\n\t\t\t\tif _, err := fmt.Fprintf(w, \"%s/%s%s%s%s%s\\n\", opts.Owner, opts.Repo, delimiter, path, delimiter, internal.PrintLine(line, matches, matchc)); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tn += 1\n\t\t}\n\n\t\t// --count\n\t\tif opts.Count && c > 0 {\n\t\t\tif _, err := fmt.Fprintf(w, \"%s/%s%s%s%s%d\\n\", opts.Owner, opts.Repo, delimiter, path, delimiter, c); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n}\n"
  },
  {
    "path": "scanner/scanner_test.go",
    "content": "package scanner\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io/fs\"\n\t\"regexp\"\n\t\"testing\"\n\t\"testing/fstest\"\n\n\t\"github.com/fatih/color\"\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestScan(t *testing.T) {\n\tcolor.NoColor = true\n\n\tbaseFS := fstest.MapFS{\n\t\t\"path\":             &fstest.MapFile{Mode: fs.ModeDir},\n\t\t\"path/a.txt\":       &fstest.MapFile{Data: []byte(\"alpha\\n\")},\n\t\t\"path/to\":          &fstest.MapFile{Mode: fs.ModeDir},\n\t\t\"path/to/b.txt\":    &fstest.MapFile{Data: []byte(\"beta\\n\")},\n\t\t\"path/to/go\":       &fstest.MapFile{Mode: fs.ModeDir},\n\t\t\"path/to/go/c.txt\": &fstest.MapFile{Data: []byte(\"camma\\n\")},\n\t\t\"path/to/go/d.txt\": &fstest.MapFile{Data: []byte(\"delta\\nepsilon\\n\")},\n\t}\n\n\ttests := []struct {\n\t\tfsys    fs.FS\n\t\topts    *Opts\n\t\twant    string\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns: []*regexp.Regexp{regexp.MustCompile(\"ta\")},\n\t\t\t\tOwner:    \"owner\",\n\t\t\t\tRepo:     \"repo\",\n\t\t\t\tInclude:  \"**/*\",\n\t\t\t},\n\t\t\t`owner/repo:path/to/b.txt:beta\nowner/repo:path/to/go/d.txt:delta\n`,\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns: []*regexp.Regexp{regexp.MustCompile(\"ta\")},\n\t\t\t\tOwner:    \"owner\",\n\t\t\t\tRepo:     \"repo\",\n\t\t\t\tInclude:  \"path/to/*\",\n\t\t\t},\n\t\t\t`owner/repo:path/to/b.txt:beta\n`,\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns: []*regexp.Regexp{regexp.MustCompile(\"l\")},\n\t\t\t\tOwner:    \"owner\",\n\t\t\t\tRepo:     \"repo\",\n\t\t\t\tInclude:  \"**/*\",\n\t\t\t\tNameOnly: true,\n\t\t\t},\n\t\t\t`owner/repo:path/a.txt\nowner/repo:path/to/go/d.txt\n`,\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns: []*regexp.Regexp{regexp.MustCompile(\"l\")},\n\t\t\t\tOwner:    \"owner\",\n\t\t\t\tRepo:     \"repo\",\n\t\t\t\tInclude:  \"**/*\",\n\t\t\t\tRepoOnly: true,\n\t\t\t},\n\t\t\t\"owner/repo\\n\",\n\t\t\ttrue,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns:   []*regexp.Regexp{regexp.MustCompile(\"l\")},\n\t\t\t\tOwner:      \"owner\",\n\t\t\t\tRepo:       \"repo\",\n\t\t\t\tInclude:    \"**/*\",\n\t\t\t\tLineNumber: true,\n\t\t\t},\n\t\t\t`owner/repo:path/a.txt:1:alpha\nowner/repo:path/to/go/d.txt:1:delta\nowner/repo:path/to/go/d.txt:2:epsilon\n`,\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns: []*regexp.Regexp{regexp.MustCompile(\"l\")},\n\t\t\t\tOwner:    \"owner\",\n\t\t\t\tRepo:     \"repo\",\n\t\t\t\tInclude:  \"**/*\",\n\t\t\t\tCount:    true,\n\t\t\t},\n\t\t\t`owner/repo:path/a.txt:1\nowner/repo:path/to/go/d.txt:2\n`,\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns: []*regexp.Regexp{regexp.MustCompile(\"l\")},\n\t\t\t\tOwner:    \"owner\",\n\t\t\t\tRepo:     \"repo\",\n\t\t\t\tInclude:  \"**/*\",\n\t\t\t\tExclude:  \"path/*.txt\",\n\t\t\t},\n\t\t\t`owner/repo:path/to/go/d.txt:delta\nowner/repo:path/to/go/d.txt:epsilon\n`,\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\tbaseFS,\n\t\t\t&Opts{\n\t\t\t\tPatterns:     []*regexp.Regexp{regexp.MustCompile(\".*l\")},\n\t\t\t\tOwner:        \"owner\",\n\t\t\t\tRepo:         \"repo\",\n\t\t\t\tInclude:      \"**/*\",\n\t\t\t\tOnlyMatching: true,\n\t\t\t},\n\t\t\t`owner/repo:path/a.txt:al\nowner/repo:path/to/go/d.txt:del\nowner/repo:path/to/go/d.txt:epsil\n`,\n\t\t\tfalse,\n\t\t},\n\t}\n\n\tctx := context.Background()\n\tfor _, tt := range tests {\n\t\tbuf := new(bytes.Buffer)\n\t\tif err := Scan(ctx, tt.fsys, buf, tt.opts); err != nil {\n\t\t\tif !tt.wantErr {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t}\n\t\tgot := buf.String()\n\t\tif diff := cmp.Diff(got, tt.want, nil); diff != \"\" {\n\t\t\tt.Errorf(\"%s\", diff)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "scripts/entrypoint.sh",
    "content": "#!/bin/sh -l\n\ngh-grep $@\n"
  },
  {
    "path": "version/version.go",
    "content": "package version\n\n// Name for this.\nconst Name string = \"gh-grep\"\n\n// Version for this.\nvar Version = \"1.2.5\"\n"
  }
]