If $GOPATH was large, or $GOPATH was $HOME and $HOME/src had
many files, the unbounded concurrency in loadPkgIndex/loadPkg
could make the operating system unhappy with so many
threads. (sigh once again for no async file IO and needing
threads for file operations)
In addition, don't call go/build.Context.Import on directories
that we've already determined to have no go files in them.
It's just a waste of time. Makes it about 3x faster on my
machine with hot caches and a big $HOME/src.
Fixesgolang/go#7731
LGTM=iant, adg
R=golang-codereviews, iant, adg
CC=david.crawshaw, golang-codereviews
https://golang.org/cl/85670044
Side-effect: Because interfaces are now type-checked in reverse order,
cycle errors in interface declarations appear at the "end" rather than
at the "beginning" of the cycle in the source code. This is harmless.
Eventually we may want to do dependency order determination and thus
cycle detection for all types before fully type-checking them, which
might simplify some code and also produce consistently positioned cycle
errors again.
Fixesgolang/go#7158.
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/83640043
This avoids confusion when trying to read correctly
encoded export data that happens to be encoded in
a different format (debug vs product).
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/82090043
Details:
- auto-generate prefixes for std lib (e.g., "godex big" works now)
- apply filtering to package-level objects only
- nicer formatting of single-entry const, var, or type declaration
TBR=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/81360046
- Add missing methodset.html template file.
- Suppress initial display of package callgraph.
Client-side JS will make it visible if there is data.
LGTM=bgarcia
R=crawshaw, bgarcia
CC=golang-codereviews
https://golang.org/cl/81550043
Existing tools use the default value of zero; their behaviour is unchanged.
(*Config).ParseFile is used only from tests.
LGTM=crawshaw, rsc, gri
R=crawshaw, gri, rsc
CC=golang-codereviews
https://golang.org/cl/79290044
All of these work now as expected:
godex code.google.com/p/go.tools/go/types
godex go.tools/go/types
godex go/types
godex types
Also improved logging/verbose mode.
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/80930043
1) Split a path.name argument at the last '.' that
is not part of the path.
2) Try various importers always in the same order
for consistent results (use lists instead of maps).
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/80790043
goimports to use the package name as a local qualifier in an import.
For example, if findImports("pkg", "X") returns ("foo/bar",
rename=true), then goimports adds the import line:
import pkg "foo/bar"
to satisfy uses of pkg.X in the file.
This change doesn't add any implementations of rename=true, though one
is sketched in a TODO.
LGTM=crawshaw
R=crawshaw, rsc
CC=bradfitz, golang-codereviews
https://golang.org/cl/76400050
This change allows code to be sent safely to a partially sandboxed playground using the Native Client environment.
Execution of non-Go code is blocked when the RunScripts is false to prevent inclusion of code that might escape by virtue of being under a different runtime environment.
Two options for communicating whether to prevent non-Go code were considered: as has been done here and alternatively, using a message field. The latter was not chosen to close that as an attack option.
Another will be follow that adds a -nacl flag to the present command to allow sandboxing of playground code in presentations.
See discussion here: https://groups.google.com/d/topic/golang-dev/Hy-7PBP-T4Q/
LGTM=adg
R=adg, dave
CC=golang-codereviews
https://golang.org/cl/74740045
See analysis.go for overview of new features.
See README for known bugs and issues.
Much UI polish, testing and optimization work remains, but
this is a starting point.
Flag: we add a new flag -analysis=type,pointer, default "",
for adventurous users only at this stage.
Type analysis takes ~10s for stdlib + go.tools;
Pointer analysis (currently) takes several minutes.
Dependencies: we now include jquery.treeview.js and its GIF
images among the resources. (bake.go now handles binary.)
LGTM=crawshaw, bgarcia
R=crawshaw, bgarcia
CC=bradfitz, golang-codereviews
https://golang.org/cl/60540044
Also, add loader.Config.DisplayPath hook, which allows the
filename returned by build.Context.Import() to be transformed
prior to attaching to the AST. This allows a virtual file
system to be used without leaking into the user interface.
Eliminate parsePackageFiles hook; I don't think we need it any
more. The test that was using it has been rewritten to use
the build.Context hooks.
LGTM=gri
R=gri, crawshaw
CC=daniel.morsing, golang-codereviews, rsc
https://golang.org/cl/75520046
With this CL, an Object.Parent() Scope is always the scope in
which the object was originally declared. For dot-imported
objects, that is the package scope of the package from which
the objects are imported (not the file scope into which they
are imported).
Also:
- Changed Scope.Insert to be agnostic regarding blank
identifiers - blank identifiers must be handled outside.
- Fixed handling of blank labels: they are never declared.
Fixesgolang/go#7537.
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/75570043
It's pointless.
Also this fixes a crash, because the blank identifier no longer appears as a
defined object after CL 74190043 so we were getting nil pointer violations.
Even better, we get to re-enable a disabled test.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/75140043
e.g. file foo.go scope {...}
package math scope {...}
function f scope {...}
if scope {...}
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/74320043