Skip to content

Commit

Permalink
Merge pull request #19 from xushiwei/q
Browse files Browse the repository at this point in the history
register => import
  • Loading branch information
xushiwei authored Aug 26, 2023
2 parents d5c8278 + fc05265 commit b9ac1f4
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 b9ac1f4

Please sign in to comment.