Created
June 3, 2019 05:15
-
-
Save gnsx/70e0364d6db6274d4f13275520ed40b8 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 ( | |
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