Skip to content

Commit

Permalink
Support clock mocking.
Browse files Browse the repository at this point in the history
This addresses #15.
  • Loading branch information
kisom committed Dec 6, 2018
1 parent bbc82ff commit 71a7817
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
[prune]
go-tests = true
unused-packages = true

[[constraint]]
branch = "master"
name = "github.com/benbjohnson/clock"
5 changes: 4 additions & 1 deletion totp.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ import (
"net/url"
"strconv"
"strings"
"time"

"github.com/benbjohnson/clock"
)

var time clock.Clock

// TOTP represents an RFC 6238 Time-based One-Time Password instance.
type TOTP struct {
*OATH
Expand Down

0 comments on commit 71a7817

Please sign in to comment.