Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 231 Bytes

File metadata and controls

9 lines (7 loc) · 231 Bytes

Context As First Argument in Functions

It's an unwritten rule to accept context variables as the first function argument. A lot of packages use this pattern.

func myFunc(ctx context.Context, str string) {
  ...
}