We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case 1 use switch and case 2 use if. Both of them are failed.
switch
if
package main import "fmt" // not OK func case1() { var s *string var err error situation := 1 switch situation { case 1: tmp := "one" s = &tmp default: err = fmt.Errorf("error") } if err != nil { fmt.Println(err) return } fmt.Println(*s) } // not OK func case2() { var s *string var err error situation := 1 if situation == 1 { tmp := "one" s = &tmp } else { err = fmt.Errorf("error") } if err != nil { fmt.Println(err) return } fmt.Println(*s) } func main() { case1() case2() }
I check the issues and this is similar to #110 but more simple with a bit different.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Case 1 use
switch
and case 2 useif
. Both of them are failed.I check the issues and this is similar to #110 but more simple with a bit different.
The text was updated successfully, but these errors were encountered: