Skip to content

Commit 81f6db9

Browse files
committed
src/goModules: update example module names to reflect naming guidelines
The newer guidelines specified by https://go-review.googlesource.com/c/website/+/344469 recommend using `example` instead of `example.com` when naming modules in a local context. Change-Id: I9fe5a6bb406d3f874e31751958e8f70e74034c12 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/349598 Trust: Suzy Mueller <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent ba2daa3 commit 81f6db9

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/goModules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export async function goModInit() {
193193
const moduleName = await vscode.window.showInputBox({
194194
prompt: 'Enter module name',
195195
value: '',
196-
placeHolder: 'example.com/m'
196+
placeHolder: 'example/project'
197197
});
198198

199199
const goRuntimePath = getBinPath('go');

test/integration/extension.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,8 @@ It returns the number of bytes written and any write error encountered.
725725
const vendorSupport = await isVendorSupported();
726726
const filePath = path.join(fixturePath, 'vendoring', 'main.go');
727727
const workDir = path.dirname(filePath);
728-
const vendorPkgsFullPath = ['test/testfixture/vendoring/vendor/example.com/vendorpls'];
729-
const vendorPkgsRelativePath = ['example.com/vendorpls'];
728+
const vendorPkgsFullPath = ['test/testfixture/vendoring/vendor/example/vendorpls'];
729+
const vendorPkgsRelativePath = ['example/vendorpls'];
730730

731731
const gopkgsPromise = getAllPackages(workDir).then((pkgMap) => {
732732
const pkgs = Array.from(pkgMap.keys()).filter((p) => {
@@ -785,7 +785,7 @@ It returns the number of bytes written and any write error encountered.
785785
} // not working in module mode.
786786
const vendorSupport = await isVendorSupported();
787787
const filePath = path.join(fixturePath, 'baseTest', 'test.go');
788-
const vendorPkgs = ['test/testfixture/vendoring/vendor/example.com/vendorpls'];
788+
const vendorPkgs = ['test/testfixture/vendoring/vendor/example/vendorpls'];
789789

790790
const gopkgsPromise = new Promise<void>((resolve, reject) => {
791791
const cmd = cp.spawn(getBinPath('gopkgs'), ['-format', '{{.ImportPath}}'], {
@@ -865,7 +865,7 @@ It returns the number of bytes written and any write error encountered.
865865
configWithoutIgnoringFolders
866866
).then((results) => {
867867
assert.equal(results[0].name, 'SomethingStrange');
868-
assert.equal(results[0].path, path.join(workspacePath, 'vendor/example.com/vendorpls/lib.go'));
868+
assert.equal(results[0].path, path.join(workspacePath, 'vendor/example/vendorpls/lib.go'));
869869
});
870870
const withIgnoringFolders = getWorkspaceSymbols(
871871
workspacePath,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module example.com/cwdTest
1+
module example/cwdTest
22

33
go 1.15

test/testdata/goTestTest/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module example.com/a
1+
module example/a
22

33
go 1.14

test/testdata/stretchrTestSuite/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module example.com/a
1+
module example/a
22

33
go 1.16
44

test/testdata/vendoring/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package main
22

33
import (
4-
"fmt"
4+
"fmt"
55

6-
"example.com/vendorpls"
6+
"example/vendorpls"
77
)
88

99
func main() {
10-
fmt.Prinln(vendorpls.F())
10+
fmt.Prinln(vendorpls.F())
1111
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package vendorpls
22

33
func F() string {
4-
return "vendor please"
4+
return "vendor please"
55
}
66

77
func SomethingStrange() {
88

9-
}
9+
}

0 commit comments

Comments
 (0)