Skip to content

Commit

Permalink
register => import
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Aug 26, 2023
1 parent b97b039 commit fc05265
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modfile/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (f *File) parseVerb(errs *ErrorList, verb string, line *Line, args []string
}
f.Gop = &Gop{Syntax: line}
f.Gop.Version = args[0]
case "import", "register":
case "import", "register": // register => import
if len(args) != 1 {
errorf("import directive expects exactly one argument")
return
Expand Down Expand Up @@ -534,7 +534,7 @@ const (

const (
directiveLineBlock = 0x80 + iota
directiveRegister
directiveImport
directiveRequire
directiveExclude
directiveReplace
Expand All @@ -545,7 +545,8 @@ var directiveWeights = map[string]int{
"module": directiveModule,
"go": directiveGo,
"gop": directiveGop,
"register": directiveRegister,
"import": directiveImport,
"register": directiveImport, // register => import
"require": directiveRequire,
"exclude": directiveExclude,
"replace": directiveReplace,
Expand Down

0 comments on commit fc05265

Please sign in to comment.