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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?