feat: ignore comment in deps file
parent
7bda05e918
commit
43d228a258
|
@ -22,6 +22,7 @@ const (
|
||||||
goSumFile = "go.sum"
|
goSumFile = "go.sum"
|
||||||
|
|
||||||
defaultCountModule = 100
|
defaultCountModule = 100
|
||||||
|
depsFileComment = "#"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -156,10 +157,18 @@ func (a *action) runUpgradeModule(
|
||||||
modulePath string,
|
modulePath string,
|
||||||
) ([]Module, error) {
|
) ([]Module, error) {
|
||||||
modulePath = strings.TrimSpace(modulePath)
|
modulePath = strings.TrimSpace(modulePath)
|
||||||
|
|
||||||
|
// Ignore empty
|
||||||
if modulePath == "" {
|
if modulePath == "" {
|
||||||
return successUpgradedModules, nil
|
return successUpgradedModules, nil
|
||||||
}
|
}
|
||||||
a.log("Line: %s", modulePath)
|
|
||||||
|
// Ignore comment
|
||||||
|
if strings.HasPrefix(modulePath, depsFileComment) {
|
||||||
|
return successUpgradedModules, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
a.log("Module path: %s", modulePath)
|
||||||
|
|
||||||
// Check if modulePath is imported module, otherwise skip
|
// Check if modulePath is imported module, otherwise skip
|
||||||
if _, ok := mapImportedModules[modulePath]; !ok {
|
if _, ok := mapImportedModules[modulePath]; !ok {
|
||||||
|
|
Loading…
Reference in New Issue