Skip to content

Commit

Permalink
dockertar-sha256-helper: Error without arg
Browse files Browse the repository at this point in the history
Provide a human understandable error when an argument is not provided.

Signed-off-by: Steve Milner <[email protected]>

Closes: projectatomic#1117
Approved by: giuseppe
  • Loading branch information
ashcrow authored and eyusupov committed Mar 10, 2018
1 parent 2dbec19 commit 92d4829
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dockertar-sha256-helper.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package main

import (
"fmt"
"compress/gzip"
"os"
"io"
"crypto/sha256"
"fmt"
"io"
"os"
)

func main() {
// Require one positional argument
if len(os.Args) != 2 {
panic("One positional argument is required")
}
reader, err := os.Open(os.Args[1])
if err != nil {
os.Exit(1)
Expand Down

0 comments on commit 92d4829

Please sign in to comment.