Skip to content

Commit 3a5865c

Browse files
committed
modfile: rename directory directive to use
For golang/go#48257 Change-Id: I9cbb222c93a066717595bec14ff26f2902ef05d9 Reviewed-on: https://go-review.googlesource.com/c/mod/+/359412 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
1 parent c96bc14 commit 3a5865c

File tree

13 files changed

+99
-99
lines changed

13 files changed

+99
-99
lines changed

modfile/rule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string,
609609
f.Go = &Go{Syntax: line}
610610
f.Go.Version = args[0]
611611

612-
case "directory":
612+
case "use":
613613
if len(args) != 1 {
614614
errorf("usage: %s local/dir", verb)
615615
return
@@ -619,7 +619,7 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string,
619619
errorf("invalid quoted string: %v", err)
620620
return
621621
}
622-
f.Directory = append(f.Directory, &Directory{
622+
f.Use = append(f.Use, &Use{
623623
Path: s,
624624
Syntax: line,
625625
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// comment
2-
directory x // eol
2+
use x // eol
33

44
// mid comment
55

66
// comment 2
77
// comment 2 line 2
8-
directory y // eoy
8+
use y // eoy
99

1010
// comment 3

modfile/testdata/work/comment.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// comment
2-
directory "x" // eol
2+
use "x" // eol
33
// mid comment
44

55
// comment 2
66
// comment 2 line 2
7-
directory "y" // eoy
7+
use "y" // eoy
88
// comment 3

modfile/testdata/work/directory.golden

Lines changed: 0 additions & 7 deletions
This file was deleted.

modfile/testdata/work/directory.in

Lines changed: 0 additions & 7 deletions
This file was deleted.

modfile/testdata/work/replace.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
directory abc
1+
use abc
22

33
replace xyz v1.2.3 => /tmp/z
44

modfile/testdata/work/replace.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
directory "abc"
1+
use "abc"
22

33
replace "xyz" v1.2.3 => "/tmp/z"
44

modfile/testdata/work/replace2.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
directory abc
1+
use abc
22

33
replace (
44
xyz v1.2.3 => /tmp/z

modfile/testdata/work/replace2.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
directory "abc"
1+
use "abc"
22

33
replace (
44
"xyz" v1.2.3 => "/tmp/z"

modfile/testdata/work/use.golden

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use ../foo
2+
3+
use (
4+
/bar
5+
6+
baz
7+
)

0 commit comments

Comments
 (0)