File tree 2 files changed +20
-10
lines changed
2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,21 @@ jobs:
18
18
- ' ^1.18'
19
19
- ' ^1.19'
20
20
- ' ^1.20'
21
+ - ' ^1.21'
22
+ - ' ^1.22'
21
23
steps :
22
24
- 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
25
27
with :
26
28
go-version : ${{ matrix.go }}
27
29
cache : true
28
- - name : Declare some variables
29
- id : vars
30
- run : |
31
- echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt"
32
30
- name : Test Coverage (pkg)
33
- run : go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }}
31
+ run : go test ./... -race -coverprofile="coverage.txt"
34
32
- 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
37
35
with :
38
- files : ${{ steps.vars.outputs.coverage_txt }}
36
+ file : " coverage.txt"
37
+ token : ${{ secrets.CODECOV_TOKEN }}
39
38
Original file line number Diff line number Diff line change @@ -49,6 +49,17 @@ func ExampleCache_Keys() {
49
49
// baz
50
50
}
51
51
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
+
52
63
func BenchmarkLenWithKeys (b * testing.B ) {
53
64
c := simple .NewCache [string , int ]()
54
65
c .Set ("foo" , 1 )
You can’t perform that action at this time.
0 commit comments