Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import (
const (
MainnetServer = "autopilot.lightning.finance:12010"
TestnetServer = "test.autopilot.lightning.finance:12010"
SignetServer = "signet.autopilot.lightning.finance:12010"

// lndWalletReadyStatus is a custom status that will be used with the
// LND subserver. If the subserver is in this state then it will allow
Expand Down Expand Up @@ -465,9 +466,12 @@ func (g *LightningTerminal) start(ctx context.Context) error {
g.cfg.Autopilot.Address = MainnetServer
case "testnet":
g.cfg.Autopilot.Address = TestnetServer
case "signet":
g.cfg.Autopilot.Address = SignetServer
default:
return errors.New("no autopilot server " +
"address specified")
return fmt.Errorf("no autopilot server "+
"address specified for network %s",
g.cfg.Network)
Comment on lines +472 to +474

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using %q instead of %s for the network name in the error message is a best practice in Go as it quotes the value, making it easier to identify issues if the string is empty or contains unexpected characters. Additionally, the string literal concatenation can be simplified for better readability.

				return fmt.Errorf("no autopilot server address specified for network %q",
					g.cfg.Network)

}
}

Expand Down
Loading