EasyP

Package Same Go Package

Categories:

  • MINIMAL
  • BASIC
  • DEFAULT

This rule checks that all files with a given package are in the same Go package.

Examples

Bad

// File: pkg/foo.proto

syntax = "proto3";

package pkg;

option go_package = "example.com/foo/bar";
// File: pkg/bar.proto

syntax = "proto3";

package pkg;

option go_package = "example.com/foo/baz";

Good

// File: pkg/foo.proto

syntax = "proto3";

package pkg;

option go_package = "example.com/foo/bar";
// File: pkg/bar.proto

syntax = "proto3";

package pkg;

option go_package = "example.com/foo/bar";

On this page