vendor/golang.org/x/net/context/context.go
changeset 260 445e01aede7e
parent 242 2a9ec03fe5a1
equal deleted inserted replaced
259:db4911b0c721 260:445e01aede7e
    19 //
    19 //
    20 // Do not store Contexts inside a struct type; instead, pass a Context
    20 // Do not store Contexts inside a struct type; instead, pass a Context
    21 // explicitly to each function that needs it. The Context should be the first
    21 // explicitly to each function that needs it. The Context should be the first
    22 // parameter, typically named ctx:
    22 // parameter, typically named ctx:
    23 //
    23 //
    24 // 	func DoSomething(ctx context.Context, arg Arg) error {
    24 //	func DoSomething(ctx context.Context, arg Arg) error {
    25 // 		// ... use ctx ...
    25 //		// ... use ctx ...
    26 // 	}
    26 //	}
    27 //
    27 //
    28 // Do not pass a nil Context, even if a function permits it. Pass context.TODO
    28 // Do not pass a nil Context, even if a function permits it. Pass context.TODO
    29 // if you are unsure about which Context to use.
    29 // if you are unsure about which Context to use.
    30 //
    30 //
    31 // Use context Values only for request-scoped data that transits processes and
    31 // Use context Values only for request-scoped data that transits processes and