Explorar o código

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>
Koichi Shiraishi %!s(int64=6) %!d(string=hai) anos
pai
achega
ea2076d064
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      compiler/protogen/protogen.go

+ 5 - 5
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)}