Coder Social home page Coder Social logo

ob-go's Issues

table input is not supported

Can I start working on it? Is there work in progress, or can I start with the latest in git?
My thoughts are between simple (multi-string variable using ` and interpret the s-expression in go) and complex (setup an array of structs with named fields). Any directions for me please!

print err message at results section

i prefer to print err message at results section, e.p:

#+BEGIN_SRC go :imports "fmt"
func main() {
    fmt.Println("Hello ", name)
}
#+END_SRC

#+RESULTS:
# command-line-arguments
/var/folders/m0/l7hfbwvn3dz9qnx_dxf65vvm0000gp/T/babel-31761XsV/go-src-31761Dez.go:8: undefined: name

Support importing external packages

It would be convenient if it were possible to also import packages not part of the standard library, e.g., via…

#+begin_src go :imports "golang.org/x/exp/constraints@latest"
…
#+end_src

go 1.17 to loose GOPATH support

With go 1.17 loosing GOPATH support. It may be necessary to generate a temporary module rather than a simple go file when executing the code block.

Don't know how to use

althought I add ob-go from melpa, but it doesn't work well. could you tell me how to config it in emacs
Thank you

feature request: support import's in source with main() auto-wrapping enabled

It will be handy if ob-go detected import statements and put them at the beginning of the generated file, without needing to explicitly declare a main() function, so:

import "fmt"
fmt.Println(1)

will be internally translated to:

package main
import "fmt"
func main() {
    fmt.Println(1)
}

Currently this block is translated to invalid go and the compilation fails:

package main
func main() {
    import "fmt"
    fmt.Println(1)
}

problem with evaluating result

(if-let ((results
	      (org-babel-eval
	       (format "%s run %s \"%s\" %s"
		       org-babel-go-command
		       (mapconcat 'identity (org-babel-go-as-list flags) " ")
		       (org-babel-process-file-name tmp-src-file)
		       (mapconcat #'(lambda (a)
				      ;; If there's a chance that the symbol is a
				      ;; ref, use that. Otherwise, just return the
				      ;; string form of the value.
				      (format "%S" (if (symbolp a)
						       (let* ((ref (symbol-name a))
							      (out (org-babel-read ref)))
							 (if (equal out ref)
							     (if (string-match "^\".*\"$" ref)
								 (read ref)
							       (org-babel-ref-resolve ref))
							   out))
						     a)))
				  (org-babel-go-as-list args) " ")) "")))

I encountered an "Invalid function" error when I evaluated results, then I find "if-let" in this code block in file "ob-go.el".I guess "if-let" is invalid in my emacs,so I change it into "let",and it works! Finally I find "if-let" is a macro in new Emacs.

error with package

when i wrote org like this:

+BEGIN_SRC go

package main

import "fmt"

func main() {
fmt.Println("Hello World!")
}

+END_SRC

and execute this code, i got:

package main: 
/var/folders/m0/l7hfbwvn3dz9qnx_dxf65vvm0000gp/T/babel-31761XsV/go-src-31761BqN.go:2:1: expected 'package', found 'import'

so, i check out generated go source hinted by above, and i found:


import (

)


package main
import "fmt"

func main() {
    fmt.Println("Hello World!")
}%

is it a bug or my problem?

Support the ability for :package to be set to none

I am trying to tangle an org file consisting of go code blocks which are all tangled into one file. This package works pretty well besides the inability to set :package to none. For instance, when I untangle I set it so that :main no is a default argument for source blocks but there is no ability to set :package to an empty string or nil leading to the resulting tangled file being filled with various 'package main' lines all over for each source block. Adding this would definitely be useful for overall literate go programming with the package.

Symbol's function definition is void: org-babel--get-vars

I am using Emacs 25 (compiled from source) and org-mode (release-8.3.4)

When I try code block as below:

#+BEGIN_SRC go
  fmt.Println("Hello World!")
#+END_SRC

I got error: "Symbol's function definition is void: org-babel--get-vars"

When I install org-mode from master branch, it works fine.

void function =string-to-int=

I'm using Emacs version from source code repository with branch master. and Org-mode version from source code branch master.

And workaround is here:

(if (not (fboundp 'string-to-int)) ; used in `ob-go.el'
      (defalias 'string-to-int 'string-to-number))

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.