Go fmt
This commit is contained in:
parent
50c84a2f7d
commit
64600ac668
@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"jsh"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"jsh"
|
||||||
)
|
)
|
||||||
|
|
||||||
func catFiles(queue chan *jsh.JshFrame) {
|
func catFiles(queue chan *jsh.JshFrame) {
|
||||||
@ -15,6 +15,7 @@ func catFiles(queue chan *jsh.JshFrame) {
|
|||||||
|
|
||||||
var jshFrame jsh.JshFrame
|
var jshFrame jsh.JshFrame
|
||||||
|
|
||||||
|
// If there's an error, output an error frame to the queue and continue
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errText := make(map[string]string)
|
errText := make(map[string]string)
|
||||||
errText[fileName] = fmt.Sprintf("%s", err.Error())
|
errText[fileName] = fmt.Sprintf("%s", err.Error())
|
||||||
@ -23,6 +24,7 @@ func catFiles(queue chan *jsh.JshFrame) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Put the file contents into a frame and send them to the output
|
||||||
output := jsh.CatOutput{}
|
output := jsh.CatOutput{}
|
||||||
output.Files = []string{fileName}
|
output.Files = []string{fileName}
|
||||||
output.Output = string(file)
|
output.Output = string(file)
|
||||||
@ -51,4 +53,3 @@ func main() {
|
|||||||
runJsonMode()
|
runJsonMode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"jsh"
|
"jsh"
|
||||||
"testing"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testUnitError(expected jsh.Unit, t *testing.T) {
|
func testUnitError(expected jsh.Unit, t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user