From 05cd4b9183da80fb6728c60bc492fba336b4a8eb Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 23 May 2023 11:34:17 -0400 Subject: [PATCH] Some extra documentation. --- goada.go | 4 ++++ goada_test.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/goada.go b/goada.go index 3184bc0..c8e2d63 100644 --- a/goada.go +++ b/goada.go @@ -25,6 +25,8 @@ type Url struct { cpointer C.ada_url } +// parse the given string into a URL, a finalizer +// will be set to free the URL when it is no longer needed. func New(urlstring string) (*Url, error) { if len(urlstring) == 0 { return nil, ErrEmptyString @@ -40,6 +42,8 @@ func New(urlstring string) (*Url, error) { return answer, nil } +// parse the given strings into a URL, a finalizer +// will be set to free the URL when it is no longer needed. func NewWithBase(urlstring string, basestring string) (*Url, error) { if len(urlstring) == 0 || len(basestring) == 0 { return nil, ErrEmptyString diff --git a/goada_test.go b/goada_test.go index 994f05b..6bc745d 100644 --- a/goada_test.go +++ b/goada_test.go @@ -61,10 +61,10 @@ func TestGoodUrlSet(t *testing.T) { } } -// go test -bench BenchmarkSilly -run - +// go test -bench Benchmark -run - func BenchmarkSillyAda(b *testing.B) { for j := 0; j < b.N; j++ { - _, err := New("https://www.google.com") + _, err := New("https://www.Googlé.com") if err != nil { break }