1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:24:42 -07:00

cmd/go/internal/modconv: remove unused variables

Change-Id: I429db8dca219fb931f7b05ce7a7324e8c4ba935b
GitHub-Last-Rev: 2257a5bf23
GitHub-Pull-Request: golang/go#29999
Reviewed-on: https://go-review.googlesource.com/c/160423
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Leon Klingele 2019-01-30 17:34:34 +00:00 committed by Bryan C. Mills
parent 44dec304ad
commit b136b17a8c
5 changed files with 5 additions and 10 deletions

View File

@ -15,8 +15,7 @@ func ParseGlideLock(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File) mf := new(modfile.File)
imports := false imports := false
name := "" name := ""
for lineno, line := range strings.Split(string(data), "\n") { for _, line := range strings.Split(string(data), "\n") {
lineno++
if line == "" { if line == "" {
continue continue
} }

View File

@ -13,8 +13,7 @@ import (
func ParseGLOCKFILE(file string, data []byte) (*modfile.File, error) { func ParseGLOCKFILE(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File) mf := new(modfile.File)
for lineno, line := range strings.Split(string(data), "\n") { for _, line := range strings.Split(string(data), "\n") {
lineno++
f := strings.Fields(line) f := strings.Fields(line)
if len(f) >= 2 && f[0] != "cmd" { if len(f) >= 2 && f[0] != "cmd" {
mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[1]}}) mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[1]}})

View File

@ -13,8 +13,7 @@ import (
func ParseDependenciesTSV(file string, data []byte) (*modfile.File, error) { func ParseDependenciesTSV(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File) mf := new(modfile.File)
for lineno, line := range strings.Split(string(data), "\n") { for _, line := range strings.Split(string(data), "\n") {
lineno++
f := strings.Split(line, "\t") f := strings.Split(line, "\t")
if len(f) >= 3 { if len(f) >= 3 {
mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[2]}}) mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[2]}})

View File

@ -13,8 +13,7 @@ import (
func ParseVendorConf(file string, data []byte) (*modfile.File, error) { func ParseVendorConf(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File) mf := new(modfile.File)
for lineno, line := range strings.Split(string(data), "\n") { for _, line := range strings.Split(string(data), "\n") {
lineno++
if i := strings.Index(line, "#"); i >= 0 { if i := strings.Index(line, "#"); i >= 0 {
line = line[:i] line = line[:i]
} }

View File

@ -15,8 +15,7 @@ func ParseVendorYML(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File) mf := new(modfile.File)
vendors := false vendors := false
path := "" path := ""
for lineno, line := range strings.Split(string(data), "\n") { for _, line := range strings.Split(string(data), "\n") {
lineno++
if line == "" { if line == "" {
continue continue
} }