Skip to content

Commit

Permalink
Some extra documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed May 23, 2023
1 parent d19805a commit 05cd4b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions goada.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions goada_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 05cd4b9

Please sign in to comment.