Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows GitHub操作:在wihdows上运行golint_Windows_Powershell_Go_Github Actions_Golint - Fatal编程技术网

Windows GitHub操作:在wihdows上运行golint

Windows GitHub操作:在wihdows上运行golint,windows,powershell,go,github-actions,golint,Windows,Powershell,Go,Github Actions,Golint,我想在GitHub操作中在windows上运行golint go install golang.org/x/lint/golint golint ./... 但我遇到了这个错误: golint : The term 'golint' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path

我想在GitHub操作中在windows上运行golint

go install golang.org/x/lint/golint
golint ./...
但我遇到了这个错误:

golint : The term 'golint' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\a\_temp\dd1f47cc-42be-445e-9300-b2b5fbfd04da.ps1:4 char:1
+ golint ./...
+ ~~~~~~
+ CategoryInfo          : ObjectNotFound: (golint:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException

##[error]Process completed with exit code 1.
我下一步做什么

这是下面我的
.github/workflows/test.yaml
。这在Ubuntu和Mac上运行良好

name: test
on:
  push:
    branches:
    - "**"
jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
        - ubuntu-latest
        - macOS-latest
        - windows-latest
    steps:
    - name: setup env unix
      run: |
        echo ::set-env name=GOPATH::${{ runner.workspace }}
        echo ::add-path::${{ runner.workspace }}/bin
      if: "matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'"
    - name: setup env windows
      run: |
        echo ::set-env name=GOPATH::${{ runner.workspace }}
        echo ::add-path::${{ runner.workspace }}\bin
      if: "matrix.os == 'windows-latest'"
    - name: setup go
      uses: actions/setup-go@v1
      with:
        go-version: 1.x
    - name: checkout
      uses: actions/checkout@v1
      with:
        fetch-depth: 1
        path: src/github.com/${{ github.repository }}
    - name: golint
      run: |
        go env
        go install golang.org/x/lint/golint
        golint ./...

这是最小的存储库: 这是拉取请求:

如前所述,这是一个路径问题

请改用此工作流:

name: test
on:
  push:
    branches:
    - "**"
jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
        - ubuntu-latest
        - macOS-latest
        - windows-latest
    steps:
    - name: setup go
      uses: actions/setup-go@v1
      with:
        go-version: 1.x
    - name: setup env
      run: |
        echo "::set-env name=GOPATH::$(go env GOPATH)"
        echo "::add-path::$(go env GOPATH)/bin"
      shell: bash
    - name: checkout
      uses: actions/checkout@v1
      with:
        fetch-depth: 1
        path: src/github.com/${{ github.repository }}
    - name: golint
      run: |
        go env
        go install golang.org/x/lint/golint
        golint ./...