Skip to content
This repository was archived by the owner on Apr 30, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,44 @@ igo

A simple interactive Go interpreter built on [go-eval](https://github.com/sbinet/go-eval) with some readline-like refinements

## Setting up

```sh

$ git clone git@github.com:sbinet/igo.git
$ cd igo
$ go install
$ go build main.go
$ ./main

********************************
** Interactive Go interpreter **
********************************


igo>

```

You can add compiled main file to your bash file for easy access from anywhere:

``` sh

$ echo 'alias igo="$PWD/main"' >> ~/.bash_profile
$ source ~/.bash_profile
$ igo

********************************
** Interactive Go interpreter **
********************************

igo> println("Hello, World!")
Hello, World!
igo>

```



## Example

Expand All @@ -14,7 +52,7 @@ hello world
igo> type Foo struct {
... A int
... }
...
...
igo> foo := Foo{A:32}
igo> foo
{32}
Expand Down
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module igo

go 1.14

require (
github.com/peterh/liner v1.2.0
github.com/sbinet/go-eval v0.0.0-20160521182218-34e015998e32
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/peterh/liner v1.2.0 h1:w/UPXyl5GfahFxcTOz2j9wCIHNI+pUPr2laqpojKNCg=
github.com/peterh/liner v1.2.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/sbinet/go-eval v0.0.0-20160521182218-34e015998e32 h1:RqyVn2fzuaVCGTWwJ6j7wohwNeFO0s1WdSYGo1KMWfE=
github.com/sbinet/go-eval v0.0.0-20160521182218-34e015998e32/go.mod h1:tUT5A+RkN5QvJhO6P9cY0JGX1bBStjLdsWcb+qbLuMM=