[golang] project layout and package name linting #3369
-
First time using this tool to generate my sources from # buf.yaml
version: v2
lint:
use:
- STANDARD
breaking:
use:
- FILE
modules:
- path: cmd/test_lab/proto # buf.gen.yaml
version: v2
plugins:
- local: protoc-gen-go
out: cmd/test_lab/pb
opt: paths=source_relative
inputs:
- directory: cmd/test_lab/proto // keyboard_message.proto
syntax = "proto3";
package cmd.test_lab.proto; //< This is the part that the linter complains about
option go_package = "cmd/test_lab/pb";
message Keyboard {
enum Layout {
UNKNOWN = 0;
QWERTY = 1;
QWERTZ = 2;
AZERTY = 3;
}
Layout layout = 1;
bool backlit = 2;
}
While this builds fine when calling
It is clear that this has to do with the package name and the position of the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @Big-Iron-Cheems, this is an issue with the path to the module as specified in the
This is probably not what you'd want. You can remove the
Have a look at the style guide for best practises and let me know if you have any issues! |
Beta Was this translation helpful? Give feedback.
Update (with image for clarity): this seems to work like I intended now:
proto
folderpb
folderI'm sure that from this example I'll be able to expand easily for any given structure.
Thanks for your input 👍