go/src/pkg
Rob Pike 570f59c109 new command gotry.
An exercise in reflection and an unusual tool.

From the usage message:

usage: gotry [packagedirectory] expression ...
Given one expression, gotry attempts to evaluate that expression.
Given multiple expressions, gotry treats them as a list of arguments
and result values and attempts to find a function in the package
that, given the first few expressions as arguments, evaluates to
the remaining expressions as results.  If the first expression has
methods, it will also search for applicable methods.

If there are multiple expressions, a package directory must be
specified. If there is a package argument, the expressions are
evaluated in an environment that includes
	import . "packagedirectory"

Examples:
	gotry 3+4
		# evaluates to 7
	gotry strings '"abc"' '"c"' 7-5
		# finds strings.Index etc.
	gotry regexp 'MustCompile("^[0-9]+")' '"12345"' true
		# finds Regexp.MatchString

R=rsc, PeterGo, r2
CC=golang-dev
https://golang.org/cl/2352043
2010-10-11 12:40:13 -07:00
..
archive archive/zip: new package for reading ZIP files 2010-09-30 11:59:46 +10:00
asn1 asn1: make interface consistent with json 2010-09-24 12:34:18 -04:00
big big: fix panic and round correctly in Rat.FloatString 2010-10-07 16:10:48 +02:00
bufio bufio: minor documentation fix. 2010-10-06 19:39:30 +11:00
bytes bytes: fix typo in AddByte comment 2010-09-27 11:41:43 +10:00
cmath tests: fix prints 2010-09-23 13:48:56 +10:00
compress 5g: register allocation bugs 2010-09-12 00:06:45 -04:00
container list: update comment to state that the zero value is ready to use. 2010-09-03 17:11:56 +10:00
crypto crypto/tls: make SetReadTimeout work. 2010-10-11 10:41:01 -04:00
debug debug/proc: ... changes (fix build) 2010-09-24 13:12:50 -04:00
ebnf build: no required environment variables 2010-08-18 10:08:49 -04:00
encoding ... changes 2010-09-24 11:55:48 -04:00
exec exec.LookPath() unix/windows separation 2010-09-12 17:38:36 +10:00
exp exp/draw/x11: support X11 vendors other than "The X.Org Foundation". 2010-10-09 11:22:14 +11:00
expvar expvar: add (*Int).Set 2010-10-11 13:14:07 -04:00
flag build: no required environment variables 2010-08-18 10:08:49 -04:00
fmt fmt: allow %d on []byte 2010-10-04 11:57:48 +02:00
go Use Errorf where appropriate. 2010-10-01 14:14:18 +10:00
gob tests: fix prints 2010-09-23 13:48:56 +10:00
hash build: no required environment variables 2010-08-18 10:08:49 -04:00
html html: disable print 2010-09-23 22:05:42 -04:00
http http: return the correct error if a header line is too long. 2010-10-06 22:04:18 +11:00
image Use Errorf where appropriate. 2010-10-01 14:14:18 +10:00
index/suffixarray suffixarray: cleanup per suggestion from Roger Peppe 2010-09-22 11:03:57 -07:00
io io/ioutil: use _test not _obj in test 2010-09-23 14:31:44 -04:00
json json: do not write to unexported fields 2010-09-28 14:40:23 -04:00
log ... changes 2010-09-24 11:55:48 -04:00
math math: Fix off-by-one error in Ilogb and Logb. 2010-09-28 10:15:21 -04:00
mime mime: delete unnecessary constant conversions. 2010-08-20 07:42:02 +10:00
net net: allow _ in names 2010-10-07 06:45:50 -04:00
netchan netchan: zero out request to ensure correct gob decoding. 2010-10-11 12:36:16 -07:00
nntp ... changes 2010-09-24 11:55:48 -04:00
os os: make tests work on windows 2010-10-04 17:31:49 +11:00
patch build: no required environment variables 2010-08-18 10:08:49 -04:00
path ... changes 2010-09-24 11:55:48 -04:00
rand tests: fix prints 2010-09-23 13:48:56 +10:00
reflect gc: fix reflect table method receiver 2010-09-28 13:43:50 -04:00
regexp regexp: delete Iter methods 2010-09-21 21:21:44 +10:00
rpc Use Errorf where appropriate. 2010-10-01 14:14:18 +10:00
runtime bug in stack size in arm. 2010-10-08 16:46:05 -07:00
scanner Fix incorrect reporting of error in Scanner.next() when Read reads > 0 bytes but returns os.EOF. 2010-09-01 15:15:37 -07:00
sort build: no required environment variables 2010-08-18 10:08:49 -04:00
strconv tests: fix prints 2010-09-23 13:48:56 +10:00
strings bytes, strings: change lastIndexFunc to use DecodeLastRune 2010-09-23 20:40:11 +10:00
sync build: no required environment variables 2010-08-18 10:08:49 -04:00
syscall syscall: add ucred structure for SCM_CREDENTIALS over UNIX sockets. 2010-10-06 21:32:31 +11:00
syslog tests: fix prints 2010-09-23 13:48:56 +10:00
tabwriter build: no required environment variables 2010-08-18 10:08:49 -04:00
template gc: fix reflect table method receiver 2010-09-28 13:43:50 -04:00
testing ... changes 2010-09-24 11:55:48 -04:00
time time: add After 2010-10-11 13:45:26 +11:00
try new command gotry. 2010-10-11 12:40:13 -07:00
unicode tests: fix prints 2010-09-23 13:48:56 +10:00
unsafe runtime: introduce unsafe.New and unsafe.NewArray 2009-12-07 15:51:58 -08:00
utf8 utf8.String: provide an Init method to avoid unnecessary allocation 2010-09-27 12:06:29 -07:00
utf16 build: no required environment variables 2010-08-18 10:08:49 -04:00
websocket http: revised http Handler interface 2010-09-29 14:30:12 +10:00
xml xml: Allow entities inside CDATA tags 2010-09-24 12:23:01 -04:00
Makefile new command gotry. 2010-10-11 12:40:13 -07:00
deps.bash build: clear custom variables like GREP_OPTIONS 2010-09-28 23:51:55 -04:00