- add tests for Open, ReadDir, and Stat funcs
- add tests for Seek of Open()
- simplify internal handling of absolute vs. "zip" paths
- fix handling of "/"
The fix special cases this scenario, leaving the codepath for all
other file paths the same. Specifically,
- Exported funcs call stat(), so stat("/") is handled by simply
returning 0 to indicate all entries are (effectively) prefixed
by "/" and zipFI{"", nil} because "/" has no name and nil
indicates it is a directory.
- ReadDir("/") is further handled by seeding the existing lookup
logic with "" instead of what would have been "/". This is
necessary because, per the zipfs spec, the zip file entries MUST
NOT start with "/", so using "/" would incorrectly match nothing.
This works because seeding lookup with "" (correctly) matches
all files and then the following, existing logic (correctly) pares
things down to just the files in the root directory; not in any
subdirectories.
Verified that godoc -zip still works.
Fixesgolang/go#12743
Change-Id: Icb5f01b8a29cefa4e2820135f318894042970301
Reviewed-on: https://go-review.googlesource.com/16925
Reviewed-by: Andrew Gerrand <adg@golang.org>
Use the compiler intrinsic __builtin_popcount.
Change-Id: I58286fbcf66d1068390ea9caff2f98b8fe244c2d
Reviewed-on: https://go-review.googlesource.com/16831
Reviewed-by: Andrew Gerrand <adg@golang.org>
Change-Id: I6f3b351d42f5534dd5a5ff161f1e5680b4dbfd58
Reviewed-on: https://go-review.googlesource.com/16793
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The example incorrectly used buildutil.TagsDoc identifier which does not
exist. It should be buildutil.TagsFlagDoc instead.
The issue was introduced in https://golang.org/cl/9172 when this code was
first written.
Also use more idiomatic style for Go comments, '//' followed by a space,
then tab (instead of skipping the space). Although both render correctly
in godoc, this form is more correct and consistent.
Change-Id: I3b3c9767fe313106a8ff81e7887f3241c5806b59
Reviewed-on: https://go-review.googlesource.com/16743
Reviewed-by: Alan Donovan <adonovan@google.com>
when handling text line by line, the current line will be ignored if it
may be a command line, so we should stack back this line for further parse.
Fixesgolang/go#11435
Change-Id: If0567c46c90d09b30e78b72f24395725b9e00ea3
Reviewed-on: https://go-review.googlesource.com/16410
Reviewed-by: Andrew Gerrand <adg@golang.org>
There is no need to add play.js in article page when
playground is disabled.
Signed-off-by: Tw <tw19881113@gmail.com>
Change-Id: If40d256c89d7bd37efff9e08bb176bd3ea2d6f88
Reviewed-on: https://go-review.googlesource.com/16415
Reviewed-by: Andrew Gerrand <adg@golang.org>
Add an ;;;###autoload magic comment, so that the go-rename command can be used
without need to explicitly (require 'go-rename) first.
Change-Id: Ibdf9886fe98c55e1d948469aac972b568649f910
Reviewed-on: https://go-review.googlesource.com/16327
Reviewed-by: Alan Donovan <adonovan@google.com>
This would cause oracle callee lookup failures when the RHS is an
invoke-style call.
Fixesgolang/go#12999
Change-Id: Ifd561c4e7bf26f57ace5f62afac746b926c70993
Reviewed-on: https://go-review.googlesource.com/16210
Reviewed-by: Alan Donovan <adonovan@google.com>
The command's documentation mistakingly said that the instructions for
testing and deployment to App Engine were contained in the top-level
README for the tools repository. As best as I can tell, the top-level
README never contained this information.
This commit adds a configuration fragment and provides sample
instructions for the App Engine workflow.
Change-Id: If89c099e254ef91ca224742aebd81f7d1206d9b8
Reviewed-on: https://go-review.googlesource.com/15685
Reviewed-by: Andrew Gerrand <adg@golang.org>
- copied all affected xxx.go files to a respective xxx14.go file
- added build tags
- no other source changes
Change-Id: Ic150a097e537ee29a0e0616ab8e1e74b21e3066d
Reviewed-on: https://go-review.googlesource.com/15702
Reviewed-by: Alan Donovan <adonovan@google.com>
App Engine is amd64 but it doesn't support uploading assembly files.
Use the explicit build tag so that it selects the generic implementation
on App Engine.
This is required to deploy golang.org.
Change-Id: I7374c91961c53d59f6fdcc9ac98b8a9cec755b2c
Reviewed-on: https://go-review.googlesource.com/15246
Reviewed-by: Andrew Gerrand <adg@golang.org>
This function accounts for 2% of "godoc -analysis=pointer"
and this change makes it twice as fast---and simpler.
Added test and benchmark.
Change-Id: I8578fa42dce34df057d81f6c522a7b4e0506d09d
Reviewed-on: https://go-review.googlesource.com/15211
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
These codes were initially included because of a miscommunication.
They should not be in the list at all.
Fixesgolang/go#12747
Change-Id: I1a53e9c7be8edf5e1dbb95cd03101b93023a12c1
Reviewed-on: https://go-review.googlesource.com/15082
Reviewed-by: Andrew Gerrand <adg@golang.org>
Unlike in BSD, in GNU/Linux find option for -depth is without an
argument. To make the command compatible in both system, use
-mindepth and -maxdepth arguments.
Change-Id: Ie82736fd2c28b6fe0f64dbfc7272f0e0f0d8e8df
Reviewed-on: https://go-review.googlesource.com/15014
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
These were built inside Google but have been in production for years.
Move them into the public tools repository so that they can be more
easily maintained.
This is step one to moving the entire golang.org deployment process out
of Google's internal source repository.
Change-Id: I72f875c5020b3f58f1c0cea1d19268e0f991833f
Reviewed-on: https://go-review.googlesource.com/14842
Reviewed-by: Chris Broadfoot <cbro@golang.org>
The documentation for the testing package states only that "The suffix
must start with a lower-case letter."
Fixesgolang/go#12663
Change-Id: I9b079b105a7c9680325fed442c42adcf3b75055e
Reviewed-on: https://go-review.googlesource.com/14760
Reviewed-by: Andrew Gerrand <adg@golang.org>
This adds a missing memory barrier at the end of Package.Build.
Change-Id: Ife35d5ad5a48ba121f35656fef682863d4f2aef6
Reviewed-on: https://go-review.googlesource.com/14761
Reviewed-by: Robert Griesemer <gri@golang.org>
Also make health check test the backup process.
Change-Id: I9d2ed2780c07bb08683d231fccad4674c2ac22a1
Reviewed-on: https://go-review.googlesource.com/14668
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This was formerly inserted by some deployment scripts. Putting it in
the code here simplifies deployment at little cost to other users.
Change-Id: Ic092bb560c4c90e0e5bc6f9f33426b35214d613d
Reviewed-on: https://go-review.googlesource.com/14741
Reviewed-by: Andrew Gerrand <adg@golang.org>
This was preventing the playground /compile and /share handlers
from being registered under Managed VMs.
Change-Id: I690bd50abc2f42b30956e734903d09487f712d4a
Reviewed-on: https://go-review.googlesource.com/14665
Reviewed-by: Andrew Gerrand <adg@golang.org>
This will allow us to serve blog.golang.org and talks.golang.org from
the latest sources without re-deploying.
Change-Id: I2399a8a7eb60a0c6648916052f5f129cb826d546
Reviewed-on: https://go-review.googlesource.com/14662
Reviewed-by: Andrew Gerrand <adg@golang.org>
The existing list of checks in doc.go has become somewhat unwieldy.
This commit is purely cosmetic and sorts the list alphabetically keyed
by the flag name.
Change-Id: Ibb56357f9d4667d199acc6637dc28f6e17903046
Reviewed-on: https://go-review.googlesource.com/14558
Reviewed-by: Rob Pike <r@golang.org>
This commit fixes a few defects from a25a8d567b:
(1.) Making the top-level vars in main consistent w.r.t. documentation
formatting, and the-like.
(2.) Removing of one-use top-level is-test predicate.
(3.) Including documentation of what the validation does and when.
Change-Id: I19b34d25836bb2af865219d18600e1add78c3fd7
Reviewed-on: https://go-review.googlesource.com/14557
Reviewed-by: Rob Pike <r@golang.org>
In spite of https://blog.golang.org/examples and
http://golang.org/pkg/testing/#pkg-examples, a number of internal Go
authors have found writing documentation examples to be problematic in
the sense that the syntax is error-prone due to loose coupling with
identifiers found in the source corpus.
This commit introduces a suite of validations for documentation
examples:
Overall:
- Correct suffices, if present
- Niladic function argument and return signatures
func Example() {}
func ExampleF() {}
- F exists
func ExampleT() {}
- T exists
func ExampleT_M() {}
- T exists
- M exists within T
Further, if the example is in `package foo_test`, vet attempts to
resolve the respective lookups in `package foo`, if `package foo`
exists (cf., `package stringutil_test`).
Change-Id: Ifa13906363541ebf28325681b749b14b7f8b103d
Reviewed-on: https://go-review.googlesource.com/11982
Reviewed-by: Andrew Gerrand <adg@golang.org>