Skip to content

Commit

Permalink
Use urlx.MustParse
Browse files Browse the repository at this point in the history
  • Loading branch information
msuozzo committed Feb 19, 2025
1 parent 5ef7529 commit 6e63b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions internal/timewarp/timewarp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import (
"time"

"github.com/google/oss-rebuild/internal/httpx"
"github.com/google/oss-rebuild/internal/urlx"
"github.com/pkg/errors"
)

var (
npmRegistry, _ = url.Parse("https://registry.npmjs.org/")
pypiRegistry, _ = url.Parse("https://pypi.org/simple")
lowTimeBound = time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)
npmRegistry = urlx.MustParse("https://registry.npmjs.org/")
pypiRegistry = urlx.MustParse("https://pypi.org/simple")
lowTimeBound = time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)
)

func parseTime(ts string) (*time.Time, error) {
Expand Down
2 changes: 1 addition & 1 deletion tools/pypi_rss/listener/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (f *FakeQueue) Add(ctx context.Context, url string, msg api.Message) (*clou

func TestListenerHandle(t *testing.T) {
ctx := context.Background()
apiURL, _ := url.Parse("http://fake-api-url")
apiURL := urlx.MustParse("http://fake-api-url")
testTime, _ := time.Parse(time.RFC1123, "Mon, 02 Jan 2006 15:04:05 MST")
tests := []struct {
name string
Expand Down

0 comments on commit 6e63b5c

Please sign in to comment.