Skip to content

Commit

Permalink
fix: resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Sep 19, 2024
1 parent 73c2958 commit 7ed8899
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion revocation/crl/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ package crl

import "errors"

// ErrCacheMiss is an error type for when a cache miss occurs
// ErrCacheMiss is returned when a cache miss occurs.
var ErrCacheMiss = errors.New("cache miss")
6 changes: 3 additions & 3 deletions revocation/crl/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package crl provides Fetcher and Cache interface and implementations for
// fetching CRLs.
// Package crl provides Fetcher interface with its implementation, and the
// Cache interface.
package crl

import (
Expand Down Expand Up @@ -100,7 +100,7 @@ func (f *HTTPFetcher) Fetch(ctx context.Context, url string) (*Bundle, error) {
return bundle, nil
}

// fetch downloads the CRL from the given URL and saves it to the cache
// fetch downloads the CRL from the given URL.
func (f *HTTPFetcher) fetch(ctx context.Context, url string) (*Bundle, error) {
// fetch base CRL
base, err := fetchCRL(ctx, url, f.httpClient)
Expand Down
2 changes: 1 addition & 1 deletion revocation/internal/crl/crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
Result: result.ResultUnknown,
ServerResults: []*result.ServerResult{{
RevocationMethod: result.RevocationMethodCRL,
Error: errors.New("CRL fetcher is nil"),
Error: errors.New("CRL fetcher cannot be nil"),
Result: result.ResultUnknown,
}},
RevocationMethod: result.RevocationMethodCRL,
Expand Down
4 changes: 2 additions & 2 deletions revocation/internal/crl/crl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func TestCertCheckStatus(t *testing.T) {
CRLDistributionPoints: []string{"http://example.com"},
}
r := CertCheckStatus(context.Background(), cert, &x509.Certificate{}, CertCheckStatusOptions{})
if r.ServerResults[0].Error.Error() != "CRL fetcher is nil" {
t.Fatalf("expected CRL fetcher is nil, got %v", r.ServerResults[0].Error)
if r.ServerResults[0].Error.Error() != "CRL fetcher cannot be nil" {
t.Fatalf("expected CRL fetcher cannot be nil, got %v", r.ServerResults[0].Error)
}
})

Expand Down

0 comments on commit 7ed8899

Please sign in to comment.