title: Simple GoLang SSL example
body: <p>Just started out with go with a Python background. </p>
  
  <p>I need to make an SSL (HTTP GET and POST) connection to server with a self signed certificate and ignore (for now) the security errors. </p>
  
  <p>This is dead easy in Python, but I can't seem to find a simple example. </p>
  
  <p>Can somebody provide a really simple example.</p>
  
  <p>UPDATE:</p>
  
  <p>OK, so this is how it works, just need to work out how to disable the cert checking for now! </p>
  
  <p>package main</p>
  
  <pre><code>import (
      "fmt"
      "net/http"
      "io/ioutil"
      "os"
  )
  
  func main() {
      response, err := http.Get( "https://golang.com/")
      if err != nil {
          fmt.Printf("%s", err)
          os.Exit(1)
      } else {
          defer response.Body.Close()
          contents, err := ioutil.ReadAll(response.Body)
          if err != nil {
              fmt.Printf("%s", err)
              os.Exit(1)
          }
          fmt.Printf("%s\n", string(contents))
      }
  }
  </code></pre>