Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Nov 6, 2023
1 parent 720accd commit 672c02e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 70 deletions.
9 changes: 0 additions & 9 deletions internal/cmd/protoc-gen-go-flipt-sdk/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ func generateGRPC(gen *protogen.Plugin) {
)

if len(file.Services) < 2 {
srv := file.Services[0]
if shouldIgnoreService(srv) {
continue
}

returnType := file.Services[0].GoName + "Client"
g.P("func (t Transport) ", method, "() ", relativeImport(g, file, returnType), "{")
g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)")
Expand All @@ -57,10 +52,6 @@ func generateGRPC(gen *protogen.Plugin) {
g.P("}\n")

for _, srv := range file.Services {
if shouldIgnoreService(srv) {
continue
}

returnType := srv.GoName + "Client"
g.P("func (t ", groupType, ") ", returnType, "() ", relativeImport(g, file, returnType), " {")
g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)")
Expand Down
8 changes: 0 additions & 8 deletions internal/cmd/protoc-gen-go-flipt-sdk/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) {

if len(file.Services) < 2 {
srv := file.Services[0]
if shouldIgnoreService(srv) {
continue
}

returnType := srv.GoName + "Client"

g.P("type ", returnType, " struct {")
Expand Down Expand Up @@ -172,10 +168,6 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) {
g.P("}\n")

for _, srv := range file.Services {
if shouldIgnoreService(srv) {
continue
}

var (
returnType = srv.GoName + "Client"
unexportedReturnType = unexport(returnType)
Expand Down
12 changes: 3 additions & 9 deletions internal/cmd/protoc-gen-go-flipt-sdk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"os"
"slices"
"strings"

"google.golang.org/protobuf/compiler/protogen"
Expand Down Expand Up @@ -32,11 +33,12 @@ func main() {
// warning.
gen.SupportedFeatures |= uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
for _, f := range gen.Files {

if !f.Generate {
continue
}

f.Services = slices.DeleteFunc(f.Services, shouldIgnoreService)

generateSubSDK(gen, f)
}

Expand Down Expand Up @@ -121,10 +123,6 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri

g.P("type ", typ, "Client interface {")
for _, srv := range file.Services {
if shouldIgnoreService(srv) {
continue
}

g.P(srv.GoName+"Client", "()", relativeImport(g, file, srv.GoName+"Client"))
}
g.P("}\n")
Expand All @@ -136,10 +134,6 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri
}

for _, srv := range file.Services {
if shouldIgnoreService(srv) {
continue
}

serviceName := srv.GoName
if oneServicePackage {
serviceName = typ
Expand Down
21 changes: 3 additions & 18 deletions sdk/go/evaluation.sdk.gen.go

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

10 changes: 1 addition & 9 deletions sdk/go/grpc/grpc.sdk.gen.go

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

22 changes: 6 additions & 16 deletions sdk/go/http/evaluation.sdk.gen.go

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

3 changes: 2 additions & 1 deletion sdk/go/sdk.gen.go

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

0 comments on commit 672c02e

Please sign in to comment.