Skip to content

Commit

Permalink
Update root.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Oct 25, 2021
1 parent f29a77c commit f634ea3
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"io/ioutil"
"log"
"os"
"bufio"
"fmt"
)

var actionFileName string
Expand Down Expand Up @@ -72,15 +74,24 @@ var rootCmd = &cobra.Command{

fmt.Println(action)

readMe, err := ioutil.ReadFile(outputFileName)

file, err := os.Open(outputFileName)

if err != nil {
cobra.CheckErr(err)
}
}

for _, line := range readMe {
fmt.Printf("%s\n", string(line))
}
defer file.Close()

scanner := bufio.NewScanner(file)

for scanner.Scan() {
fmt.Println(scanner.Text())
}

if err := scanner.Err(); err != nil {
cobra.CheckErr(err)
}
},
}

Expand Down

0 comments on commit f634ea3

Please sign in to comment.