1
0
mirror of https://github.com/golang/go synced 2024-10-04 10:21:21 -06:00
Commit Graph

3594 Commits

Author SHA1 Message Date
Russ Cox
bc83042b07 godoc: export pprof debug information
R=gri
CC=golang-dev
https://golang.org/cl/784041
2010-03-26 14:48:04 -07:00
Russ Cox
c72fb37425 prof: install gopprof too
This is a modified version of the open source pprof
from code.google.com/p/google-perftools.
That version is likely to catch up to this one,
but it's still useful to ship our own copy since
we only need the one script from that project,
not all the C++ libraries.

R=r
CC=golang-dev
https://golang.org/cl/783041
2010-03-26 14:20:50 -07:00
Russ Cox
4e28cfe970 runtime: run all finalizers in a single goroutine.
eliminate second pass of mark+sweep
by scanning finalizer table specially.

R=r
CC=golang-dev
https://golang.org/cl/782041
2010-03-26 14:15:30 -07:00
Charles L. Dorian
1ec91c8d1d math: add J1, Y1, Jn and Yn (Bessel functions)
Also amend j0.go (variable name conflict, small corrections).

R=rsc
CC=golang-dev
https://golang.org/cl/769041
2010-03-26 14:09:39 -07:00
Giles Lean
ad73de2f5f syscall: Create syscall_bsd.go for code used by Darwin and other *BSDs
In this change I'd like to combine the common code that is
present in syscall_darwin.go and syscall_freebsd.go.  I
have three reasons for wanting to do this now:

1. reducing code duplication is nearly always good :-)
2. the duplication will get worse if I duplicate this code
   a third time for the NetBSD port I'm working on, which
   I need to do almost immediately
3. by making this change all in one lump and ignoring any
   commonality with the syscall_linux*.go files the diff
   is long but, I think, readable

In future it may be possible to cherry pick functions that
also apply to Linux and put them in (say) syscall_unix.go,
and of course some functions may diverge in future and have
to move out to OS or architecture specific files, but today
I want just the low hanging fruit.

Tested and passed on:

  Darwin (Snow Leopard, 10.6): amd64 and 386
  FreeBSD (8.0-RELEASE):       386 only(*)

(*) All my virtualisation software has stopped playing nice
with FreeBSD for the moment, so I don't have facilities to
test the amd64 port.  As the OS X port is OK and the diff
looks all right to my eyes I shall keep my fingers crossed.
If someone with a FreeBSD/amd64 system cares to test and
report I would be appreciative.

2010-03-27 update: I have replaced my virtualisation software, and have working FreeBSD/i386 and FreeBSD/amd64 virtual machines again.

As I hoped (and expected -- programmers are optimists :-) the code built and passed all but the two currently known to fail tests on FreeBSD/amd64. I rechecked FreeBSD/i386 too: same results.

R=rsc
CC=golang-dev
https://golang.org/cl/751041
2010-03-26 13:23:54 -07:00
Robert Griesemer
d0ffee8abf bytes, strings: IndexOfAny
+ first use in go/doc

R=r
CC=golang-dev
https://golang.org/cl/781041
2010-03-26 13:05:04 -07:00
Rob Pike
9e481e2905 fix spelling of align
R=rsc
CC=golang-dev
https://golang.org/cl/778041
2010-03-26 09:56:57 -07:00
Firmansyah Adiputra
dab40b5880 xgb: fix request length and request size.
R=nigeltao_golang, rsc
CC=golang-dev
https://golang.org/cl/759041
2010-03-26 09:21:09 -07:00
Robert Griesemer
6358e1faf6 godoc: don't convert multi-line functions into one-liners by default
- new heuristic: if both the opening { and closing } braces are on the
  same line, and the function body doesn't contain comments or is other-
  wise too long (e.g. signature too long), it is formatted as a one-line
  function

- related cleanups along the way

- gofmt -w src misc led to no additional changes as expected

