Skip to content

can't find $GOPATH/pkg/mod/github.com/go-openapi/spec@v0.21.0/swagger.go: no such file or directory #3140

Open

Description

@udonetsm

can't find $HOME/pkg/mod/github.com/go-openapi/spec@v0.21.0/swagger.go: no such file or directory

install file from tags for linux amd64, rename it to swagger, make ln -s path/to/swagger/binary /usr/bin, try to generate golang code (swagger generate server) and it was successfull, but i can't build my project because when i try go build or go run it returns $GOPATH/pkg/mod/github.com/go-openapi/spec@v0.21.0/swagger.go: no such file or directory

Environment

swagger version: v0.31.0
commit: 77f973a
go version go1.23.2 linux/amd64

OS: debian12

Activity

  1. changed the title [-]can't find $HOME/pkg/mod/github.com/go-openapi/spec@v0.21.0/swagger.go: no such file or directory[/-] [+]can't find $GOPATH/pkg/mod/github.com/go-openapi/spec@v0.21.0/swagger.go: no such file or directory[/+] on Nov 5, 2024
  2. fredbi commented on Sep 3, 2025

    @fredbi
    Contributor

    You should make sure all dependency modules are on your system before generating code.

    e.g. all github.com/go-openapi packages.

  3. added theissue type on Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions