package main

import (
	"io/ioutil"
	"os"

	slackreporter "github.com/ariarijp/horenso-reporter-slack/reporter"
	"github.com/bluele/slack"
)

func main() {
	token := os.Getenv("SLACK_TOKEN")
	groupName := os.Getenv("SLACK_GROUP")

	stdin, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err)
	}

	api := slack.New(token)
	r := slackreporter.GetReport(stdin)

	slackreporter.NotifyToGroup(*api, r, groupName)
}

package main

import (
	"os"

	slackreporter "github.com/ariarijp/horenso-reporter-slack/reporter"
	"github.com/bluele/slack"
)

func main() {
	token := os.Getenv("SLACK_TOKEN")
	groupName := os.Getenv("SLACK_GROUP")

	api := slack.New(token)
	r := slackreporter.GetReport([]byte(os.Args[1]))

	slackreporter.NotifyToGroup(*api, r, groupName)
}

--- 
+++ 
@@ -1,6 +1,7 @@
 package main
 
 import (
+	"io/ioutil"
 	"os"
 
 	slackreporter "github.com/ariarijp/horenso-reporter-slack/reporter"
@@ -11,8 +12,13 @@
 	token := os.Getenv("SLACK_TOKEN")
 	groupName := os.Getenv("SLACK_GROUP")
 
+	stdin, err := ioutil.ReadAll(os.Stdin)
+	if err != nil {
+		panic(err)
+	}
+
 	api := slack.New(token)
-	r := slackreporter.GetReport([]byte(os.Args[1]))
+	r := slackreporter.GetReport(stdin)
 
 	slackreporter.NotifyToGroup(*api, r, groupName)
 }
Fix get the result JSON via STDIN
