diff --git a/README.md b/README.md index 4053a72..9eefe3e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ So you can reuse existing data definitions in .proto for BigQuery with this plug ## Installation ```sh -go install github.com/GoogleCloudPlatform/protoc-gen-bq-schema@latest +go install github.com/GoogleCloudPlatform/protoc-gen-bq-schema/v2@latest ``` ## Usage diff --git a/go.mod b/go.mod index 7cbf30a..b2b8d47 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -module github.com/GoogleCloudPlatform/protoc-gen-bq-schema +module github.com/GoogleCloudPlatform/protoc-gen-bq-schema/v2 -go 1.16 +go 1.21 require ( - github.com/golang/glog v1.2.1 - google.golang.org/protobuf v1.33.0 + github.com/golang/glog v1.2.3 + google.golang.org/protobuf v1.35.2 ) diff --git a/go.sum b/go.sum index fcf5512..7dc6d99 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,6 @@ -github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= -github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/glog v1.2.3 h1:oDTdz9f5VGVVNGu/Q7UXKWYsD0873HXLHdJUNBsSEKM= +github.com/golang/glog v1.2.3/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= diff --git a/main.go b/main.go index 0652b62..c60eb60 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ import ( "fmt" "os" - "github.com/GoogleCloudPlatform/protoc-gen-bq-schema/pkg/converter" + "github.com/GoogleCloudPlatform/protoc-gen-bq-schema/v2/pkg/converter" "github.com/golang/glog" "google.golang.org/protobuf/proto" plugin "google.golang.org/protobuf/types/pluginpb" diff --git a/pkg/converter/convert.go b/pkg/converter/convert.go index f545cb3..c265b66 100644 --- a/pkg/converter/convert.go +++ b/pkg/converter/convert.go @@ -8,7 +8,7 @@ import ( "sort" "strings" - "github.com/GoogleCloudPlatform/protoc-gen-bq-schema/protos" + "github.com/GoogleCloudPlatform/protoc-gen-bq-schema/v2/protos" "github.com/golang/glog" "google.golang.org/protobuf/encoding/prototext" "google.golang.org/protobuf/proto" diff --git a/protos/bq_field.pb.go b/protos/bq_field.pb.go index 82d5770..c4817c2 100644 --- a/protos/bq_field.pb.go +++ b/protos/bq_field.pb.go @@ -14,7 +14,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.35.1 // protoc v5.26.1 // source: bq_field.proto @@ -67,11 +67,9 @@ type BigQueryFieldOptions struct { func (x *BigQueryFieldOptions) Reset() { *x = BigQueryFieldOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_bq_field_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_bq_field_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BigQueryFieldOptions) String() string { @@ -82,7 +80,7 @@ func (*BigQueryFieldOptions) ProtoMessage() {} func (x *BigQueryFieldOptions) ProtoReflect() protoreflect.Message { mi := &file_bq_field_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -214,7 +212,7 @@ func file_bq_field_proto_rawDescGZIP() []byte { } var file_bq_field_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_bq_field_proto_goTypes = []interface{}{ +var file_bq_field_proto_goTypes = []any{ (*BigQueryFieldOptions)(nil), // 0: gen_bq_schema.BigQueryFieldOptions (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions } @@ -233,20 +231,6 @@ func file_bq_field_proto_init() { if File_bq_field_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_bq_field_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BigQueryFieldOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protos/bq_table.pb.go b/protos/bq_table.pb.go index 54799f7..f13bd91 100644 --- a/protos/bq_table.pb.go +++ b/protos/bq_table.pb.go @@ -14,7 +14,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.35.1 // protoc v5.26.1 // source: bq_table.proto @@ -104,11 +104,9 @@ type BigQueryMessageOptions struct { func (x *BigQueryMessageOptions) Reset() { *x = BigQueryMessageOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_bq_table_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_bq_table_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BigQueryMessageOptions) String() string { @@ -119,7 +117,7 @@ func (*BigQueryMessageOptions) ProtoMessage() {} func (x *BigQueryMessageOptions) ProtoReflect() protoreflect.Message { mi := &file_bq_table_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -237,7 +235,7 @@ func file_bq_table_proto_rawDescGZIP() []byte { var file_bq_table_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_bq_table_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_bq_table_proto_goTypes = []interface{}{ +var file_bq_table_proto_goTypes = []any{ (BigQueryMessageOptions_FieldOrder)(0), // 0: gen_bq_schema.BigQueryMessageOptions.FieldOrder (*BigQueryMessageOptions)(nil), // 1: gen_bq_schema.BigQueryMessageOptions (*descriptorpb.MessageOptions)(nil), // 2: google.protobuf.MessageOptions @@ -258,20 +256,6 @@ func file_bq_table_proto_init() { if File_bq_table_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_bq_table_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BigQueryMessageOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{