Skip to content

kulasama/goscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goscript

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

Installation

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

Operating instructions

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 and licensing

Copyright 2010 The "goscript" Authors
See file AUTHORS and CONTRIBUTORS (if any).

Licensed under Simplified BSD License.
See file LICENSE.

Contact

To contact, send e-mail through github.

Known bugs

To reporting bugs, please login and create a new issue here.

Credits and acknowledgments

For credits, see file AUTHORS and CONTRIBUTORS (if any).

ChangeLog

For changes between the commits, see the commit history.


Generated by gowizard

About

Tool to run Go scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published