Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-grpc-gateway" is a program, not an importable packagego list #4766

Open
mikeheft opened this issue Sep 27, 2024 · 1 comment
Open

Comments

@mikeheft
Copy link

📚 Documentation

In the compile-from-source part of the README, it says to import _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway". But I get an error, albeit just a linting error.

import "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway" is a program, not an importable packagego list
Command protoc-gen-grpc-gateway is a plugin for Google protocol buffer compiler to generate a reverse-proxy, which converts incoming RESTful HTTP/1 requests gRPC invocation. You rarely need to run this program directly. Instead, put this program into your $PATH with a name "protoc-gen-grpc-gateway" and run

protoc --grpc-gateway_out=output_directory path/to/input.proto
See README.md for more details.

Is this just something to do with the linting setting I may have in VSCode?
These are my vscode settings.json for go

"go.formatTool": "goimports",
    "go.useLanguageServer": true,
    "go.testFlags": ["-v"],
    "go.testOnSave": true,
    "go.testTimeout": "30s",
    "go.enableCodeLens": {
      "runtest": true
    },
    "[go]": {
        "editor.formatOnSave": true, // Enable format on save for Go files
        "editor.tabSize": 2,
        "editor.insertSpaces": true, // Ensure spaces are used instead of tabs
        "editor.codeActionsOnSave": {
          "source.organizeImports": "always"
        },
        "editor.quickSuggestions": {
          "other": true,
          "comments": true,
          "strings": true
        }
    },
@mikeheft
Copy link
Author

mikeheft commented Oct 1, 2024

I finally pushed this up to my repo and got this error in the github action logs. Any info on what is wrong here?

Error: tools/tools.go:4:2: import "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway" is a program, not an importable package
make: *** [Makefile:33: test] Error 1
Error: Process completed with exit code 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant