package client

import (
	"reflect"
	"testing"
)

func TestGenerateKeys(t *testing.T) {
	var tests = []struct {
		key  string
		size int
		want string
	}{
		{"ecdsa", 256, "*ecdsa.PrivateKey"},
		{"rsa", 1024, "*rsa.PrivateKey"},
		{"ed25519", 256, "*ed25519.PrivateKey"},
	}

	for _, tst := range tests {
		k, _, err := GenerateKey(tst.key, tst.size)
		if err != nil {
			t.Error(err)
		}
		if reflect.TypeOf(k).String() != tst.want {
			t.Errorf("Wrong key type returned. Got %T, wanted %s", k, tst.want)
		}
	}
}

package client

import (
	"reflect"
	"testing"
)

func TestGenerateKeys(t *testing.T) {
	var tests = []struct {
		key  string
		size int
		want string
	}{
		{"ecdsa", 256, "*ecdsa.PrivateKey"},
		{"rsa", 1024, "*rsa.PrivateKey"},
		{"ed25519", 256, "*ed25519.PrivateKey"},
	}

	for _, tst := range tests {
		k, _, err := GenerateKey(tst.key, tst.size)
		if err != nil {
			t.Error(err)
		}
		if reflect.TypeOf(k).String() != tst.want {
			t.Errorf("Wrong key type returned. Got %s, wanted %s", reflect.TypeOf(k).String(), tst.want)
		}
	}
}

--- 
+++ 
@@ -22,7 +22,7 @@
 			t.Error(err)
 		}
 		if reflect.TypeOf(k).String() != tst.want {
-			t.Errorf("Wrong key type returned. Got %s, wanted %s", reflect.TypeOf(k).String(), tst.want)
+			t.Errorf("Wrong key type returned. Got %T, wanted %s", k, tst.want)
 		}
 	}
 }
Use %T instead of reflect.
