Skip to content

shosti/go-scratch.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Go Scratch Mode

This is a little package for experimenting with Go code without having to use the Go Playground. Usage is simple: just write the code you want to play around with, C-c C-c, and then the program's stdout will be printed to the message area. Processes have 3 seconds (by default) to finish.

Caveats

  • Unlike the Go playground, there's no sandboxing, so you can destroy your system if you try hard enough.
  • godoc and godef functions don't work (since they want you to be visiting a file).
  • Your go-mode hooks will run, and some minor modes don't like running without a file. company-go is an example; if you're running into problems, you might try something like the following:
(defun my-go-hook ()
  (when buffer-file-name
    (setq-local company-backends '(company-go))))

(add-hook 'go-mode-hook #'my-go-hook)

About

Emacs scratch mode for go

Resources

Stars

Watchers

Forks

Packages

No packages published