Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3bf3ba2d
Commit
3bf3ba2d
authored
Jan 29, 2013
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/build: clean up after rollback
R=rsc CC=golang-dev
https://golang.org/cl/7237049
parent
ad37081b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
19 deletions
+1
-19
build.go
src/pkg/go/build/build.go
+1
-7
build_test.go
src/pkg/go/build/build_test.go
+0
-12
No files found.
src/pkg/go/build/build.go
View file @
3bf3ba2d
...
...
@@ -321,13 +321,7 @@ func (p *Package) IsCommand() bool {
// ImportDir is like Import but processes the Go package found in
// the named directory.
func
(
ctxt
*
Context
)
ImportDir
(
dir
string
,
mode
ImportMode
)
(
*
Package
,
error
)
{
p
,
err
:=
ctxt
.
Import
(
"."
,
dir
,
mode
)
// TODO(rsc,adg): breaks godoc net/http. Not sure why.
// See CL 7232047 and issue 4696.
if
false
&&
err
==
nil
&&
!
ctxt
.
isDir
(
p
.
Dir
)
{
err
=
fmt
.
Errorf
(
"%q is not a directory"
,
p
.
Dir
)
}
return
p
,
err
return
ctxt
.
Import
(
"."
,
dir
,
mode
)
}
// NoGoError is the error used by Import to describe a directory
...
...
src/pkg/go/build/build_test.go
View file @
3bf3ba2d
...
...
@@ -5,7 +5,6 @@
package
build
import
(
"fmt"
"os"
"path/filepath"
"runtime"
...
...
@@ -90,17 +89,6 @@ func TestLocalDirectory(t *testing.T) {
}
}
// golang.org/issue/3248
func
TestBogusDirectory
(
t
*
testing
.
T
)
{
return
// See issue 4696.
const
dir
=
"/foo/bar/baz/gopher"
_
,
err
:=
ImportDir
(
dir
,
FindOnly
)
want
:=
fmt
.
Sprintf
(
"%q is not a directory"
,
filepath
.
FromSlash
(
dir
))
if
err
==
nil
||
err
.
Error
()
!=
want
{
t
.
Errorf
(
"got error %q, want %q"
,
err
,
want
)
}
}
func
TestShouldBuild
(
t
*
testing
.
T
)
{
const
file1
=
"// +build tag1
\n\n
"
+
"package main
\n
"
...
...
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