GithubHelp home page GithubHelp logo

rzyns / gore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from x-motemen/gore

0.0 2.0 0.0 630 KB

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

License: MIT License

Go 98.94% Makefile 1.06%

gore's Introduction

gore Travis Build Status

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

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)
  • Pretty printing (pp or spew recommended)
  • Showing documents (requires godoc)
  • 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 (requires godoc)
:help                   List commands
:quit                   Quit the session

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
go get -u github.com/k0kubun/pp        # or github.com/davecgh/go-spew/spew
go get -u golang.org/x/tools/cmd/godoc # for using with the :doc colon-command

FAQ/Caveats

  • If you see too many arguments in call to mainScope.LookupParent while installing gore, run go get -u golang.org/x/tools/go/types.
  • gore runs code using go run for each input. If you have entered time-consuming code, gore will run it for each input and take some time.
  • To import a local package, first fetch it with go get my/package, then :import will work properly.

License

The MIT License.

Author

motemen <[email protected]>

gore's People

Contributors

itchyny avatar motemen avatar rzyns avatar syohex avatar k0kubun avatar jj avatar orivej avatar monochromegane avatar iu0v1 avatar k3a avatar mandarvaze avatar pavdmyt avatar maxp-edcast avatar tcnksm avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.