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
6a19ae74
Commit
6a19ae74
authored
Mar 08, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/build: add NoGoError
R=dsymonds CC=golang-dev
https://golang.org/cl/5781063
parent
8a1b3d5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
src/pkg/go/build/build.go
src/pkg/go/build/build.go
+11
-1
No files found.
src/pkg/go/build/build.go
View file @
6a19ae74
...
...
@@ -317,6 +317,16 @@ func (ctxt *Context) ImportDir(dir string, mode ImportMode) (*Package, error) {
return
ctxt
.
Import
(
"."
,
dir
,
mode
)
}
// NoGoError is the error used by Import to describe a directory
// containing no Go source files.
type
NoGoError
struct
{
Dir
string
}
func
(
e
*
NoGoError
)
Error
()
string
{
return
"no Go source files in "
+
e
.
Dir
}
// 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
...
...
@@ -602,7 +612,7 @@ Found:
}
}
if
p
.
Name
==
""
{
return
p
,
fmt
.
Errorf
(
"no Go source files in %s"
,
p
.
Dir
)
return
p
,
&
NoGoError
{
p
.
Dir
}
}
p
.
Imports
,
p
.
ImportPos
=
cleanImports
(
imported
)
...
...
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