buf icon indicating copy to clipboard operation
buf copied to clipboard

About using third-party dependencies locally

Open sishui opened this issue 1 year ago • 0 comments

#2622

test.proto content

syntax = "proto3";

package api;

option go_package = "github.com/mypkg/myproject/api";


import "status/status.proto";   # this 3rd-party deps

message MyMessage {
    status.Status status = 1;
}

I use buf generate proto

But after generating it(test.pb.go), the package name of the imported third library is wrong.

import (
	status "github.com/mypkg/myproject/api/status"
	....
)

status "github.com/mypkg/myproject/api/status" is its own package name, not the package name of a third party dependency, am I doing something wrong? Please help me. Thanks!

Here is the full test project

sishui avatar Jan 12 '24 08:01 sishui