Skip to content

Commit 2a15bec

Browse files
committed
Deprecate golang versions
Deprecate support for Golang version 1.15 and 1.16, and improve the package documentation.
1 parent f488884 commit 2a15bec

File tree

14 files changed

+63
-36
lines changed

14 files changed

+63
-36
lines changed

.github/workflows/test.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414
strategy:
1515
matrix:
1616
go-version:
17-
- '1.15.x'
18-
- '1.16.x'
1917
- '1.17.x'
18+
- '1.18.x'
19+
- '1.19.x'
20+
- '1.20.x'
2021
platform: [ubuntu-latest]
2122

2223
name: test
@@ -38,24 +39,26 @@ jobs:
3839

3940
steps:
4041
- name: checkout the code
41-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4243

4344
- name: setup go
44-
uses: actions/setup-go@v2
45+
uses: actions/setup-go@v3
4546
with:
4647
go-version: ${{ matrix.go-version }}
4748

48-
- name: install golanci-linter
49-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.43.0
49+
- name: unshallow
50+
run: git fetch --prune --unshallow
51+
52+
- name: golanci-linter
53+
uses: golangci/golangci-lint-action@v3
54+
with:
55+
version: v1.51.2
5056

5157
- name: run unit tests
5258
run: make test
5359

54-
- name: run linter
55-
run: make lint
56-
5760
- name: upload code coverage
58-
uses: codecov/codecov-action@v2.0.2
61+
uses: codecov/codecov-action@v3.1.1
5962
if: contains(github.ref, 'master')
6063
with:
6164
file: ./cover.out

.golangci.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ format = "colored-line-number"
66

77
[linters]
88
enable = [
9-
"gocyclo", "unconvert", "goimports", "unused", "varcheck", "vetshadow",
10-
"misspell", "nakedret", "errcheck", "revive", "ineffassign", "deadcode",
11-
"goconst", "vet", "unparam", "gofumpt", "prealloc", "gomnd", "gocritic"
12-
]
9+
"gocyclo", "unconvert", "goimports", "unused", "vetshadow","misspell",
10+
"nakedret", "errcheck", "revive", "ineffassign", "goconst", "vet",
11+
"unparam", "gofumpt", "prealloc", "gomnd", "gocritic"]
1312

1413
[issues]
1514
exclude-use-default = false

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Clean up
44
clean:
5-
@rm -fR ./cover*
5+
@rm -fR ./vendor/ ./cover.*
66
.PHONY: clean
77

88
# Run tests and generates html coverage file

bolt/bolt.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package bolt providers a cache driver that stores the cache using BoltDB.
12
package bolt
23

34
import (

chain/chain.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package chain provides chaining cache drivers operations, in case of failure
2+
// the driver try to apply using the next driver informed, until fail.
13
package chain
24

35
import (

doc.go

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
// Package cachego provides a simple way to use cache drivers.
22
//
3-
// Example Usage
3+
// # Example Usage
44
//
55
// The following is a simple example using memcached driver:
6-
// import (
7-
// "fmt"
8-
// "github.com/faabiosr/cachego"
9-
// "github.com/bradfitz/gomemcache/memcache"
10-
// )
116
//
12-
// func main() {
7+
// import (
8+
// "fmt"
9+
// "github.com/faabiosr/cachego"
10+
// "github.com/bradfitz/gomemcache/memcache"
11+
// )
1312
//
14-
// cache := cachego.NewMemcached(
15-
// memcached.New("localhost:11211"),
16-
// )
13+
// func main() {
1714
//
18-
// cache.Save("foo", "bar")
15+
// cache := cachego.NewMemcached(
16+
// memcached.New("localhost:11211"),
17+
// )
1918
//
20-
// fmt.Println(cache.Fetch("foo"))
21-
// }
19+
// cache.Save("foo", "bar")
20+
//
21+
// fmt.Println(cache.Fetch("foo"))
22+
// }
2223
package cachego

file/file.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package file providers a cache driver that stores the cache content in files.
12
package file
23

34
import (

go.mod

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
module github.com/faabiosr/cachego
22

3-
go 1.15
3+
go 1.17
44

55
require (
66
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d
7-
github.com/garyburd/redigo v1.6.0 // indirect
87
github.com/mattn/go-sqlite3 v1.6.0
9-
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
10-
github.com/onsi/ginkgo v1.13.0 // indirect
118
go.etcd.io/bbolt v1.3.4
129
go.mongodb.org/mongo-driver v1.9.0
13-
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a // indirect
14-
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
1510
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528
1611
gopkg.in/redis.v4 v4.2.4
1712
)
13+
14+
require (
15+
github.com/garyburd/redigo v1.6.0 // indirect
16+
github.com/go-stack/stack v1.8.0 // indirect
17+
github.com/golang/snappy v0.0.1 // indirect
18+
github.com/klauspost/compress v1.13.6 // indirect
19+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
20+
github.com/onsi/ginkgo v1.13.0 // indirect
21+
github.com/onsi/gomega v1.10.1 // indirect
22+
github.com/pkg/errors v0.9.1 // indirect
23+
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
24+
github.com/xdg-go/scram v1.0.2 // indirect
25+
github.com/xdg-go/stringprep v1.0.2 // indirect
26+
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
27+
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect
28+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
29+
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 // indirect
30+
golang.org/x/text v0.3.5 // indirect
31+
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a // indirect
32+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
33+
gopkg.in/yaml.v2 v2.3.0 // indirect
34+
)

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
1616
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
1717
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
1818
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
19-
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
2019
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
2120
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
2221
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@@ -104,7 +103,6 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ
104103
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
105104
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
106105
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
107-
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
108106
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
109107
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a h1:stTHdEoWg1pQ8riaP5ROrjS6zy6wewH/Q2iwnLCQUXY=
110108
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610=

memcached/memcached.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package memcached providers a cache driver that stores the cache in Memcached.
12
package memcached
23

34
import (

mongo/mgo.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package mongo providers a cache driver that uses MongoDB with MGO driver.
12
package mongo
23

34
import (

redis/redis.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package redis providers a cache driver that stores the cache in Redis.
12
package redis
23

34
import (

sqlite3/sqlite3.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package sqlite3 providers a cache driver that stores the cache in SQLite3.
12
package sqlite3
23

34
import (

sync/map.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package sync providers a cache driver that uses standard golang sync.Map.
12
package sync
23

34
import (

0 commit comments

Comments
 (0)