Skip to content

Commit

Permalink
more testing added, new badges in readme, and pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pzentenoe committed Jul 3, 2024
1 parent 59f8fe2 commit dca1837
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ go.work

.idea/
*.iml



20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-vet
- id: go-lint
- id: go-cyclo
args: [-over=15]
- id: go-imports
- id: golangci-lint
# - id: go-misspell
- id: go-unit-tests

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ check: install-tools
$(INEFFASSIGN) .

test:
go test ./...
go test ./...
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The go-cache library is a high-performance, in-memory key-value store written in

![CI](https://github.com/pzentenoe/go-cache/actions/workflows/actions.yml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/pzentenoe/go-cache)](https://goreportcard.com/report/github.com/pzentenoe/go-cache)
![License](https://img.shields.io/github/license/pzentenoe/go-cache.svg)
![GitHub issues](https://img.shields.io/github/issues/pzentenoe/go-cache.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/pzentenoe/go-cache.svg)
![Quality Gate](https://sonarqube.vikingcode.cl/api/project_badges/measure?project=go-cache&metric=alert_status&token=sqb_308a7e8ba0f56c9872f5db0aa7ec5ed3a491ab1e)
![Coverage](https://sonarqube.vikingcode.cl/api/project_badges/measure?project=go-cache&metric=coverage&token=sqb_308a7e8ba0f56c9872f5db0aa7ec5ed3a491ab1e)
![Bugs](https://sonarqube.vikingcode.cl/api/project_badges/measure?project=go-cache&metric=bugs&token=sqb_308a7e8ba0f56c9872f5db0aa7ec5ed3a491ab1e)
Expand Down Expand Up @@ -169,7 +172,7 @@ Get(k string) (any, bool)
```
Gets an item from the cache. Returns the item or nil, and a boolean indicating whether the key was found.

#### GetWithExpiration
#### GetWithExpiration
```go
GetWithExpiration(k string) (any, time.Time, bool)
```
Expand Down Expand Up @@ -279,4 +282,4 @@ This project is released under the MIT License. See the [LICENSE](LICENSE) file
For a detailed changelog, refer to [CHANGELOG.md](CHANGELOG.md).

## Author
- **Pablo Zenteno** - _Full Stack Developer_ - [pzentenoe](https://github.com/pzentenoe)
- **Pablo Zenteno** - _Full Stack Developer_ - [pzentenoe](https://github.com/pzentenoe)
3 changes: 2 additions & 1 deletion increment_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cache

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestCache_Increment(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion serialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package cache
import (
"bytes"
"encoding/gob"
"github.com/stretchr/testify/assert"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestCache_Save(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion sharded_cache_factory_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cache

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestNewShardedCache(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion sharded_cache_utils_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cache

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestDjb33(t *testing.T) {
Expand Down

0 comments on commit dca1837

Please sign in to comment.