Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
/ urls Public archive
forked from mec07/urls

Join URLs and manipulate query parameters

License

Notifications You must be signed in to change notification settings

processout/urls

 
 

Repository files navigation

urls

Join URLs and manipulate query parameters.

For example, you may want to simply add a path onto your url. If you were to use the path pacakge you would end up with an unexpected result:

	newURL := path.Join("http://original.url.com/stuff", "addition")
	// newURL is "http:/original.url.com/stuff/addition", which is unexpected

With this package you can end up with the expected result:

	newURL, err := urls.Join("http://original.url.com/stuff", "addition")
	// newURL is "http://original.url.com/stuff/addition", as expected

If you are alredy starting with a *url.URL pointer then you can get an updated *url.URL pointer:

	myURL, _ := url.Parse("http://original.url.com/stuff")
	urls.JoinURL(myURL, "addition")
	// myURL.String() is "http://original.url.com/stuff/addition", as expected

Documentation

See the documentation on godoc.org.

About

Join URLs and manipulate query parameters

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.0%
  • Makefile 7.0%