Overview Query function of the URL instance can be used to get the query params present in a URL https://pkg.go.dev/net/url#URL.Query Note that query param is represented as below in Golang https://pkg.go.dev/net/url#Values which…
Tag: go
Get full hostname along with port from a URL in Go (Golang)
Overview net/url package of golang contains a Parse function that can be used to parse a given and return the URL instance of the URL structhttps://golang.org/pkg/net/url/#URL Once the given URL is parsed…
Convert Query Param String to Query Param Hash in Go (Golang)
Overview Assume we have below query param string We want the output as a map as below Program Below is the program for the same Output
Extract a URL from a string in Go (Golang)
Overview Below go package can be used to extract URL from a given string https://github.com/mvdan/xurls There are two ways of using this package Strict – In strict mode, it matches only URLs…
Parse a URL and extract all the parts in Go (Golang)
Overview net/url package of golang contains a Parse function that can be used to parse a given and return the url instance of the URL struct https://golang.org/pkg/net/url/#URL Once the given URL is…
Create Slice or Array of Strings in Go (Golang)
Overview It is possible to create a slice or array of string data type in Golang as well. In fact, a slice or array can be created of any data type in…
Create Slice or Array of Floats in Go (Golang)
Overview It is possible to create a slice or array of float data type in Golang as well. In fact, a slice or array can be created of any data type in…
Create Slice or Array of Integers in Go (Golang)
Overview It is possible to create a slice or array of int data type in Golang as well. In fact, a slice or array can be created of any data type in…
Slice or Array of Bool in Go (Golang)
Overview It is possible to create a slice or array of bool data type in Golang as well. In fact, a slice or array can be created of any data type in…
Slice or Array of Channels in Go (Golang)
Overview It is possible to create a slice or array of channel data type in Golang as well. In fact, a slice or array can be created of any data type in…