Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
036731c1
Commit
036731c1
authored
Mar 14, 2012
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/build: clearer argument name for Import (src -> srcDir)
R=rsc CC=golang-dev
https://golang.org/cl/5820052
parent
95a8bab7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/pkg/go/build/build.go
src/pkg/go/build/build.go
+9
-9
No files found.
src/pkg/go/build/build.go
View file @
036731c1
...
...
@@ -328,10 +328,10 @@ func (e *NoGoError) Error() string {
}
// Import returns details about the Go package named by the import path,
// interpreting local import paths relative to the src
directory. If the path
//
is a local import path naming a package that can be imported using a
//
standard import path, the returned package will set p.ImportPath to
// that path.
// interpreting local import paths relative to the src
Dir directory.
//
If the path is a local import path naming a package that can be imported
//
using a standard import path, the returned package will set p.ImportPath
// t
o t
hat path.
//
// In the directory containing the package, .go, .c, .h, and .s files are
// considered part of the package except for:
...
...
@@ -343,7 +343,7 @@ func (e *NoGoError) Error() string {
// If an error occurs, Import returns a non-nil error also returns a non-nil
// *Package containing partial information.
//
func
(
ctxt
*
Context
)
Import
(
path
string
,
src
string
,
mode
ImportMode
)
(
*
Package
,
error
)
{
func
(
ctxt
*
Context
)
Import
(
path
string
,
src
Dir
string
,
mode
ImportMode
)
(
*
Package
,
error
)
{
p
:=
&
Package
{
ImportPath
:
path
,
}
...
...
@@ -363,11 +363,11 @@ func (ctxt *Context) Import(path string, src string, mode ImportMode) (*Package,
binaryOnly
:=
false
if
IsLocalImport
(
path
)
{
if
src
==
""
{
if
src
Dir
==
""
{
return
p
,
fmt
.
Errorf
(
"import %q: import relative to unknown directory"
,
path
)
}
if
!
ctxt
.
isAbsPath
(
path
)
{
p
.
Dir
=
ctxt
.
joinPath
(
src
,
path
)
p
.
Dir
=
ctxt
.
joinPath
(
src
Dir
,
path
)
}
// Determine canonical import path, if any.
if
ctxt
.
GOROOT
!=
""
{
...
...
@@ -640,8 +640,8 @@ func cleanImports(m map[string][]token.Position) ([]string, map[string][]token.P
}
// Import is shorthand for Default.Import.
func
Import
(
path
,
src
string
,
mode
ImportMode
)
(
*
Package
,
error
)
{
return
Default
.
Import
(
path
,
src
,
mode
)
func
Import
(
path
,
src
Dir
string
,
mode
ImportMode
)
(
*
Package
,
error
)
{
return
Default
.
Import
(
path
,
src
Dir
,
mode
)
}
// ImportDir is shorthand for Default.ImportDir.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment