Skip to content

Commit

Permalink
useless code removed
Browse files Browse the repository at this point in the history
  • Loading branch information
onokonem committed Oct 31, 2024
1 parent 0a9c908 commit c5dcd5c
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions internal/kit/kit.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package kit

import (
"bytes"
"io"
"os"

plugin_go "github.com/golang/protobuf/protoc-gen-go/plugin"
"github.com/pseudomuto/protokit"
Expand All @@ -21,26 +19,5 @@ func New() Kit {
}

func (k Kit) RunPluginWithIO(p Plugin, r io.Reader, w io.Writer) error {
in, err := io.ReadAll(r)
if err != nil {
panic(err)
}

if err = os.WriteFile("testdata/in.bin", in, 0o644); err != nil {
panic(err)
}

var out bytes.Buffer

errPlugin := protokit.RunPluginWithIO(p, bytes.NewBuffer(in), &out)

if err = os.WriteFile("testdata/out.bin", out.Bytes(), 0o644); err != nil {
panic(err)
}

if _, err = io.Copy(w, &out); err != nil {
panic(err)
}

return errPlugin
return protokit.RunPluginWithIO(p, r, w)
}

0 comments on commit c5dcd5c

Please sign in to comment.