R=rsc, rsc1
CC=golang-dev, ken2, r
https://golang.org/cl/758041
2010-03-25 16:59:02 -07:00
Russ Cox
7fbf9fcba9 make alignment rules match 8g, just like 6c matches 6g.
R=ken2
CC=golang-dev
https://golang.org/cl/760042
2010-03-25 14:05:54 -07:00
Russ Cox
78c27ed650 gc: more syntax errors
R=r
CC=golang-dev
https://golang.org/cl/731041
2010-03-25 12:47:43 -07:00
Rob Pike
4b40426a90 Add strconv.Atob, Btoa.
Fixes #639

R=rsc
CC=golang-dev
https://golang.org/cl/755041
2010-03-25 11:50:07 -07:00
Ian Lance Taylor
732f3919ab Support #pragma dynexport on OS X.
R=rsc
CC=golang-dev
https://golang.org/cl/733041
2010-03-25 11:45:18 -07:00
Christopher Wedgwood
7f2ea938ed syscall: Implement SetsockoptString
R=rsc, r
CC=golang-dev
https://golang.org/cl/739042
2010-03-24 22:36:38 -07:00
Giles Lean
729ccb5751 syscall: bring generated files zsyscall_darwin_*.go
up to date.

No functional change, but when these files are regenerated
they change, leading to noisy diffs when working in the
syscall package.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/705043
2010-03-24 21:59:21 -07:00
Alex Brainman
a24cf69fd8 runtime: fix mingw build, implement missing destroylock()
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/747041
2010-03-24 18:03:10 -07:00
Ken Thompson
623dfd1b07 depricate panicln
R=rsc
CC=golang-dev
https://golang.org/cl/743041
2010-03-24 16:53:54 -07:00
Rob Pike
325cf8ef21 delete all uses of panicln by rewriting them using panic or,
in the tests, println+panic.
gofmt some tests too.

