Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go module proof go:generate protoc #535

Merged
merged 4 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ dependencies and tools, described in the following sections. The
for the required tools and scripts, as it may be more up-to-date than this
document.

In order for the `go generate` command to work properly, the code must
be checked out to the following location:
`$GOPATH/src/github.com/google/certificate-transparency-go`


### Running Codebase Checks

The [`scripts/presubmit.sh`](scripts/presubmit.sh) script runs various tools
Expand Down
60 changes: 31 additions & 29 deletions gossip/minimal/configpb/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion gossip/minimal/configpb/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

syntax = "proto3";

option go_package = "github.com/google/certificate-transparency-go/gossip/minimal/configpb";

package configpb;

import "github.com/google/trillian/crypto/keyspb/keyspb.proto";
import "crypto/keyspb/keyspb.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";

Expand Down
2 changes: 1 addition & 1 deletion gossip/minimal/configpb/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
// Package configpb holds a config protobuf for minimal gossip binaries.
package configpb

//go:generate protoc -I=. -I=$GOPATH/src --go_out=:. config.proto
//go:generate sh -c "protoc -I=. -I$(go list -f '{{ .Dir }}' github.com/google/trillian) --go_out=:$GOPATH/src config.proto"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in person, --go_out still using $GOPATH means that certificate-transparency-go will have to be checked out under $GOPATH (i.e. it can't be outside of the Go source tree like modules usually can). We should document this restriction, since we're not currently aware of a way to avoid it.

102 changes: 52 additions & 50 deletions trillian/ctfe/configpb/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion trillian/ctfe/configpb/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

syntax = "proto3";

option go_package = "github.com/google/certificate-transparency-go/trillian/ctfe/configpb";

package configpb;

import "github.com/google/trillian/crypto/keyspb/keyspb.proto";
import "crypto/keyspb/keyspb.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";

Expand Down
2 changes: 1 addition & 1 deletion trillian/ctfe/configpb/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
// Package configpb holds a config protobuf for the CT personality.
package configpb

//go:generate protoc -I=. -I=$GOPATH/src --go_out=:. config.proto
//go:generate sh -c "protoc -I=. -I$(go list -f '{{ .Dir }}' github.com/google/trillian) --go_out=:$GOPATH/src config.proto"
Loading