Skip to content

Commit 7299f18

Browse files
authored
Merge pull request #1 from tunabay/init-ver
Initial version.
2 parents 1ed457d + 62c4633 commit 7299f18

File tree

20 files changed

+1693
-1
lines changed

20 files changed

+1693
-1
lines changed

.ci/golangci-lint.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
run:
2+
timeout: 5m
3+
tests: true
4+
fast: false
5+
skip-dirs-use-default: true
6+
print-issued-lines: true
7+
print-linter-name: true
8+
9+
linters:
10+
disable-all: true
11+
fast: false
12+
enable:
13+
- errcheck
14+
- gosimple
15+
- govet
16+
- ineffassign
17+
- staticcheck
18+
- typecheck
19+
- unused
20+
21+
- asasalint
22+
- asciicheck
23+
- bidichk
24+
- bodyclose
25+
- containedctx
26+
- contextcheck
27+
- dogsled
28+
- dupword
29+
- errchkjson
30+
- errname
31+
- errorlint
32+
- exportloopref
33+
- forbidigo
34+
- forcetypeassert
35+
- goconst
36+
- gocritic
37+
- goerr113
38+
- gofmt
39+
- gofumpt
40+
- goimports
41+
- gomodguard
42+
- goprintffuncname
43+
- gosec
44+
- importas
45+
- misspell
46+
- noctx
47+
- nolintlint
48+
- nosprintfhostport
49+
- prealloc
50+
- predeclared
51+
- reassign
52+
- revive
53+
- stylecheck
54+
- testpackage
55+
- testableexamples
56+
- thelper
57+
- unconvert
58+
- unparam
59+
- usestdlibvars
60+
- whitespace
61+
- wrapcheck
62+
63+
linters-settings:
64+
gofumpt:
65+
lang-version: "1.19"
66+
gosimple:
67+
go: "1.19"
68+
staticcheck:
69+
go: "1.19"
70+
stylecheck:
71+
go: "1.19"
72+
unused:
73+
go: "1.19"
74+
75+
misspell:
76+
locale: US
77+
78+
errcheck:
79+
exclude-functions:
80+
- io/ioutil.ReadFile
81+
- io.Copy(*bytes.Buffer)
82+
- io.Copy(os.Stdout)
83+
- (*github.com/tunabay/go-bitarray.Builder).WriteBit
84+
- (*github.com/tunabay/go-bitarray.Builder).WriteByte
85+
- (*github.com/tunabay/go-bitarray.Builder).WriteBitArray
86+
87+
issues:
88+
max-issues-per-linter: 0
89+
max-same-issues: 0
90+
fix: false
91+
92+
exclude-use-default: true
93+
exclude-rules:
94+
95+
# ignore in unit tests
96+
- linters: [ gosec, goerr113, ifshort ]
97+
path: "_test\\.go$"
98+
- linters: [ staticcheck ]
99+
text: "^SA9003: empty branch"

.github/workflows/go-test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: go-test
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches-ignore:
7+
- 'doc-*'
8+
- 'doc/*'
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- release
14+
jobs:
15+
go-tests:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: ^1.19
21+
- uses: actions/checkout@v3
22+
- name: go-test
23+
run: |
24+
go test -v -count=1 \
25+
-covermode=count \
26+
-coverpkg=github.com/tunabay/go-filecache \
27+
-coverprofile=cover.out \
28+
./...
29+
go tool cover -func=cover.out
30+
go tool cover -html=cover.out -o go-test-coverage.html
31+
- uses: actions/upload-artifact@v3
32+
with:
33+
path: go-test-coverage.html
34+
retention-days: 3
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches-ignore:
7+
- 'doc-*'
8+
- 'doc/*'
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- release
14+
jobs:
15+
golangci:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: ^1.19
21+
- uses: actions/checkout@v3
22+
- name: golangci-lint
23+
uses: golangci/golangci-lint-action@v3
24+
with:
25+
version: v1.50
26+
only-new-issues: true
27+
skip-go-installation: true
28+
args: >-
29+
--verbose
30+
--issues-exit-code=1
31+
--config=.ci/golangci-lint.yml

LICENSE

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright (c) 2022 Hirotsuna Mizuno - https://github.com/tunabay
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
# go-filecache
1+
# go-filecache
2+
3+
[![Go Reference](https://pkg.go.dev/badge/github.com/tunabay/go-filecache.svg)](https://pkg.go.dev/github.com/tunabay/go-filecache)
4+
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
5+
6+
7+
## Overview
8+
9+
Package filecache provides a LRU file caching mechanism to cache resources to
10+
the local disk that take a long time to generate or download from the network.
11+
12+
The creation process runs only once even if multiple go-routines concurrently
13+
request for a key that does not exist in the cache.
14+
15+
16+
## Documentation
17+
18+
- Read the [documentation](https://pkg.go.dev/github.com/tunabay/go-filecache).
19+
20+
21+
## License
22+
23+
go-filecache is available under the MIT license. See the [LICENSE](LICENSE) file
24+
for more information.

0 commit comments

Comments
 (0)