-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Running the generator on files that do not use the plugin options, throws the following error on compiling
imported and not used: "database/sql/driver"
Tools like buf.build run all plugins on all the files defined in the work directory. This also includes files that do not use this plugin. This leads the generator to add the import path for database/sql/driver even when it is not used.
Here's a simple example
❯ cat proto/error.proto
syntax = "proto3";
package person;
option go_package = "github.com/test/foo/person";
message Error {
string msg = 1;
}
❯ cat gen/go/proto/error_sql.go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/error.proto
package proto
import (
driver "database/sql/driver"
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels