Created
March 29, 2018 16:02
-
-
Save jabley/b2647b7329187a3180db05b6e8466cfe to your computer and use it in GitHub Desktop.
Generate a tracking pixel image
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 ( | |
"encoding/base64" | |
"log" | |
"os" | |
) | |
func main() { | |
b64 := "R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs=" | |
b, err := base64.StdEncoding.DecodeString(b64) | |
if err != nil { | |
log.Fatal(err) | |
} | |
f, err := os.Create("1x1.gif") | |
if err != nil { | |
log.Fatal(err) | |
} | |
if _, err := f.Write(b); err != nil { | |
log.Fatal(err) | |
} | |
if err := f.Close(); err != nil { | |
log.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment