Skip to content

Commit

Permalink
fix: starting with TLS regression
Browse files Browse the repository at this point in the history
culmintation of previous changes in auto-tls
and code refactoring since v7.0.0
  • Loading branch information
harshavardhana committed Aug 19, 2024
1 parent 3d42a20 commit b276ad6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1141,11 +1141,23 @@ func sidekickMain(ctx *cli.Context) {
}
server.TLSConfig = tlsConfig
}

var listener net.Listener
var err error
if server.TLSConfig != nil {
listener, err = tls.Listen("tcp", addr, server.TLSConfig)
if err != nil {
console.Fatalln(err)
}
} else {
listener, err = net.Listen("tcp", addr)

Check failure on line 1153 in main.go

View workflow job for this annotation

GitHub Actions / Test on Go 1.22.x and ubuntu-latest

ineffectual assignment to err (ineffassign)
}
go func() {
if err := server.ListenAndServe(); err != nil {
if err := server.Serve(listener); err != nil {
console.Fatalln(err)
}
}()

osSignalChannel := make(chan os.Signal, 1)
signal.Notify(
osSignalChannel,
Expand Down

0 comments on commit b276ad6

Please sign in to comment.