-
Rob Pike authored
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
570f59c1
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
archive | ||
asn1 | ||
big | ||
bufio | ||
bytes | ||
cmath | ||
compress | ||
container | ||
crypto | ||
debug | ||
ebnf | ||
encoding | ||
exec | ||
exp | ||
expvar | ||
flag | ||
fmt | ||
go | ||
gob | ||
hash | ||
html | ||
http | ||
image | ||
index/suffixarray | ||
io | ||
json | ||
log | ||
math | ||
mime | ||
net | ||
netchan | ||
nntp | ||
os | ||
patch | ||
path | ||
rand | ||
reflect | ||
regexp | ||
rpc | ||
runtime | ||
scanner | ||
sort | ||
strconv | ||
strings | ||
sync | ||
syscall | ||
syslog | ||
tabwriter | ||
template | ||
testing | ||
time | ||
try | ||
unicode | ||
unsafe | ||
utf16 | ||
utf8 | ||
websocket | ||
xml | ||
Makefile | ||
deps.bash |