-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In preparation for more work, related to #112, #37 and #8. - Migrated all tests to use testify's `Suite` instead of direct `assert` calls. - Simplified how the credentials file location is determined, now it's defined in one simple function. Changes I may revert: I hate string concatenation, it's just ugly in my eyes, so I may just add that linter to disabled and revert to `Sprintf`. I know it's more efficient, but not on this scale. Closes #8 References: - #8 - #37 - #112
- Loading branch information
Showing
19 changed files
with
327 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ifeq (, $(shell which testifylint)) | ||
$(error "No 'testifylint' on PATH, consider doing: go install github.com/Antonboom/testifylint@latest") | ||
endif | ||
|
||
ifeq (, $(shell which golint)) | ||
$(error "No 'golint' on PATH, consider doing: go install golang.org/x/lint/golint@latest") | ||
endif | ||
|
||
ifeq (, $(shell which golangci-lint)) | ||
$(error "No 'golangci-lint' on PATH, consider following these instructions: https://golangci-lint.run/welcome/install/#local-installation") | ||
endif | ||
|
||
.PHONY: lint | ||
lint: | ||
golint -set_exit_status ./... | ||
testifylint ./... | ||
golangci-lint run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
module github.com/yitsushi/totp-cli | ||
|
||
go 1.21 | ||
go 1.22 | ||
|
||
require ( | ||
filippo.io/age v1.1.1 | ||
github.com/stretchr/testify v1.7.1 | ||
github.com/urfave/cli/v2 v2.27.1 | ||
golang.org/x/term v0.16.0 | ||
golang.org/x/term v0.18.0 | ||
gopkg.in/yaml.v3 v3.0.1 | ||
) | ||
|
||
require ( | ||
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect | ||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect | ||
golang.org/x/crypto v0.17.0 // indirect | ||
golang.org/x/sys v0.16.0 // indirect | ||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect | ||
golang.org/x/crypto v0.21.0 // indirect | ||
golang.org/x/sys v0.18.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package security | ||
|
||
import "fmt" | ||
|
||
// OTPError is an error describing an error during generation. | ||
type OTPError struct { | ||
Message string | ||
} | ||
|
||
func (e OTPError) Error() string { | ||
return fmt.Sprintf("otp error: %s", e.Message) | ||
return "otp error: " + e.Message | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.