Skip to content

Commit

Permalink
Merge pull request #24 from caseneuve/master
Browse files Browse the repository at this point in the history
added 'discard value for :package key
  • Loading branch information
pope authored Feb 1, 2019
2 parents 237aded + 5783118 commit 2067ed5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ob-go.el
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ support for sessions"
(concat "func main() {\n" body "\n}\n")))

(defun org-babel-go-append-package (package)
"Check to see if package is set. If not, add main."
(concat "package " (if (and package (not (string-empty-p package))) package "main")))
"Check to see if package is set. If not, add main unless there is a 'discard value for the package key (allows to tangle many source blocks into one go project)."
(unless (eq package 'discard)
(concat "package " (if (and package (not (string-empty-p package))) package "main"))))

(defun org-babel-go-ensure-package (body package)
"Ensure package exists."
Expand Down

0 comments on commit 2067ed5

Please sign in to comment.