Created
May 11, 2018 16:43
-
-
Save mattsdni/891f6fabe6c6e880efae5eb6c520ac45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"io/ioutil" | |
"os" | |
) | |
func main() { | |
response, err := http.Get("https://gist.githubusercontent.com/mattsdni/891f6fabe6c6e880efae5eb6c520ac45/raw/quine.go") | |
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)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment