-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.go
71 lines (57 loc) · 1019 Bytes
/
test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// vim:foldlevel=1 foldnestmax=8 foldlevelstart=1
package main
import (
"errors"
"fmt"
"google.golang.org/appengine/log"
)
func main() {
var err error
if err != nil {
fmt.Printf("just err: %s", err.Error())
}
err = fn()
if err != nil {
fmt.Print("test")
fmt.Print("multiline err")
}
if err != nil {
fmt.Printf("%s", "long long long long long string")
}
if err != nil {
fmt.Printf("can't converts to `c'`")
}
for {
a, b := 10, 20
a, b = b, a
}
if err != nil && a == 10 {
log.Errorf("don't fold it")
}
if err != nil {
log.Errorf("", "test empty strings")
}
}
func fn() error {
var err error
if err != nil {
return errors.New("err*rs package converts to epsilon")
}
v := false
if v {
switch v {
case true:
err = nil
if err != nil {
return errors.New("correct indentation")
}
if err != nil {
return fmt.Errorf("f*t convetrs to phi", err)
}
if err != nil {
return log.Errorf("l*g converts to lambda", err)
}
}
}
return nil
}