bufbuild / buf

The best way of working with Protocol Buffers.

Home Page:https://buf.build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use native third-party dependencies

sishui opened this issue · comments

This is my dir:

│  buf.gen.yaml
│  buf.work.yaml
│
├─proto
│      buf.yaml
│      test.proto
│
└─vendor
    └─status
            buf.yaml
            status.proto

vendor third-party dependencies
proto/proto is my test proto
buf.work.yaml's contents :

version: v1
directories:
  - proto
  - vendor

buf.gen.yaml's contents:

version: v1
managed:
  enabled: true
  go_package_prefix:
    default: this.is.mypackage
    except:
      - buf.build/googleapis/googleapis

plugins:
  - plugin: go
    out: ./api
    opt:
      - paths=source_relative
  - plugin: go-thirdparty-plugin
    out: ./api
    opt:
      - paths=source_relative

I use buf generate command, it generates test.pb.go and 3rd party *.pb.go, but I only want to generate my own file (only reference 3rd party libraries, not generate 3rd party libraries), what should I do? thanks!!!

buf generate proto