Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackowski committed Oct 19, 2022
1 parent 9300ad3 commit 032948f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func findValueAtPath(a map[string]any, path []string) (any, error) {
return v, nil
}

func parseJsonAndFind(path []string) {
dec := json.NewDecoder(os.Stdin)
func parseJsonAndFind(in io.Reader, path []string) {
dec := json.NewDecoder(in)
var input map[string]any

for {
Expand Down Expand Up @@ -87,5 +87,5 @@ func argsToPath(args []string) []string {

func main() {
path := argsToPath(os.Args)
parseJsonAndFind(path)
parseJsonAndFind(os.Stdin, path)
}

0 comments on commit 032948f

Please sign in to comment.