encoding/protobuf: fix linter issues
Change-Id: I3c434b7e7b1213d91404044b6bffae36d0b7bcbe
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2725
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/protobuf/parse.go b/encoding/protobuf/parse.go
index 48617c9..7f36f7f 100644
--- a/encoding/protobuf/parse.go
+++ b/encoding/protobuf/parse.go
@@ -187,13 +187,6 @@
pkg *protoConverter
}
-type pkgInfo struct {
- importPath string // the import path
- goPath string // The Go import path
- shortName string // Used for the cue package path, default is base of goPath
- protoName string // the protobuf package name
-}
-
func (p *protoConverter) toCUEPos(pos scanner.Position) token.Pos {
return p.tfile.Pos(pos.Offset, 0)
}
@@ -277,8 +270,7 @@
}
for i := len(p.scope) - 1; i > 0; i-- {
if m, ok := p.scope[i][name]; ok {
- cueName := m.ref
- cueName = strings.Replace(m.ref, ".", "_", -1)
+ cueName := strings.Replace(m.ref, ".", "_", -1)
return cueName
}
}
diff --git a/encoding/protobuf/protobuf.go b/encoding/protobuf/protobuf.go
index d1cdad0..9ae5b64 100644
--- a/encoding/protobuf/protobuf.go
+++ b/encoding/protobuf/protobuf.go
@@ -116,7 +116,6 @@
paths []string
fileCache map[string]result
- instCache map[string]*build.Instance
imports map[string]*build.Instance
errs errors.Error
diff --git a/encoding/protobuf/protobuf_test.go b/encoding/protobuf/protobuf_test.go
index fb0fe69..d62951d 100644
--- a/encoding/protobuf/protobuf_test.go
+++ b/encoding/protobuf/protobuf_test.go
@@ -56,7 +56,7 @@
wantFile := filepath.Join("testdata", filepath.Base(file)+".out.cue")
if *update {
- ioutil.WriteFile(wantFile, out.Bytes(), 0644)
+ _ = ioutil.WriteFile(wantFile, out.Bytes(), 0644)
return
}
@@ -85,10 +85,10 @@
}
b := NewExtractor(c)
- b.AddFile("networking/v1alpha3/gateway.proto", nil)
- b.AddFile("mixer/v1/attributes.proto", nil)
- b.AddFile("mixer/v1/mixer.proto", nil)
- b.AddFile("mixer/v1/config/client/client_config.proto", nil)
+ _ = b.AddFile("networking/v1alpha3/gateway.proto", nil)
+ _ = b.AddFile("mixer/v1/attributes.proto", nil)
+ _ = b.AddFile("mixer/v1/mixer.proto", nil)
+ _ = b.AddFile("mixer/v1/config/client/client_config.proto", nil)
files, err := b.Files()
if err != nil {