Skip to content

Commit

Permalink
not using fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Kapil Sharma <[email protected]>
  • Loading branch information
h4l0gen authored May 7, 2024
1 parent c8f3617 commit 333e771
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions events/helper/inbound_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
package helper

import (
"fmt"
"net"
"strconv"

"github.com/falcosecurity/event-generator/events"
)
Expand All @@ -29,9 +29,7 @@ func InboundConnection(h events.Helper) error {
if err != nil {
return err
}
fmt.Println("Server started on", address)
defer listener.Close()
fmt.Println("Server closed on", address)
return nil
}

Expand All @@ -57,7 +55,7 @@ func getRandomLocalAddress() (string, error) {
continue
}
listener.Close()
return fmt.Sprintf("%s:%d", ip, listener.Addr().(*net.TCPAddr).Port), nil
return ip.String() + ":" + strconv.Itoa(listener.Addr().(*net.TCPAddr).Port), nil
}
return "", fmt.Errorf("no valid local address found")
return "", err
}

0 comments on commit 333e771

Please sign in to comment.