GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 378143...7be145 )
by Victor Hugo
01:18 queued 13s
created

pkg/idempotency/nop.go   A

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
cc 3
eloc 11
dl 0
loc 34
ccs 4
cts 4
cp 1
crap 3
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A idempotency.NewNopGenerator 0 7 2
A idempotency.nOpIdempotencyGenerator.Generate 0 2 1
1
package idempotency
2
3
// NOpIdempotencyGenerator is a dummy implementation of the
4
// IdempotencyKeyGenerator interface.
5
//
6
// Good for testing or when a predictable result is required.
7
type nOpIdempotencyGenerator struct {
8
	expected string
9
}
10
11
const (
12
	TestKeyExpected = "test_ikg_key"
13
)
14
15
// Generate encapsulates the logic to return a string representation of
16
// a unique idempotency key.
17
func (nopIKG nOpIdempotencyGenerator) Generate() string {
18 1
	return nopIKG.expected
19
}
20
21
// NewNopGenerator returns a dummy implementation of the
22
// IdempotencyKeyGenerator interface.
23
//
24
// Good for testing or when a predictable result is required.
25
//
26
// If exp is an empty string, then TestKeyExpected is used as
27
// default value for the NOpGenerator.
28
func NewNopGenerator(exp string) KeyGenerator {
29 1
	if exp == "" {
30 1
		exp = TestKeyExpected
31
	}
32
33 1
	return nOpIdempotencyGenerator{
34
		expected: exp,
35
	}
36
}
37