[ANN] goscript => gonow: Tool to run Go source files automatically

369 views
Skip to first unread message

Archos

unread,
Aug 29, 2011, 7:11:58 AM8/29/11
to golang-nuts
I'm glad to announce an updating to "goscript", which it has been
renamed to "gonow".

The changes more important are:

+ Enables run a Go file using "gonow file.go" wich is very usefull
during development when you've that file open in your editor.

It also enables to run it usig the file name. You've to insert "#!/usr/
bin/gonow" at the beginning of the file, and set its executable bit
(chmod +x file.go)

+ The compiled files are saved into a global directory when GOROOT or
GOPATH is set, else it is saved in the local directory "*.go" where
it's the source file.

The local directory is usefull to use it during boot init because
GOROOT can be into a directory which has not been mounted. Yes!!! I'm
changing my init bash scripts in Ubuntu to Go :)

=== Installation

goinstall github.com/kless/goheader

To use it using the source file's name, you have to install it so
(since it creates a link from "/usr/bin/gonow"):

git clone git://github.com/kless/gonow.git
cd gonow && ./Install.sh && cd -


---
https://github.com/kless/gonow

Archos

unread,
Aug 29, 2011, 7:16:53 AM8/29/11
to golang-nuts


On Aug 29, 12:11 pm, Archos <raul....@sent.com> wrote:
> === Installation
>
> goinstall github.com/kless/goheader
>
The correct address is

goinstall github.com/kless/gonow

Archos

unread,
Aug 29, 2011, 7:36:35 AM8/29/11
to golang-nuts


On Aug 29, 12:11 pm, Archos <raul....@sent.com> wrote:
> I'm glad to announce an updating to "goscript", which it has been
> renamed to "gonow".
>
To delete the files created with "goscript", use:

cd ; find . -type d -name ".go" | xargs rm -rf ; cd
sudo unlink /usr/bin/goscript

TJ Yang

unread,
Aug 29, 2011, 8:04:39 AM8/29/11
to golang-nuts
This is a very useful tool to enable Go to be used as a scripting
language.
Please include this tool into Go distribution.

[release@t-fedora15-64 test]$ cat hello2.go
#!/usr/bin/gonow
package main

import "fmt"


func main() {
fmt.Println("Hello!")
}
[release@t-fedora15-64 test]$ ./hello2.go
Hello!
[release@t-fedora15-64 test]$

Miki Tebeka

unread,
Aug 29, 2011, 12:45:56 PM8/29/11
to golan...@googlegroups.com
What's the difference from gorun?

Archos

unread,
Aug 29, 2011, 1:39:37 PM8/29/11
to golang-nuts
That question could be reversed from that gonow (old goscript) was the
first one in take the idea to run a Go source file like if were a
script language --with the first commit on December 04, 2010--

But, a great difference is that "gonow" is licensed under BSD-2 Clause
license while "gorun" is GNU GPL.

On Aug 29, 5:45 pm, Miki Tebeka <miki.teb...@gmail.com> wrote:
> What's the difference from gorun <https://wiki.ubuntu.com/gorun>?

Gustavo Niemeyer

unread,
Aug 29, 2011, 1:59:54 PM8/29/11
to golan...@googlegroups.com
Hey there,

> What's the difference from gorun?

I wrote gorun from the ground up to avoid the several problems that
goscript had without getting into long debates, so that people familiar
with scripting languages could feel more comfortable with Go. You
can find more specific details in the list history.

--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog

-- I never filed a patent.

Reply all
Reply to author
Forward
0 new messages