Go(lang) and http's empty "unsupported protocol scheme" error

Feb 04, 2023 · 1 min read · Post a comment

A bit controversial opinion, but every DevOps, Cloud engineer needs to know at least how to read application code. As I started my app development journey with Go, also known as Golang, I’ve faced a dozen of issues. To start with, here’s a solution to a general Go’s http package issue: Get "google.com": unsupported protocol scheme "" while trying to send a GET request method to google.com.


  • Go(lang)
  • Go http package


Take the following basic HTTP GET code snippet as an example:

package main
import (

func main() {
	resp, err := http.Get("google.com")
	if err != nil {

	defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)

    if err != nil {


If you run this code, without doubt, you’ll get the unsupported protocol scheme "" error.

As for the solution goes, you need to add http:// or https:// in front of google.com. Happy coding!


If you have any other great solutions on this topic, or even issues, feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.