gore

Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

Github星跟蹤圖

gore CI Status

Screencast

(Screencast taken with cho45/KeyCast)

Usage

gore

After a prompt is shown, enter any Go expressions/statements/functions or commands described below.

To quit the session, type Ctrl-D or use :q command.

Features

  • Line editing with history
  • Multi-line input
  • Package importing with completion
  • Evaluates any expressions, statements and function declarations
  • No "evaluated but not used" errors
  • Code completion (requires gocode)
  • Showing documents
  • Auto-importing (gore -autoimport)

REPL Commands

Some functionalities are provided as commands in the REPL:

:import <package path>  Import package
:type <expr>            Print the type of expression
:print                  Show current source
:write [<filename>]     Write out current source to file
:clear                  Clear the codes
:doc <expr or pkg>      Show document
:help                   List commands
:quit                   Quit the session

Supported Versions

Only the latest major version.

Installation

The gore command requires Go tool-chains on runtime, so standalone binary is not distributed.

go get -u github.com/motemen/gore/cmd/gore

Make sure $GOPATH/bin is in your $PATH.

Also recommended:

go get -u github.com/mdempsky/gocode   # for code completion

FAQ/Caveats

  • gore runs code using go run for each input. All the inputted lines are
    evaluated again and again so you can't bind the evaluated time by
    time.Now(), for example. If you don't like this behavior, you may want to use
    yaegi.
  • gore support Go modules. You can load local modules when you start gore at
    the project directory. You don't need to go get to check the usage of a
    remote repository, :import github.com/... will automatically download that
    module. Also, you don't need to go get the pretty print module anymore. If
    you want to load a local code from $GOPATH, you need to create the modules
    file (go mod init ...) and then start gore at the project directory.

License

The MIT License.

Author

motemen <motemen@gmail.com>

主要指標

概覽
名稱與所有者x-motemen/gore
主編程語言Go
編程語言Go (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-02-11 13:45:04
推送於2025-02-27 07:18:24
最后一次提交
發布數19
最新版本名稱v0.6.0 (發布於 )
第一版名稱v0.2.0 (發布於 )
用户参与
星數5.3k
關注者數55
派生數151
提交數480
已啟用問題?
問題數98
打開的問題數6
拉請求數119
打開的拉請求數0
關閉的拉請求數11
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?