Functions & Methods - Formatting Contract Signatures
Keep them on a single line unless the line exceeds 120 characters, at which point they should be wrapped between 80 and 120 characters, preferably with one parameter per line.
Examples
signatures.go
1// MustRepeatSomething needs a GoDoc comment
2func MustRepeatSomething(ctx context.Context, repeats int) {
3 // ...
4}
5
6// MustRepeatManyThings needs a GoDoc comment
7func MustRepeatManyThings(
8 ctx context.Context,
9 repeats int,
10 param1 map[string]string,
11 param2 map[string]string,
12 param2 map[string]string,
13 param2 map[string]string,
14) {
15 // ...
16}
17
18// RepeatManyThings needs a GoDoc comment
19func RepeatManyThings(
20 ctx context.Context,
21 repeats int,
22 param1 map[string]string,
23 param2 map[string]string,
24 param2 map[string]string,
25 param2 map[string]string,
26) (fault error) {
27 // ...
28}