From 88d6c431751ffce2f95de4e0571a3f25c1a2dce0 Mon Sep 17 00:00:00 2001 From: piesquared <40523150+piecubed@users.noreply.github.com> Date: Sat, 6 Mar 2021 18:21:11 -0500 Subject: [PATCH] Rename url to Url --- totp.go | 4 ++-- totp_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/totp.go b/totp.go index 712cd07..e415397 100644 --- a/totp.go +++ b/totp.go @@ -281,7 +281,7 @@ func (otp *Totp) Secret() string { // URL returns a suitable URL, such as for the Google Authenticator app // example: otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example -func (otp *Totp) url() (string, error) { +func (otp *Totp) Url() (string, error) { // verify the proper initialization if err := totpHasBeenInitialized(otp); err != nil { @@ -322,7 +322,7 @@ func (otp *Totp) url() (string, error) { func (otp *Totp) QR() ([]byte, error) { // get the URL - u, err := otp.url() + u, err := otp.Url() // check for errors during initialization // this is already done on the URL method diff --git a/totp_test.go b/totp_test.go index 4cf621d..59433ee 100644 --- a/totp_test.go +++ b/totp_test.go @@ -308,12 +308,12 @@ func TestSerialization(t *testing.T) { t.Error("Deserialized hash property differ from original TOTP") } - deserializedUrl, err := deserializedOTP.url() + deserializedUrl, err := deserializedOTP.Url() if err != nil { t.Error(err) } - otpdUrl, err := otp.url() + otpdUrl, err := otp.Url() if err != nil { t.Error(err) } @@ -342,7 +342,7 @@ func TestSerialization(t *testing.T) { func TestProperInitialization(t *testing.T) { otp := Totp{} - if _, err := otp.url(); err == nil { + if _, err := otp.Url(); err == nil { t.Fatal("Totp is not properly initialized and the method did not catch it") } }