goscript allows to use Go like if were a script language. The extension of Go scripts has to be ".g".
Internally, it compiles the script file to an hidden binary with extension ".gosc" (Go Script Compiled), then it's runned. If that binary does not exist or its modified time is different than script's, then it's compiled again.
The use of Go scripts is especially useful:
- During learning
- For administration issues
- Boot init of operating systems
- Web developing; by example for the routing
- Interfaces of database models
$ git clone git://github.com/kless/goscript.git
$ cd goscript && ./Install.sh && cd -
Insert at the first line of the Go Script:
#!/usr/bin/env goscript
And set its executable bit:
$ chmod +x file.g
An example of Go script:
#!/usr/bin/env goscript
package main
import (
"fmt"
)
func main() {
fmt.Println("Take it on the other side")
}
Copyright 2010 The "goscript" Authors
See file AUTHORS and CONTRIBUTORS (if any).
Licensed under Simplified BSD License.
See file LICENSE.
To contact, send e-mail through github.
To reporting bugs, please login and create a new issue here.
For credits, see file AUTHORS and CONTRIBUTORS (if any).
For changes between the commits, see the commit history.
Generated by gowizard