Skip to content

Commit ca59342

Browse files
committed
fixed spelling and formatting issues
- changed line endings to be consistent with the rest of the package - fixed spelling mistakes in comments - corrected spelling error in LoadHttp error message - added go report card badge to README
1 parent a52a9dd commit ca59342

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

README.md

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

33
[![Go Reference](https://pkg.go.dev/badge/github.com/wranders/coredns-filter.svg)](https://pkg.go.dev/github.com/wranders/coredns-filter)
44
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=wranders_coredns-filter&metric=coverage)](https://sonarcloud.io/summary/overall?id=wranders_coredns-filter)
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/wranders/coredns-filter)](https://goreportcard.com/report/github.com/wranders/coredns-filter)
56

67
*filter* - provides domain blocking functionality
78

error.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package filter
2-
3-
import "fmt"
4-
5-
type errorExpectedEOL struct {
6-
data interface{}
7-
}
8-
9-
func (e errorExpectedEOL) Error() string {
10-
return fmt.Sprintf("unexpected token(s): %q; expected end of line", e.data)
11-
}
1+
package filter
2+
3+
import "fmt"
4+
5+
type errorExpectedEOL struct {
6+
data interface{}
7+
}
8+
9+
func (e errorExpectedEOL) Error() string {
10+
return fmt.Sprintf("unexpected token(s): %q; expected end of line", e.data)
11+
}

load.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ func GetListLoadFunc(uri string) (ListLoadFunc, error) {
2020
return nil, fmt.Errorf("invalid list URL %q; %w", uri, err)
2121
}
2222
if len(listUrl.Scheme) == 0 || len(listUrl.Host) == 0 {
23-
// URL parsing ambiguity means Parse does not always return an error witn an
24-
// invalid URL. Explicitly check that the Scheme and Host are non-zero
25-
// values so that they will be usable later.
23+
// URL parsing ambiguity means Parse does not always return an error
24+
// with an invalid URL. Explicitly check that the Scheme and Host are
25+
// non-zero values so that they will be usable later.
2626
return nil, fmt.Errorf("invalid list URL %q; scheme or host empty", uri)
2727
}
2828
switch listUrl.Scheme {
@@ -58,7 +58,7 @@ func LoadHttp(path string) (io.ReadCloser, error) {
5858
}
5959
if resp.StatusCode != 200 {
6060
return nil, fmt.Errorf(
61-
"an error occured fetching list %q; %s",
61+
"an error occurred fetching list %q; %s",
6262
path,
6363
resp.Status,
6464
)

0 commit comments

Comments
 (0)