diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d0e905b..86c90d0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 @@ -24,4 +24,10 @@ jobs: run: go build -v ./... - name: Test - run: go test -v ./... + run: go test -v -coverprofile=coverage.out ./... + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage.out diff --git a/lthn/lthn.go b/lthn/lthn.go index 1b6c97d..dec885e 100644 --- a/lthn/lthn.go +++ b/lthn/lthn.go @@ -56,6 +56,6 @@ func createSalt(input string) string { } // Verify checks if an input string matches a given hash. -func Verifyf(input string, hash string) bool { +func Verify(input string, hash string) bool { return Hash(input) == hash } diff --git a/lthn/lthn_test.go b/lthn/lthn_test.go index b0fbb7d..3a04a1c 100644 --- a/lthn/lthn_test.go +++ b/lthn/lthn_test.go @@ -13,6 +13,6 @@ func TestHash(t *testing.T) { func TestVerify(t *testing.T) { hash := Hash("hello") - assert.True(t, Verifyf("hello", hash)) - assert.False(t, Verifyf("world", hash)) + assert.True(t, Verify("hello", hash)) + assert.False(t, Verify("world", hash)) }