diff --git a/README.md b/README.md index ac92484..109ee1a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://img.shields.io/drone/build/xoxys/url-parser?logo=drone)](https://cloud.drone.io/xoxys/url-parser) [![Codecov](https://img.shields.io/codecov/c/github/xoxys/url-parser)](https://codecov.io/gh/xoxys/url-parser) +[![Go Report Card](https://goreportcard.com/badge/github.com/xoxys/url-parser)](https://goreportcard.com/report/github.com/xoxys/url-parser) [![License: MIT](https://img.shields.io/github/license/xoxys/url-parser)](LICENSE) Inspired by [herloct/url-parser](https://github.com/herloct/url-parser), a simple command-line utility for parsing URLs. diff --git a/commands/commands_test.go b/commands/commands_test.go index 20b7a15..afb8b66 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -11,7 +11,7 @@ func TestParseURL(t *testing.T) { urlString := "postgres://user:pass@host.com:5432/path/to?key=value&other=other%20value#some-fragment" tables := []TestParseData{ - TestParseData{ + { urlString: urlString, expected: urlString, }, diff --git a/commands/password_test.go b/commands/password_test.go index 63c8db0..797c52c 100644 --- a/commands/password_test.go +++ b/commands/password_test.go @@ -18,7 +18,7 @@ func TestPassword(t *testing.T) { urlString := "postgres://user:pass@host.com:5432/path/to?key=value&other=other%20value#some-fragment" tables := []TestPasswordData{ - TestPasswordData{ + { urlString: urlString, expected: "pass", }, diff --git a/commands/path_test.go b/commands/path_test.go index f5f77d6..d551e6d 100644 --- a/commands/path_test.go +++ b/commands/path_test.go @@ -19,12 +19,12 @@ func TestPath(t *testing.T) { urlString := "postgres://user:pass@host.com:5432/path/to?key=value&other=other%20value#some-fragment" tables := []TestPathData{ - TestPathData{ + { urlString: urlString, pathIndex: -1, expected: "/path/to", }, - TestPathData{ + { urlString: urlString, pathIndex: 0, expected: "path", diff --git a/commands/run_test.go b/commands/run_test.go index 12ee8d7..42d0f0a 100644 --- a/commands/run_test.go +++ b/commands/run_test.go @@ -18,7 +18,7 @@ func TestRun(t *testing.T) { urlString := "postgres://user:pass@host.com:5432/path/to?key=value&other=other%20value#some-fragment" tables := []TestRunData{ - TestRunData{ + { urlString: urlString, expected: urlString, }, diff --git a/commands/scheme_test.go b/commands/scheme_test.go index ab40f25..9e5b268 100644 --- a/commands/scheme_test.go +++ b/commands/scheme_test.go @@ -18,7 +18,7 @@ func TestScheme(t *testing.T) { urlString := "postgres://user:pass@host.com:5432/path/to?key=value&other=other%20value#some-fragment" tables := []TestSchemeData{ - TestSchemeData{ + { urlString: urlString, expected: "postgres", }, diff --git a/commands/user_test.go b/commands/user_test.go index ec727a0..680d1cb 100644 --- a/commands/user_test.go +++ b/commands/user_test.go @@ -18,7 +18,7 @@ func TestUser(t *testing.T) { urlString := "postgres://user:pass@host.com:5432/path/to?key=value&other=other%20value#some-fragment" tables := []TestUserData{ - TestUserData{ + { urlString: urlString, expected: "user", },