...
Source file src/pkg/cmd/go/internal/modconv/glock.go
1
2
3
4
5 package modconv
6
7 import (
8 "strings"
9
10 "cmd/go/internal/modfile"
11 "cmd/go/internal/module"
12 )
13
14 func ParseGLOCKFILE(file string, data []byte) (*modfile.File, error) {
15 mf := new(modfile.File)
16 for _, line := range strings.Split(string(data), "\n") {
17 f := strings.Fields(line)
18 if len(f) >= 2 && f[0] != "cmd" {
19 mf.Require = append(mf.Require, &modfile.Require{Mod: module.Version{Path: f[0], Version: f[1]}})
20 }
21 }
22 return mf, nil
23 }
24
View as plain text