mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-12 13:10:25 +00:00
[golangci-lint] Fixed some comparisons to bool and an ineffective err generation
This commit is contained in:
parent
330e15f532
commit
2283a54a33
@ -83,7 +83,7 @@ func parseConfig(configPath string) (configuration, error) {
|
||||
|
||||
// Read config file per line.
|
||||
for scanner.Scan() {
|
||||
if strings.HasPrefix(scanner.Text(), "#") == true {
|
||||
if strings.HasPrefix(scanner.Text(), "#"){
|
||||
continue
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ func parseConfig(configPath string) (configuration, error) {
|
||||
output.port = row[1]
|
||||
default:
|
||||
if len(row) >= 2 {
|
||||
if strings.Contains(scanner.Text(), ";") == true {
|
||||
if strings.Contains(scanner.Text(), ";"){
|
||||
output.username = strings.Split(row[0], ";")[0]
|
||||
output.jserver = strings.Split(row[0], ";")[1]
|
||||
output.password = row[1]
|
||||
@ -195,7 +195,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Quit if unreasonable TLS setting is set.
|
||||
if *flagStartTLS == true && *flagTLS == true {
|
||||
if *flagStartTLS && *flagTLS {
|
||||
log.Fatal("Use either TLS or StartTLS.")
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Skip reading message if '-i' or '--interactive' is set to work with e.g. 'tail -f'.
|
||||
if *flagInteractive == false {
|
||||
if !*flagInteractive {
|
||||
if message == "" {
|
||||
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
@ -298,7 +298,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Send in endless loop (for usage with e.g. "tail -f").
|
||||
if *flagInteractive == true {
|
||||
if *flagInteractive {
|
||||
for {
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner.Scan()
|
||||
@ -333,7 +333,7 @@ func main() {
|
||||
// If the chatroom flag is not set, send message to contact(s).
|
||||
|
||||
// Send in endless loop (for usage with e.g. "tail -f").
|
||||
if *flagInteractive == true {
|
||||
if *flagInteractive {
|
||||
for {
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner.Scan()
|
||||
|
Loading…
Reference in New Issue
Block a user