See os.Exec. Also there is a nice project https://github.com/codeskyblue/go-sh that friendly's the stdlib up.
On Thursday, 21 July 2016 12:14:04 UTC-7, christ...@google.com wrote: > > Cgo enables us to call C functions from Go programs, and we can run C > functions from command line. > > Are we able to call Go functions directly from command line? > > For example if I have a function in Go: > > func add(a, b int) int { > return a + b > } > > Can I somehow invoke this from bash? > > > > Thanks! > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.