From 668aa5dae1690d1a061da728f83b2450485d47f4 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Mon, 27 Oct 2014 15:12:18 +0100 Subject: Make the constants have types While Go will assign the correct type to a const block when it auto-creates the values, assigning makes the const be typeless and will only gain it in each particular use. Make each constant in the blocks have an assigned type. --- remote_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remote_test.go') diff --git a/remote_test.go b/remote_test.go index 6d81df4..631a6cd 100644 --- a/remote_test.go +++ b/remote_test.go @@ -46,7 +46,7 @@ func TestListRemotes(t *testing.T) { compareStringList(t, expected, actual) } -func assertHostname(cert *Certificate, valid bool, hostname string, t *testing.T) int { +func assertHostname(cert *Certificate, valid bool, hostname string, t *testing.T) ErrorCode { if hostname != "github.com" { t.Fatal("Hostname does not match") return ErrUser @@ -64,7 +64,7 @@ func TestCertificateCheck(t *testing.T) { checkFatal(t, err) callbacks := RemoteCallbacks{ - CertificateCheckCallback: func(cert *Certificate, valid bool, hostname string) int { + CertificateCheckCallback: func(cert *Certificate, valid bool, hostname string) ErrorCode { return assertHostname(cert, valid, hostname, t) }, } -- cgit v1.2.3