File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var echoCmd = &cobra.Command{
1111 Short : "starts an echo server to test the agent" ,
1212 Long : `The agent sends data to a server. This echo server
1313can be used to act as the server part and echo the data received by the agent.` ,
14- Run : echo .Echo ,
14+ RunE : echo .Echo ,
1515}
1616
1717func init () {
Original file line number Diff line number Diff line change @@ -9,20 +9,16 @@ import (
99 "github.com/spf13/cobra"
1010
1111 "github.com/jetstack/preflight/api"
12- "github.com/jetstack/preflight/pkg/logs"
1312)
1413
1514var EchoListen string
1615
1716var Compact bool
1817
19- func Echo (cmd * cobra.Command , args []string ) {
18+ func Echo (cmd * cobra.Command , args []string ) error {
2019 http .HandleFunc ("/" , echoHandler )
2120 fmt .Println ("Listening to requests at " , EchoListen )
22- err := http .ListenAndServe (EchoListen , nil )
23- if err != nil {
24- logs .Log .Fatal (err )
25- }
21+ return http .ListenAndServe (EchoListen , nil )
2622}
2723
2824func echoHandler (w http.ResponseWriter , r * http.Request ) {
You can’t perform that action at this time.
0 commit comments