(file *model.File)
| 98 | } |
| 99 | |
| 100 | func ParseRequirementIn(file *model.File) *model.DepGraph { |
| 101 | |
| 102 | root := &model.DepGraph{Path: file.Relpath()} |
| 103 | |
| 104 | file.ReadLine(func(line string) { |
| 105 | |
| 106 | if strings.HasPrefix(line, `#`) { |
| 107 | return |
| 108 | } |
| 109 | |
| 110 | words := strings.Fields(line) |
| 111 | if len(words) > 0 { |
| 112 | dep := &model.DepGraph{} |
| 113 | dep.Name = words[0] |
| 114 | dep.Version = strings.Join(words[1:], "") |
| 115 | root.AppendChild(dep) |
| 116 | } |
| 117 | |
| 118 | }) |
| 119 | |
| 120 | return root |
| 121 | } |
no test coverage detected