1
0
Fork 0
mirror of https://github.com/laravel-ls/uri synced 2026-06-16 01:54:57 +02:00

uri: change Parse arg to s instead of uri

This commit is contained in:
Koichi Shiraishi 2019-05-24 19:56:52 +09:00
parent 6d8f0e4dcb
commit 30fa9f7ed8
No known key found for this signature in database
GPG key ID: A71DFD3B4DA7A79B
2 changed files with 5 additions and 5 deletions

4
uri.go
View file

@ -104,8 +104,8 @@ type State struct {
}
// Parse parses and creates a new URI from uri.
func Parse(uri string) *URI {
u, err := url.Parse(uri)
func Parse(s string) *URI {
u, err := url.Parse(s)
if err != nil {
panic(fmt.Sprintf("url.Parse: %#v\n", err))
}

View file

@ -16,12 +16,12 @@ import (
func TestParse(t *testing.T) {
tests := []struct {
name string
uri string
s string
want *uri.URI
}{
{
name: "Valid",
uri: "https://code.visualstudio.com/docs/extensions/overview#frag",
s: "https://code.visualstudio.com/docs/extensions/overview#frag",
want: &uri.URI{
Scheme: "https",
Authority: "code.visualstudio.com",
@ -35,7 +35,7 @@ func TestParse(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if diff := cmp.Diff(uri.Parse(tt.uri), tt.want); diff != "" {
if diff := cmp.Diff(uri.Parse(tt.s), tt.want); diff != "" {
t.Errorf("%s: (-got, +want)\n%s", tt.name, diff)
}
})