This repository has been archived on 2015-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
jsh/common.go
Ian Adam Naval e0166b98a9 Made package more go-getable.
Based on how the Revel project is organized.
2014-09-04 01:26:15 -04:00

23 lines
372 B
Go

/* Common structures and methods used across all coreutils */
package jsh
import (
"encoding/json"
)
type JshOutput struct {
StdOut interface{}
StdErr interface{}
}
// Converts a Jshoutput into a JSON string
func (j JshOutput) ToJson() *string {
jsonOut, err := json.Marshal(j)
if err != nil {
panic(err)
}
jsonString := string(jsonOut)
return &jsonString
}