compiler/protogen: rename shadowed path package variables

The use of the variable name "path" shadows the "path" package import.
Rename the variable to avoid shadowing.

Change-Id: Iefcd49146753b52cca1ced1d0758699092cbdeb8
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/178778
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
Koichi Shiraishi 2019-05-24 18:24:29 +09:00 committed by Joe Tsai
parent 44b9a3083f
commit ea2076d064

View File

@ -477,10 +477,10 @@ func newFile(gen *Plugin, p *descriptorpb.FileDescriptorProto, packageName GoPac
return f, nil
}
func (f *File) location(path ...int32) Location {
func (f *File) location(idxPath ...int32) Location {
return Location{
SourceFile: f.Desc.Path(),
Path: path,
Path: idxPath,
}
}
@ -1155,9 +1155,9 @@ type pathKey struct {
}
// newPathKey converts a location path to a pathKey.
func newPathKey(path []int32) pathKey {
buf := make([]byte, 4*len(path))
for i, x := range path {
func newPathKey(idxPath []int32) pathKey {
buf := make([]byte, 4*len(idxPath))
for i, x := range idxPath {
binary.LittleEndian.PutUint32(buf[i*4:], uint32(x))
}
return pathKey{string(buf)}