From ea2076d064f474809968a6092f74841bb2e8790b Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Fri, 24 May 2019 18:24:29 +0900 Subject: [PATCH] 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 --- compiler/protogen/protogen.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/protogen/protogen.go b/compiler/protogen/protogen.go index c534ba26..09264e65 100644 --- a/compiler/protogen/protogen.go +++ b/compiler/protogen/protogen.go @@ -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)}