| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 22 Dec 2025 10:48:01 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100103043322
location: https://web.archive.org/web/20100103043322/https://github.com/vito/go-repl
server-timing: captures_list;dur=1.759664, exclusion.robots;dur=0.057898, exclusion.robots.policy;dur=0.044010, esindex;dur=0.009608, cdx.remote;dur=37.693511, LoadShardBlock;dur=551.200105, PetaboxLoader3.datanode;dur=104.415428, PetaboxLoader3.resolve;dur=401.092115
x-app-server: wwwb-app246-dc8
x-ts: 302
x-tr: 666
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app246; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Mon, 22 Dec 2025 10:48:01 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Sun, 03 Jan 2010 04:33:22 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "5f2e02a6529eb40ec41a4905df049742"
x-archive-orig-x-runtime: 130ms
x-archive-orig-content-length: 20446
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 03 Jan 2010 04:33:22 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: TLA-20100103043229-00144-ia360906-c/TLA-20100103043229-00144-ia360906.us.archive.org.warc.gz
server-timing: captures_list;dur=0.600877, exclusion.robots;dur=0.018906, exclusion.robots.policy;dur=0.007382, esindex;dur=0.009721, cdx.remote;dur=7.740224, LoadShardBlock;dur=158.945790, PetaboxLoader3.datanode;dur=126.964206, PetaboxLoader3.resolve;dur=118.695593, load_resource;dur=118.364819
x-app-server: wwwb-app246-dc8
x-ts: 200
x-tr: 365
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
vito's go-repl at master - GitHub
vito / go-repl
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
-
Branches (1)
- master ✓
- Tags (0)
go-repl /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Dec 07 14:31:57 -0800 2009 | Readline. [vito] |
| |
Makefile | Mon Dec 07 14:31:57 -0800 2009 | Readline. [vito] |
| |
README.markdown | Mon Dec 07 17:51:20 -0800 2009 | Updated README.markdown. [vito] |
| |
main.go | Mon Dec 07 19:24:44 -0800 2009 | Removed readline dir. [vito] |
README.markdown
A compiling Go REPL.
Builds up Go source as the session goes on, compiles and runs it with every input.
A "!" in front of the input means it's in "unstable" mode, e.g. a package has been imported and isn't used, or errors occur in the source.
Example session:
Welcome to the Go REPL!
Enter '?' for a list of commands.
> ?
Commands:
? help
+ (pkg) import package
- (pkg) remove package
-[dpc] pop last (declaration|package|code)
~ reset
: (...) add persistent code
! inspect source
> a := 6
> b := 7
> println(a * b)
42
> + fmt
! fmt> fmt.Println("Hello, world!")
Hello, world!
! fmt> println("This won't work since fmt doesn't get used.")
Compile error: /tmp/gorepl.go:2: imported and not used: fmt
! fmt> : fmt.Print()
fmt> println("Now it will!")
Now it will!
fmt> func b(a interface{}) { fmt.Printf("You passed: %#v\n", a); }
fmt> b(1)
Compile error: /tmp/gorepl.go:14: cannot call non-function b (type int)
fmt> !
package main
import "fmt"
func b(a interface{}) { fmt.Printf("You passed: %#v\n", a) }
func noop(_ interface{}) {}
func main() {
a := 6;
noop(a);
b := 7;
noop(b);
fmt.Print();
}
fmt> -d
fmt> !
package main
import "fmt"
func noop(_ interface{}) {}
func main() {
a := 6;
noop(a);
b := 7;
noop(b);
fmt.Print();
}
fmt> func dump(a interface{}) { fmt.Printf("You passed: %#v\n", a); }
fmt> dump("Phew, there we go.")
You passed: "Phew, there we go."
fmt> -d
fmt> -c
! fmt> - fmt
> + math
! math> println(math.Pi)
+3.141593e+000
! math> + fmt
! math fmt> fmt.Println(math.Pi)
3.1415927
! math fmt>
This feature is coming soon. Sit tight!
