Skip to content

Instantly share code, notes, and snippets.

@felixge felixge/main.go Secret
Created Oct 23, 2017

What would you like to do?
package main
import (
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
func run() error {
var (
urlF = flag.String("url", "", "URL to upload to.")
fmt.Printf("%s\n", runtime.Version())
res, err := http.Get(*urlF)
if err != nil {
return err
defer res.Body.Close()
resData, err := ioutil.ReadAll(res.Body)
if err != nil {
return err
fmt.Printf("%d %s\n", res.StatusCode, res.Status)
fmt.Printf("%s\n", resData)
return nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.