|
| 1 | +//golangcitest:args -Egolines |
| 2 | +//golangcitest:expected_exitcode 0 |
| 3 | +package testdata |
| 4 | + |
| 5 | +import "fmt" |
| 6 | + |
| 7 | +var ( |
| 8 | + abc = []string{"a really long string", "another really long string", "a third really long string", "a fourth really long string", fmt.Sprintf("%s %s %s %s >>>>> %s %s", "first argument", "second argument", "third argument", "fourth argument", "fifth argument", "sixth argument")} |
| 9 | +) |
| 10 | + |
| 11 | +type MyStruct struct { |
| 12 | + aLongProperty int `help:"This is a really long string for this property"` |
| 13 | + anotherLongProperty int `help:"This is a really long string for this property, part 2"` |
| 14 | + athirdLongProperty int `help:"This is a really long string for this property, part 3...."` |
| 15 | +} |
| 16 | + |
| 17 | +type MyInterface interface { |
| 18 | + aReallyLongFunctionName(argument1 string, argument2 string, argument3 string, argument4 string, argument5 string, argument6 string) (string, error) |
| 19 | +} |
| 20 | + |
| 21 | +// Something here |
| 22 | + |
| 23 | +// Another comment |
| 24 | +// A third comment |
| 25 | +// This is a really really long comment that needs to be split up into multiple lines. I don't know how easy it will be to do, but I think we can do it! |
| 26 | +func longLine(aReallyLongName string, anotherLongName string, aThirdLongName string) (string, error) { |
| 27 | + argument1 := "argument1" |
| 28 | + argument2 := "argument2" |
| 29 | + argument3 := "argument3" |
| 30 | + argument4 := "argument4" |
| 31 | + |
| 32 | + fmt.Printf("This is a really long string with a bunch of arguments: %s %s %s %s >>>>>>>>>>>>>>>>>>>>>>", argument1, argument2, argument3, argument4) |
| 33 | + fmt.Printf("This is a short statement: %d %d %d", 1, 2, 3) |
| 34 | + |
| 35 | + z := argument1 + argument2 + fmt.Sprintf("This is a really long statement that should be broken up %s %s %s", argument1, argument2, argument3) |
| 36 | + |
| 37 | + fmt.Printf("This is a really long line that can be broken up twice %s %s", fmt.Sprintf("This is a really long sub-line that should be broken up more because %s %s", argument1, argument2), fmt.Sprintf("A short one %d", 3)) |
| 38 | + |
| 39 | + fmt.Print("This is a function with a really long single argument. We want to see if it's properly split") |
| 40 | + |
| 41 | + fmt.Println(z) |
| 42 | + |
| 43 | + // This is a really long comment on an indented line. Do you think we can split it up or should we just leave it as is? |
| 44 | + if argument4 == "5" { |
| 45 | + return "", fmt.Errorf("a very long query with ID %d failed. Check Query History in AWS UI", 12341251) |
| 46 | + } |
| 47 | + |
| 48 | + go func() { |
| 49 | + fmt.Printf("This is a really long line inside of a go routine call. It should be split if at all possible.") |
| 50 | + }() |
| 51 | + |
| 52 | + if "hello this is a big string" == "this is a small string" && "this is another big string" == "this is an even bigger string >>>" { |
| 53 | + fmt.Print("inside if statement") |
| 54 | + } |
| 55 | + |
| 56 | + fmt.Println(map[string]string{"key1": "a very long value", "key2": "a very long value", "key3": "another very long value"}) |
| 57 | + |
| 58 | + return "", nil |
| 59 | +} |
| 60 | + |
| 61 | +func shortFunc(a int, b int) error { |
| 62 | + c := make(chan int) |
| 63 | + |
| 64 | + for { |
| 65 | + select { |
| 66 | + case <-c: |
| 67 | + switch a { |
| 68 | + case 1: |
| 69 | + return fmt.Errorf("This is a really long line that can be broken up twice %s %s", fmt.Sprintf("This is a really long sub-line that should be broken up more because %s %s", "xxxx", "yyyy"), fmt.Sprintf("A short one %d", 3)) |
| 70 | + case 2: |
| 71 | + } |
| 72 | + } |
| 73 | + |
| 74 | + break |
| 75 | + } |
| 76 | + |
| 77 | + if a > 5 { |
| 78 | + panic(fmt.Sprintf(">>>>>>>>>>>>>>>>>>> %s %s %s %s", "really long argument", "another really long argument", "a third really long arguement", abc[1:2])) |
| 79 | + } |
| 80 | + |
| 81 | + return nil |
| 82 | + // This is an end decoration |
| 83 | +} |
0 commit comments