nil context.Context passed to function SCC-SA1012
Bug risk
Major
6 months ago3 years old
do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
1100		}
1101		defer func() {
1102			if ctx.Input.CruSession != nil {
1103				ctx.Input.CruSession.SessionRelease(nil, rw)1104			}
1105		}()
1106	}
do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
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)
do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
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		}
do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
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
do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
 52		fmt.Println("hello world")
 53		return nil
 54	})
 55	err := tk.Run(nil) 56	if err != nil {
 57		t.Fatal(err)
 58	}