Cannot find package

Hi all
I am building tyk golang plugin , however have error below

Go version:
vagrant@tyk-gateway-01:~/jwt-kid2uen-plugin$ go version
go version go1.18 linux/amd64

Below is my go structure. The error is cause by “jwt-kid2uen-plugin/pkg/types” not found.
vagrant@tyk-gateway-01:~/jwt-kid2uen-plugin$ tree
├── go.mod
├── go.sum
├── main.go
├── main_test.go
├── pkg
│ └── types
│ └── types.go
├── psuedo-jkws
│ └── main.go

Error when building plugin using below tyk docker command:

vagrant@tyk-gateway-01:~/jwt-kid2uen-plugin$ sudo docker run --rm -v pwd:/plugin-source tykio/tyk-plugin-compiler:v3.1.2

    ++ date +%s
  • ‘[’ -z ‘]’
  • cp -r /plugin-source/go.mod /plugin-source/go.sum /plugin-source/main.go /plugin-source/main_test.go /plugin-source/pkg /plugin-source/psuedo-jkws /plugin-source/ /go/src/plugin-build
  • yes
  • cp -r /go/src/plugin-build/vendor /go/src
    cp: cannot stat ‘/go/src/plugin-build/vendor’: No such file or directory
  • yes
  • true
  • rm -rf /go/src/plugin-build/vendor
  • cd /go/src/plugin-build
  • go build -buildmode=plugin -ldflags -o
    main.go:10:9: cannot find package “jwt-kid2uen-plugin/pkg/types” in any of:
    /go/src/vendor/jwt-kid2uen-plugin/pkg/types (vendor tree)
    /usr/local/go/src/jwt-kid2uen-plugin/pkg/types (from $GOROOT)
    /go/src/jwt-kid2uen-plugin/pkg/types (from $GOPATH)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.