Skip to content

Instantly share code, notes, and snippets.

@gnsx
Created June 3, 2019 05:15
Show Gist options
  • Save gnsx/70e0364d6db6274d4f13275520ed40b8 to your computer and use it in GitHub Desktop.
Save gnsx/70e0364d6db6274d4f13275520ed40b8 to your computer and use it in GitHub Desktop.
package main
import (
b64 "encoding/base64"
"fmt"
"io/ioutil"
"os"
)
func main() {
dat, err := ioutil.ReadFile("base64.input")
if err != nil {
fmt.Print("\nE-01:", err)
os.Exit(1)
}
sDec, _ := b64.StdEncoding.DecodeString(string(dat))
//fmt.Print(string(sDec))
f, err := os.Create("base64.output")
if err != nil {
fmt.Print("\nE-02:", err)
os.Exit(1)
}
defer f.Close()
f.Write(sDec)
f.Sync()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment