Github actions - go get issue

Go lang dependency issue via github actions

Hello Team,

I am using github actions for one of my unit-test. This is in go language. Somehow one of the go language dependency is not getting installed via github actions but I can install this dependency on my local machine. Could someone have a look at this. Below is the “go” command I am trying to use in github actions,

name: Install dependencies
run: |
go get -u “github.com/didip/tollbooth_chi

Note - I have tried this in the following OS platform,
windows-latest
ubuntu-latest
macos-latest.

Nothing worked.

And this is not related to GOPATH issue since all other dependencies for my go lang code installed without any issues from github actions

Error -
cannot find package “github.com/didip/tollbooth/v6” in any of:
C:\hostedtoolcache\windows\go\1.15.0\x64\src\github.com\didip\tollbooth\v6 (from $GOROOT)
C:\Users\runneradmin\go\src\github.com\didip\tollbooth\v6 (from $GOPATH)

cannot find package “github.com/didip/tollbooth/v6/limiter” in any of:
C:\hostedtoolcache\windows\go\1.15.0\x64\src\github.com\didip\tollbooth\v6\limiter (from $GOROOT)
C:\Users\runneradmin\go\src\github.com\didip\tollbooth\v6\limiter (from $GOPATH)

Thanks,
Dinesh

@dineshkumarj,

Somehow one of the go language dependency is not getting installed via github actions but I can install this dependency on my local machine.

I can reproduce the same error in my workflow.
I also tested on my local environment (Go v1.15.0 installed), but I still get the same “cannot find package” error.
error

Did you also use the same go get command to get the package on your local machine?

Maybe the issue occurs on the package itself.
I have created an issue ticket (didip/tollbooth_chi#6) to report the error to the appropriate engineering team of this package for further investigation and evaluation.
You can follow this issue ticket and add your comments on it.

Hello Thanks for your reply. I have raised a ticket regarding this and got a reply from the github team,

They asked me to follow like the below to get this installed,

jobs: 
  test: 
    name: Run
    runs-on: [ubuntu-latest]
    steps: 

      - name: Setup go
        uses: actions/setup-go@v2
        with:
          go-version: 1.15

      - name: Install dependencies
        run: |
         go get -u "github.com/didip/tollbooth"

      - name: Install 
        working-directory: /home/runner/go/src/github.com/didip/tollbooth/
        run: | 
          go get -u "github.com/didip/tollbooth_chi"

However, I still have issues using this one with Go code where I import tollbooth dependency and it still returns this error. I have posted the same in my ticket id and waiting for a reply from the Github team

@dineshkumarj,

Actually, I had tried like as that before my previous reply (see here).

- name: Install dependencies
  run: |
    go get -u "github.com/didip/tollbooth"
    go get -u "github.com/didip/tollbooth_chi"

As you mentioned, the result still returns the same error.