package main

import (
	"flag"
	"fmt"
	"log"
	"os"
	"os/exec"
)

var output string

func init() {
	flag.Usage = func() {
		fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0])
		flag.PrintDefaults()
	}

	flag.StringVar(&output, "out", "out.go", "Specify a path to the output file")

	flag.Parse()
}

func main() {
	checkRequirements()

	file, err := os.Open(flag.Arg(0))
	if err != nil {
		log.Fatalf("%s\n", err)
	}
	defer file.Close()

	prog := "go"
	path, err := exec.LookPath(prog)
	if err != nil {
		log.Fatalf("please, install %s first.", prog)
	}
	fmt.Printf("%s is available at %s\n", prog, path)

	fmt.Printf("input file: %s, output file: %s\n", flag.Arg(0), output)
}

func checkRequirements() {
	args := flag.Args()

	if len(args) == 0 {
		flag.Usage()

		log.Fatalf("the input file not specified\n")
	} else if len(args) > 1 {
		log.Printf("to many positional arguments, ignoring %v\n", args[1:])
	}
}

package main

import (
	"flag"
	"fmt"
	"os"
	"os/exec"
)

var output string

func init() {
	flag.Usage = func() {
		fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0])
		flag.PrintDefaults()
	}

	flag.StringVar(&output, "out", "out.go", "Specify a path to the output file")

	flag.Parse()
}

func main() {
	checkRequirements()

	file, err := os.Open(flag.Arg(0))
	if err != nil {
		fmt.Printf("Error! %s\n", err)
		os.Exit(2)
	}
	defer file.Close()

	prog := "go"
	path, err := exec.LookPath(prog)
	if err != nil {
		fmt.Printf("Please, install %s first.", prog)
	}
	fmt.Printf("%s is available at %s\n", prog, path)

	fmt.Printf("input file: %s, output file: %s\n", flag.Arg(0), output)
}

func checkRequirements() {
	args := flag.Args()

	if len(args) == 0 {
		flag.Usage()

		fmt.Printf("Error! The input file is required\n")

		os.Exit(1)
	} else if len(args) > 1 {
		fmt.Printf("Notice! To many positional arguments, ignoring %v\n", args[1:])
	}
}

--- 
+++ 
@@ -3,6 +3,7 @@
 import (
 	"flag"
 	"fmt"
+	"log"
 	"os"
 	"os/exec"
 )
@@ -25,15 +26,14 @@
 
 	file, err := os.Open(flag.Arg(0))
 	if err != nil {
-		fmt.Printf("Error! %s\n", err)
-		os.Exit(2)
+		log.Fatalf("%s\n", err)
 	}
 	defer file.Close()
 
 	prog := "go"
 	path, err := exec.LookPath(prog)
 	if err != nil {
-		fmt.Printf("Please, install %s first.", prog)
+		log.Fatalf("please, install %s first.", prog)
 	}
 	fmt.Printf("%s is available at %s\n", prog, path)
 
@@ -46,10 +46,8 @@
 	if len(args) == 0 {
 		flag.Usage()
 
-		fmt.Printf("Error! The input file is required\n")
-
-		os.Exit(1)
+		log.Fatalf("the input file not specified\n")
 	} else if len(args) > 1 {
-		fmt.Printf("Notice! To many positional arguments, ignoring %v\n", args[1:])
+		log.Printf("to many positional arguments, ignoring %v\n", args[1:])
 	}
 }
Use `log` package instead of `fmt` for logging and exiting
