Skip to content

Instantly share code, notes, and snippets.

@lfaoro
Created May 17, 2019 10:32
Show Gist options
  • Save lfaoro/8936f234eaaeffd5e4a4e3935d1bd4e2 to your computer and use it in GitHub Desktop.
Save lfaoro/8936f234eaaeffd5e4a4e3935d1bd4e2 to your computer and use it in GitHub Desktop.
info, err := os.Stat(fileName)
if err != nil {
return err
}
if info.IsDir() {
message := fmt.Sprintf(`
Sorry, I can't upload a whole directory.
Try:
$ tar -cvf %s.tar %s/
$ ncrypt %s.tar
`, info.Name(), info.Name(), info.Name())
fmt.Println(message)
os.Exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment