title: Referencing external protos like google/rpc/status.proto
body: <p>I'm wondering how to properly reference external proto files. Say I've got a .proto file which references standard protobuf types such as <code>Timestamp</code>:</p>
  <pre><code>syntax = &quot;proto3&quot;;
  package api;
  
  import &quot;google/protobuf/timestamp.proto&quot;;
  
  message ServerTimeResponse {
    google.protobuf.Timestamp ts = 1;
  }
  </code></pre>
  <p>Easy. Timestamp is automatically available when compiling.</p>
  <p>Now I add an external
  type, say <code>google.rpc.Status</code>:</p>
  <pre><code>syntax = &quot;proto3&quot;;
  package api;
  
  import &quot;google/protobuf/timestamp.proto&quot;;
  import &quot;google/rpc/status.proto&quot;;
  
  message ServerTimeResponse {
    google.protobuf.Timestamp ts = 1;
    google.rpc.Status status = 2;
  }
  </code></pre>
  <p>Of course we have to tell <code>protoc</code> how to find this file where it is via <code>-I</code>/<code>--proto_path</code>.</p>
  <p>My question is this: What is the best practice for actually referencing this file, in particular to make version control happy? There appears not to be a <code>go mod</code> equivalent for protobufs. I've seen it copied verbatim into projects (such as in <a href="https://github.com/grpc-ecosystem/grpc-gateway/blob/master/third_party/googleapis/google/rpc/status.proto" rel="nofollow noreferrer">grpc-gateway</a>) or just referenced from the local filesystem.</p>