Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whatwg updates #17

Merged
merged 5 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: golangci-lint

on:
pull_request:
push:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Checkout
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.49

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: test

on:
pull_request:
push:

jobs:
test:
name: go test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.16.0'
- run: go test ./...
4 changes: 2 additions & 2 deletions canonicalizer/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var GoogleSafeBrowsing = New(
url.WithPercentEncodeSinglePercentSign(),
url.WithPreParseHostFunc(func(u *url.Url, host string) string {
host = strings.Trim(host, ".")
var re = regexp.MustCompile("\\.\\.+")
var re = regexp.MustCompile(`\.\.+`)
host = re.ReplaceAllString(host, ".")
return host
}),
Expand All @@ -66,7 +66,7 @@ var Semantic = New(
url.WithPreParseHostFunc(func(u *url.Url, host string) string {
if host != "" {
host = strings.Trim(host, ".")
var re = regexp.MustCompile("\\.\\.+")
var re = regexp.MustCompile(`\.\.+`)
host = re.ReplaceAllString(host, ".")
if host == "" {
host = "0.0.0.0"
Expand Down
Loading