File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,21 @@ jobs:
1818 - ' ^1.18'
1919 - ' ^1.19'
2020 - ' ^1.20'
21+ - ' ^1.21'
22+ - ' ^1.22'
2123 steps :
2224 - name : Check out code into the Go module directory
23- uses : actions/checkout@v3
24- - uses : actions/setup-go@v3
25+ uses : actions/checkout@v4
26+ - uses : actions/setup-go@v5
2527 with :
2628 go-version : ${{ matrix.go }}
2729 cache : true
28- - name : Declare some variables
29- id : vars
30- run : |
31- echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt"
3230 - name : Test Coverage (pkg)
33- run : go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }}
31+ run : go test ./... -race -coverprofile="coverage.txt"
3432 - name : Upload coverage
35- if : ${{ matrix.go == '^1.20 ' }}
36- uses : codecov/codecov-action@v2
33+ if : ${{ matrix.go == '^1.22 ' }}
34+ uses : codecov/codecov-action@v4
3735 with :
38- files : ${{ steps.vars.outputs.coverage_txt }}
36+ file : " coverage.txt"
37+ token : ${{ secrets.CODECOV_TOKEN }}
3938
Original file line number Diff line number Diff line change @@ -49,6 +49,17 @@ func ExampleCache_Keys() {
4949 // baz
5050}
5151
52+ func ExampleCache_Len () {
53+ c := simple .NewCache [string , int ]()
54+ c .Set ("foo" , 1 )
55+ c .Set ("bar" , 2 )
56+ c .Set ("baz" , 3 )
57+ len := c .Len ()
58+ fmt .Println (len )
59+ // Output:
60+ // 3
61+ }
62+
5263func BenchmarkLenWithKeys (b * testing.B ) {
5364 c := simple .NewCache [string , int ]()
5465 c .Set ("foo" , 1 )
You can’t perform that action at this time.
0 commit comments