R=rsc
CC=golang-dev
https://golang.org/cl/741041
2010-03-24 16:46:53 -07:00
Robert Griesemer
acfd6d5f05 godoc: show relative file names without leading '/' (per r's request)
- change the various url-xxx formatters to return a relative URL path
- make the leading '/' for URLs explicit in the template
- on the way change some |html formatters to |html-esc
  (html should only be used for formatting AST nodes)

R=rsc, r
CC=golang-dev
https://golang.org/cl/740041
2010-03-24 16:28:59 -07:00
Robert Griesemer
60482f06d0 godoc: use http GET for remote search instead of rpc
(this will allow the use of golang.org for remote
searches)

R=rsc
CC=golang-dev
https://golang.org/cl/734041
2010-03-24 14:51:55 -07:00
Russ Cox
6eb251f244 runtime: malloc sampling, pprof interface
R=r
CC=golang-dev
https://golang.org/cl/719041
2010-03-24 09:40:09 -07:00
Charles L. Dorian
6b6c3993d5 math: add J0 and Y0 (Bessel functions)
R=rsc
CC=golang-dev
https://golang.org/cl/661044
2010-03-24 09:25:49 -07:00
Russ Cox
1c7cc5bd7a cc: fix typo
R=iant
CC=golang-dev
https://golang.org/cl/720041
2010-03-24 08:59:09 -07:00
Russ Cox
596c16e045 runtime: add memory profiling, disabled.
no way to get the data out yet.

add prototype for runtime.Callers,
missing from last CL.

R=r
CC=golang-dev
https://golang.org/cl/713041
2010-03-23 20:48:23 -07:00
Dean Prichard
72bc37c122 arm: fix build
R=kaib, rsc
CC=golang-dev
https://golang.org/cl/627045
2010-03-23 18:13:20 -07:00
Andrey Mirtchovski
456642adb5 cmd/goinstall: include command name in error reporting (usually missing software or incorrect $PATH)
R=rsc
CC=golang-dev
https://golang.org/cl/695041
2010-03-23 18:13:16 -07:00
Russ Cox
eaf45f2d56 gc: fix build in France
Fixes #626.

R=ken2
CC=golang-dev
https://golang.org/cl/714041
2010-03-23 18:11:21 -07:00
Fumitoshi Ukai
371496e0b8 websocket: implement new protocol
http://www.whatwg.org/specs/web-socket-protocol/
(draft of draft-hixie-thewebsocketprotocol-76)

draft-hixie-thewebsocketprotocol-76 will introduce new handshake
incompatible draft 75 or prior.
http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol

R=rsc
CC=golang-dev
https://golang.org/cl/583041
2010-03-23 18:09:24 -07:00
Giles Lean
2ab9114dd7 Trivial: remove duplicate line #include <sys/types.h>
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/645044
2010-03-23 17:52:16 -07:00
Russ Cox
556ae65d36 fix build - unused import
R=gri
CC=golang-dev
https://golang.org/cl/711041
2010-03-23 17:34:13 -07:00
Russ Cox
2b7d147f1a runtime: add Callers
cut copies of traceback from 6 to 1.

R=r
CC=golang-dev
https://golang.org/cl/703041
2010-03-23 17:01:17 -07:00
Russ Cox
32c39fa1b7 go/printer: avoid reflect in print
R=gri
CC=golang-dev
https://golang.org/cl/704041
2010-03-23 16:56:48 -07:00
Kyle Consalus
a65a56ec1f xml: add line numbers to syntax errors.
R=rsc
CC=golang-dev
https://golang.org/cl/699041
2010-03-23 13:20:16 -07:00
Ken Thompson
e781303e27 maps access to a missing key
will return the "zero" value

R=rsc
CC=golang-dev
https://golang.org/cl/700041
2010-03-23 13:00:02 -07:00
Kyle Consalus
66caa38d49 xml: add CopyToken
R=rsc
CC=golang-dev
https://golang.org/cl/634042
2010-03-23 09:43:20 -07:00
Ian Lance Taylor
9e0ae94e72 Add support for #pragma dynexport.
R=rsc
CC=golang-dev
https://golang.org/cl/661043
2010-03-23 06:46:30 -07:00
Ian Lance Taylor
f54d73b880 Rename dynld to dynimport throughout.
Cgo users will need to rerun cgo.

R=rsc
CC=golang-dev
https://golang.org/cl/692041
2010-03-22 19:58:55 -07:00
Russ Cox
4408659e81 gc: various map-related bug fixes
Fixes #687.

R=ken2
CC=golang-dev
https://golang.org/cl/680042
2010-03-22 18:51:14 -07:00
Andrew Gerrand
51a7f1c9d6 ast/printer: support for printing ast.Spec nodes
R=gri
CC=golang-dev
https://golang.org/cl/682041
2010-03-23 09:00:47 +11:00
Russ Cox
2e5fe5a14c goinstall: let git/hg/svn create the final directory element
R=r
CC=golang-dev
https://golang.org/cl/634044
2010-03-20 22:38:06 -07:00
Russ Cox
aceba042d6 libmach: more info when memory reads fail on Darwin
R=r
CC=golang-dev
https://golang.org/cl/604043
2010-03-20 22:37:23 -07:00
Ken Thompson
8021296179 issue 682
complex DATA statement fo
initialization of complex variables.

R=rsc
CC=golang-dev
https://golang.org/cl/634045
2010-03-20 18:50:01 -07:00
Robert Griesemer
6c8fdbe8c7 godoc: line numbers for all remote search results
Instead of returning the index lookup result via
RPC which has to be corrected for the client,
simply render it on the server and return the
final output.

R=rsc, r
CC=golang-dev
https://golang.org/cl/669041
2010-03-19 22:48:08 -07:00
Russ Cox
e8fb0b014c godoc: revert change 5089, per gri's instructions
R=gri
CC=golang-dev
https://golang.org/cl/630043
2010-03-19 17:46:18 -07:00
Robert Griesemer
b037bfa684 godoc: proper file path conversion for remote search
R=rsc
CC=golang-dev
https://golang.org/cl/664041
2010-03-19 17:07:16 -07:00
Rob Pike
f9d6af9fb8 Make.cmd: make 'all' the default target (was 'clean': BUG)
R=rsc
CC=golang-dev
https://golang.org/cl/661041
2010-03-19 16:33:27 -07:00
Russ Cox
b21f3137a4 os: drop File finalizer after normal Close
R=r
CC=golang-dev
https://golang.org/cl/586043
2010-03-19 16:28:32 -07:00
Andrew Gerrand
f4322a848d http: add Error helper function
R=r, rsc
CC=golang-dev
https://golang.org/cl/626042
2010-03-20 10:22:09 +11:00
Charles L. Dorian
26f0c83eb8 math: add Gamma function
R=rsc
CC=golang-dev
https://golang.org/cl/649041
2010-03-19 15:29:22 -07:00
Alex Brainman
64f33880e5 syscall: mingw implemntation of Errstr()
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/621041
2010-03-19 15:21:37 -07:00
Robert Griesemer
fa462f37e3 godoc: show (some) line numbers for remote search
- show build version
- use build goroot when possible

R=rsc
CC=golang-dev
https://golang.org/cl/656043
2010-03-19 15:20:20 -07:00
Alex Brainman
b0c6bba8e8 syscall: mksyscall_mingw.sh emitting shorter calls (to Syscall or Syscall6) when there are fewer arguments
R=rsc
CC=golang-dev
https://golang.org/cl/622041
2010-03-19 15:17:18 -07:00
Rob Pike
14abacf108 Factor the Makefiles to make writing outside Makefiles easier.
R=rsc
CC=golang-dev
https://golang.org/cl/650042
2010-03-19 15:14:46 -07:00
Ken Thompson
60c2e5f453 issue 608
error compiling if(long long) in 6c compiler

R=rsc
CC=golang-dev
https://golang.org/cl/657042
2010-03-19 14:20:15 -07:00
Fumitoshi Ukai
f15447ca3e websocket: use URL.RawPath to construct WebSocket-Location: header
R=rsc
CC=golang-dev
https://golang.org/cl/651041
2010-03-19 14:18:02 -07:00
Alex Brainman
71e402d8ff deps.bash: handle Makefiles with .go filenames that include $(GOOS) and $(GOARCH)
R=rsc
CC=golang-dev
https://golang.org/cl/642042
2010-03-19 14:17:07 -07:00
Robert Griesemer
90f7209548 godoc: improved comment formatting: recognize URLs
and highlight special words, if provided. Also:

- related cleanups in src/pkg/go/doc/comment.go
- fix typos in src/cmd/goinstall/doc.go

Fixes #672.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/601042
2010-03-19 13:01:45 -07:00
Robert Griesemer
17e0351404 godoc: implemented command-line search
The command-line search is using a running webserver
as index server; i.e., the search result is reflecting
the index at the server. See the documentation for
details.

Usage: godoc -q query1 query2 ...

Known issue: Results don't show the all-important
line numbers yet due to the way the index is organized.
Next CL.

R=rsc, r
CC=golang-dev
https://golang.org/cl/648041
2010-03-19 12:46:43 -07:00
Andrew Gerrand
c10ccd567d template: fixed html formatter bug where it would turn a []byte
into a string of decimal numbers.

R=r, rsc
CC=golang-dev
https://golang.org/cl/624041
2010-03-19 09:46:39 +11:00
Robert Griesemer
4467037353 rpc documentation cleanup: remove ;'s from code in documentation
R=r
CC=golang-dev
https://golang.org/cl/624042
2010-03-18 14:10:25 -07:00
Robert Griesemer
7f7751837c go/doc cleanup: remove some unnecessary string conversions
R=rsc
CC=golang-dev
https://golang.org/cl/642041
2010-03-18 14:09:17 -07:00
Alex Brainman
8c24fa95aa Fix src/pkg/syscall/mkall.sh: don't assume that . is on PATH.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/614042
2010-03-17 20:07:14 -07:00
Ian Lance Taylor
332ff67ee2 Fix build: don't assume that . is on PATH.
R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/610043
2010-03-17 10:08:27 -07:00
Russ Cox
908efdb5ac crypto/rand: new package
Until proven insufficient, rely on the operating system
to give us good random bytes (/dev/urandom).

R=agl1
CC=golang-dev
https://golang.org/cl/569044
2010-03-16 23:12:20 -07:00
Russ Cox
0c3a93ceb7 runtime: add GOROOT and Version
R=r
CC=golang-dev
https://golang.org/cl/608041
2010-03-16 23:10:33 -07:00
Alex Brainman
5e6203d28b syscall: more changes to mingw version
- mkall now generates syscall stabs automatically
- we can call unicode versions of winapi now
- introduce GetErrstr function to fetch error text given errno
- general cleanup

R=rsc
CC=golang-dev
https://golang.org/cl/562041
2010-03-16 23:10:07 -07:00
Andrew Gerrand
9d930040d7 json: add MarshalIndent (accepts user-specified indent string)
Fixes #661

R=r, rsc, skorobo
CC=golang-dev
https://golang.org/cl/576042
2010-03-17 15:41:16 +11:00
Russ Cox
e153d3d818 syscall: add const ARCH, analogous to OS
R=r
CC=giles, golang-dev
https://golang.org/cl/600041
2010-03-16 18:45:48 -07:00
Russ Cox
cf5ee36aa0 version.bash: cope with ancient Mercurial
R=adg
CC=dpx, golang-dev
https://golang.org/cl/593043
2010-03-16 18:45:06 -07:00
Russ Cox
141821d512 http: change RawPath to mean raw path, not raw everything-after-scheme.
The new meaning is more useful for both websocket and http.

R=r, petar-m, ukai
CC=golang-dev, madari
https://golang.org/cl/582043
2010-03-16 18:44:55 -07:00
Russ Cox
c75f891a72 utf16: new package
needed for interacting with various legacy interfaces,
like Windows and the Mac OS clipboard.

R=r
CC=golang-dev
https://golang.org/cl/595041
2010-03-16 18:44:37 -07:00
Andrew Gerrand
67148530d2 goinstall doc: fix link to godashboard/package
R=rsc
CC=golang-dev
https://golang.org/cl/607041
2010-03-17 11:40:05 +11:00
Robert Griesemer
53f3d0733c gofmt: more consistent formatting of const/var decls
- gofmt -w src misc
- only manually modified file: src/pkg/go/printer/nodes.go

R=rsc
CC=golang-dev, r
https://golang.org/cl/606041
2010-03-16 16:45:54 -07:00
Robert Griesemer
74fac99d05 godoc: initial support for showing popup information
for identifiers in Go source code

- at the moment just show identifier kind (var, func, etc.) and name
  (eventually should show declaration, type, etc.)
- JavaScript parts by adg

R=rsc
CC=adg, golang-dev
https://golang.org/cl/578042
2010-03-16 14:17:42 -07:00
Russ Cox
0b986316b8 net: fix IPMask.String not to crash on all-0xff mask
R=r
CC=golang-dev
https://golang.org/cl/438042
2010-03-16 14:16:33 -07:00
Petar Maymounkov
7f4c2caea5 http: add ParseQuery
R=rsc
CC=golang-dev
https://golang.org/cl/238041
2010-03-16 13:57:16 -07:00
Conrad Meyer
899e2e6e0c sha512: add sha384 (truncated version)
R=rsc
CC=golang-dev
https://golang.org/cl/317041
2010-03-16 13:26:21 -07:00
Robert Griesemer
926f59ba14 image/jpeg: fix typos
Fixes #665.

R=nigeltao, nigeltao_golang
CC=golang-dev
https://golang.org/cl/570041
2010-03-15 22:10:47 -07:00
Russ Cox
acfd7b8d12 runtime: lock finalizer table accesses
R=r
CC=golang-dev
https://golang.org/cl/462043
2010-03-15 20:29:17 -07:00
Robert Griesemer
b32f22b3f8 gofmt: fix for gofmt rewrite feature
Fixes #643.

R=rsc
CC=golang-dev
https://golang.org/cl/576041
2010-03-15 15:42:09 -07:00
Robert Griesemer
226c2ec256 godoc: support for multiple packages in a directory
- smartly select the "right" package
- provide a list of other packages

R=rsc
CC=golang-dev
https://golang.org/cl/466042
2010-03-12 18:16:21 -08:00
Russ Cox
1a5cd2c0e1 hash/crc64: new package implementing 64-bit CRC
hash/crc32: add Update function
hash: add Sum64 interface

R=r
CC=golang-dev
https://golang.org/cl/445042
2010-03-12 17:38:18 -08:00
Robert Griesemer
67f1becad6 gofmt: make sure there is a newline after
a /*-style comment at the end of a file

Some minor cleanups/typo fixes along the way.

Fixes an issue where that newline was removed
after applying gofmt.

R=r
CC=golang-dev
https://golang.org/cl/476043
2010-03-12 14:54:06 -08:00
Robert Griesemer
ee0c35be85 go/printer: fix a couple of hidden crashes that become
visible only when enabling internal debug mode:
- in rare cases expression depth can underflow
- when printing a single labeled statement, indentation
  may underflow if not setup correctly

R=rsc
CC=golang-dev
https://golang.org/cl/484041
2010-03-12 14:01:52 -08:00
Robert Griesemer
f7c27b9af9 ast/filter.go: missing nil-check causes crash
R=rsc
CC=golang-dev
https://golang.org/cl/461041
2010-03-11 17:39:55 -08:00
Robert Griesemer
3e24f2d6df godoc: fix formatting of -src output
- go/filter.go: make MergePackageFiles smarter
- go/printer.go: handle positions from multiple files

R=rsc
CC=golang-dev
https://golang.org/cl/460042
2010-03-11 16:44:56 -08:00
Robert Griesemer
8107cad45a math, path: minor comment fixes
R=r
CC=golang-dev
https://golang.org/cl/444043
2010-03-11 16:40:32 -08:00
Christopher Wedgwood
698bc461bf syslog: increase test timeout from 10ms to 100ms
Problem pointed out by rsc.

R=rsc
CC=golang-dev
https://golang.org/cl/444041
2010-03-11 09:46:16 -08:00
Robert Griesemer
2a62195153 math package: minor documentation fix
R=rsc
CC=golang-dev
https://golang.org/cl/424041
2010-03-10 17:04:43 -08:00
Robert Griesemer
799609e0b4 godoc: change -x to -src, update doc.go (missed in previous CL)
R=rsc
CC=golang-dev
https://golang.org/cl/384044
2010-03-10 15:41:36 -08:00
Robert Griesemer
35aec6c7f7 godoc: provide mode which shows exported interface in "source form"
- on the commandline: godoc -x big
- in a webpage: provide form parameter ?m=src

Known issues:
- Positioning of comments incorrect in several cases. Separate CL.
- Need a link/menu to switch between different modes of presentation
  in the web view.

R=rsc
CC=golang-dev
https://golang.org/cl/376041
2010-03-10 15:22:22 -08:00
Russ Cox
16e6df9807 fix 386 a[i] = cmplx(r, j)
R=ken2
CC=golang-dev
https://golang.org/cl/384043
2010-03-10 13:06:35 -08:00
Andrew Gerrand
a2772a593b template: add ParseFile, MustParseFile, and associated tests
R=r
CC=golang-dev
https://golang.org/cl/391041
2010-03-10 20:19:20 +11:00
Ken Thompson
2edb02b41e 1. decommit complex(float) conversion
2. add complex algorithm for map/chan
3. test for use of complex in
   array, slice, field, chan, map,
   field, pointer.

R=rsc
CC=golang-dev
https://golang.org/cl/384041
2010-03-09 17:51:30 -08:00
Russ Cox
529369e452 gc: remove duplicate errors, give better error for I.(T)
R=ken2
CC=golang-dev
https://golang.org/cl/370041
2010-03-09 15:09:37 -08:00
Alex Brainman
e00795859b syscall: minimal mingw version of syscall to call windows dlls
lots of missing parts, but builds and can call dlls, see a sample code in syscall_mingw.go

R=rsc
CC=golang-dev
https://golang.org/cl/218042
2010-03-09 15:09:09 -08:00
Dean Prichard
75e5ece03a reflect: typo in comment
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/369041
2010-03-10 10:00:10 +11:00
Rob Pike
9280b746ee fmt: enable the complex tests now that 8g supports complex
R=rsc
CC=golang-dev
https://golang.org/cl/357043
2010-03-09 14:17:14 -08:00
Ken Thompson
38ad41c317 fix bugs compiling things like
c = cmplx(imag(c), real(c))
without a temporary

R=rsc
CC=golang-dev
https://golang.org/cl/360043
2010-03-09 13:39:45 -08:00
Ken Thompson
f229c8b546 identical complex implementation
for 6g and 8g. can also be used
for 5g. 5g is still a stub.

R=rsc
CC=golang-dev
https://golang.org/cl/362041
2010-03-09 12:49:24 -08:00