Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorPavlo Strokov <pstrokov@gitlab.com>2020-03-17 00:52:11 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2020-03-17 00:52:11 +0300
commit650d33be0d5f3140f837ca307a345fffed439c91 (patch)
tree2b528a0a742e46aabee5306add0b62c944b09478 /proto
parentddbf8c44360bf5cffd9c8b2d7fbbf73be6e17677 (diff)
Improving of static check analyze.
`unused` linter was enabled to report about unused code. Unused code removed.
Diffstat (limited to 'proto')
-rw-r--r--proto/go/internal/cmd/protoc-gen-gitaly/main.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/proto/go/internal/cmd/protoc-gen-gitaly/main.go b/proto/go/internal/cmd/protoc-gen-gitaly/main.go
index 699b14f6b..08c691e2a 100644
--- a/proto/go/internal/cmd/protoc-gen-gitaly/main.go
+++ b/proto/go/internal/cmd/protoc-gen-gitaly/main.go
@@ -52,7 +52,6 @@ package main
import (
"bytes"
- "compress/gzip"
"fmt"
"go/format"
"io"
@@ -64,7 +63,6 @@ import (
"text/template"
"github.com/golang/protobuf/proto"
- "github.com/golang/protobuf/protoc-gen-go/descriptor"
plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
"gitlab.com/gitlab-org/gitaly/proto/go/internal/linter"
)
@@ -215,26 +213,3 @@ func renderProtoList(dest io.WriteCloser, protoNames []string) error {
return nil
}
-
-// extractFile extracts a FileDescriptorProto from a gzip'd buffer.
-// Note: function is copied from the github.com/golang/protobuf dependency:
-// https://github.com/golang/protobuf/blob/9eb2c01ac278a5d89ce4b2be68fe4500955d8179/descriptor/descriptor.go#L50
-func extractFile(gz []byte) (*descriptor.FileDescriptorProto, error) {
- r, err := gzip.NewReader(bytes.NewReader(gz))
- if err != nil {
- return nil, fmt.Errorf("failed to open gzip reader: %v", err)
- }
- defer r.Close()
-
- b, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, fmt.Errorf("failed to uncompress descriptor: %v", err)
- }
-
- fd := new(descriptor.FileDescriptorProto)
- if err := proto.Unmarshal(b, fd); err != nil {
- return nil, fmt.Errorf("malformed FileDescriptorProto: %v", err)
- }
-
- return fd, nil
-}