Created
February 28, 2026 23:53
-
-
Save rcy/21a8dfe3bf2c3e8d3d167d819344759d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defvar go-scratch-base-directory "~/personal/go-scratch") | |
| (defun go-scratch () | |
| (interactive) | |
| (let ((dir (format "%s/%s" go-scratch-base-directory (format-time-string "%Y%m%d-%H%M")))) | |
| (make-directory dir t) | |
| (find-file (file-name-concat dir "main.go")) | |
| (when (eq (point-min) (point-max)) | |
| (insert "// -*- compile-command: \"go run main.go\"; -*- | |
| package main | |
| import ( | |
| \"fmt\" | |
| ) | |
| func main() { | |
| fmt.Println(\"Hello, scratch\") | |
| } | |
| ") | |
| (hack-local-variables)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment