I'm having trouble including the google/protobuf/timestamp.proto well known type, when using dep.
I get an error: google/protobuf/timestamp.proto: File not found
service.proto:
syntax = "proto3";
import "google/protobuf/timestamp.proto";
package com.rynop.platform;
option go_package = "rpc";
service PlatformService {
rpc Test(EmptyMessage) returns (EmptyMessage);
}
message EmptyMessage { }
message A {
string summary = 1;
google.protobuf.Timestamp start = 2;
}
message B {
repeated A foos = 1;
}
Install package containing timestamp .proto def:
dep ensure -add github.com/golang/protobuf/ptypes/timestamp
Run protoc
and get error:
build/bin/protoc -Ivendor -I. --twirp_typescript_out=version=v6:./clients/ts-json/ rpc/service.proto
google/protobuf/timestamp.proto: File not found.
The dir containing timestamp's .proto definition exists:
file vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto: ASCII text
I'm installing protoc locally because I wan't to lock-in/tie a protoc version to this project:
# fetch the protoc compiler
OS_NAME=$(shell uname -s)
ifeq ($(OS_NAME),Darwin)
PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.7.1/protoc-3.7.1-osx-x86_64.zip
endif
ifeq ($(OS_NAME),Linux)
PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip
endif
build/protoc build/bin/protoc:
mkdir -p build/protoc/bin build/bin
cd build/protoc && curl -L -o protoc.zip $(PROTOC_URL) && \
unzip protoc.zip && mv bin/protoc ../bin/protoc
What am I doing wrong?