Change-Id: I429db8dca219fb931f7b05ce7a7324e8c4ba935b
GitHub-Last-Rev:
2257a5bf23e7d79f54bedba2c2bed8c59bb6114c
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>
mf := new(modfile.File)
imports := false
name := ""
- for lineno, line := range strings.Split(string(data), "\n") {
- lineno++
+ for _, line := range strings.Split(string(data), "\n") {
if line == "" {
continue
}
func ParseGLOCKFILE(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File)
- for lineno, line := range strings.Split(string(data), "\n") {
- lineno++
+ for _, line := range strings.Split(string(data), "\n") {
f := strings.Fields(line)
if len(f) >= 2 && f[0] != "cmd" {
mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[1]}})
func ParseDependenciesTSV(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File)
- for lineno, line := range strings.Split(string(data), "\n") {
- lineno++
+ for _, line := range strings.Split(string(data), "\n") {
f := strings.Split(line, "\t")
if len(f) >= 3 {
mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[2]}})
func ParseVendorConf(file string, data []byte) (*modfile.File, error) {
mf := new(modfile.File)
- for lineno, line := range strings.Split(string(data), "\n") {
- lineno++
+ for _, line := range strings.Split(string(data), "\n") {
if i := strings.Index(line, "#"); i >= 0 {
line = line[:i]
}
mf := new(modfile.File)
vendors := false
path := ""
- for lineno, line := range strings.Split(string(data), "\n") {
- lineno++
+ for _, line := range strings.Split(string(data), "\n") {
if line == "" {
continue
}