goscript

command module
v0.0.0-...-6d64a81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2016 License: MIT Imports: 1 Imported by: 0

README

goscript

Simple wrapper around go run to use go as a scripting language

CLI Usage

$ goscript "fmt.Println("packages will automatically be imported from your $GOPATH")

Package Overview

Index

Package files

goscript.go

type GoScript

GoScipt Type

type GoScript struct {
    *exec.Cmd
}
func NewFromFile

NewFromFile takes in a filePath of golang source and converts it into a GoScript type with an embedded exec.Cmd

func NewFromFile(sourcePath string, args ...string) (*GoScript, error)
func NewFromString

NewFromString takes in a string of golang source and converts into a GoScript type with an embedded exec.Cmd

func NewFromString(source string, args ...string) (*GoScript, error)
func (GoScript) Clean

Clean deletes the generated goscript tempfile

func (gs GoScript) Clean() error
func (GoScript) FilePath

FilePath returns the current GoScript's file path

func (gs GoScript) FilePath() string

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL