nil
context.Context
passed to function SCC-SA10121100 }
1101 defer func() {
1102 if ctx.Input.CruSession != nil {
1103 ctx.Input.CruSession.SessionRelease(nil, rw)1104 }
1105 }()
1106 }
32 result := []string{
33 template.HTMLEscapeString(tname),
34 template.HTMLEscapeString(tk.GetSpec(nil)),
35 template.HTMLEscapeString(tk.GetStatus(nil)),36 template.HTMLEscapeString(tk.GetPrev(context.Background()).String()),
37 }
38 resultList = append(resultList, result)
31 for tname, tk := range globalTaskManager.adminTaskList {
32 result := []string{
33 template.HTMLEscapeString(tname),
34 template.HTMLEscapeString(tk.GetSpec(nil)),35 template.HTMLEscapeString(tk.GetStatus(nil)),
36 template.HTMLEscapeString(tk.GetPrev(context.Background()).String()),
37 }
151 }
152 tk := NewTask("taska", "0/30 * * * * *", task)
153 for i := 0; i < 200; i++ {
154 e := tk.Run(nil)155 assert.NotNil(t, e)
156 }
157
52 fmt.Println("hello world")
53 return nil
54 })
55 err := tk.Run(nil) 56 if err != nil {
57 t.Fatal(err)
58 }
A nil context.Context
is being passed to a function, consider using context.TODO instead.
// Function signature:
// func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd
//
if err := exec.CommandContext(nil, "sleep", "5").Run(); err != nil {
// handle error
}
// Function signature:
// func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd
//
if err := exec.CommandContext(context.TODO(), "sleep", "5").Run(); err != nil {
// handle error
}