Browse code

fix golint errors

Signed-off-by: Jake Sanders <jsand@google.com>

Jake Sanders authored on 2017/12/05 09:44:03
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ import (
11 11
 	"github.com/docker/distribution/registry/client"
12 12
 )
13 13
 
14
-var always_continue = []error{
14
+var alwaysContinue = []error{
15 15
 	&client.UnexpectedHTTPResponseError{},
16 16
 
17 17
 	// Some errcode.Errors that don't disprove the existence of a V1 image
... ...
@@ -22,25 +22,25 @@ var always_continue = []error{
22 22
 	errors.New("some totally unexpected error"),
23 23
 }
24 24
 
25
-var continue_from_mirror_endpoint = []error{
25
+var continueFromMirrorEndpoint = []error{
26 26
 	ImageConfigPullError{},
27 27
 
28 28
 	// Some other errcode.Error that doesn't indicate we should search for a V1 image.
29 29
 	errcode.Error{Code: errcode.ErrorCodeTooManyRequests},
30 30
 }
31 31
 
32
-var never_continue = []error{
32
+var neverContinue = []error{
33 33
 	errors.New(strings.ToLower(syscall.ESRCH.Error())), // No such process
34 34
 }
35 35
 
36 36
 func TestContinueOnError_NonMirrorEndpoint(t *testing.T) {
37
-	for _, err := range always_continue {
37
+	for _, err := range alwaysContinue {
38 38
 		if !continueOnError(err, false) {
39 39
 			t.Errorf("Should continue from non-mirror endpoint: %T: '%s'", err, err.Error())
40 40
 		}
41 41
 	}
42 42
 
43
-	for _, err := range continue_from_mirror_endpoint {
43
+	for _, err := range continueFromMirrorEndpoint {
44 44
 		if continueOnError(err, false) {
45 45
 			t.Errorf("Should only continue from mirror endpoint: %T: '%s'", err, err.Error())
46 46
 		}
... ...
@@ -49,8 +49,8 @@ func TestContinueOnError_NonMirrorEndpoint(t *testing.T) {
49 49
 
50 50
 func TestContinueOnError_MirrorEndpoint(t *testing.T) {
51 51
 	errs := []error{}
52
-	errs = append(errs, always_continue...)
53
-	errs = append(errs, continue_from_mirror_endpoint...)
52
+	errs = append(errs, alwaysContinue...)
53
+	errs = append(errs, continueFromMirrorEndpoint...)
54 54
 	for _, err := range errs {
55 55
 		if !continueOnError(err, true) {
56 56
 			t.Errorf("Should continue from mirror endpoint: %T: '%s'", err, err.Error())
... ...
@@ -59,9 +59,9 @@ func TestContinueOnError_MirrorEndpoint(t *testing.T) {
59 59
 }
60 60
 
61 61
 func TestContinueOnError_NeverContinue(t *testing.T) {
62
-	for _, is_mirror_endpoint := range []bool{true, false} {
63
-		for _, err := range never_continue {
64
-			if continueOnError(err, is_mirror_endpoint) {
62
+	for _, isMirrorEndpoint := range []bool{true, false} {
63
+		for _, err := range neverContinue {
64
+			if continueOnError(err, isMirrorEndpoint) {
65 65
 				t.Errorf("Should never continue: %T: '%s'", err, err.Error())
66 66
 			}
67 67
 		}