package main

import (
	"bytes"
	"fmt"
	"github.com/teddywing/git-checkout-history/utils"
	"os"
	"os/exec"
)

func main() {
	args := os.Args[1:]
	
	if len(args) > 0 {
		utils.Store(args[0])
		
		cmd := exec.Command("git", "checkout", args[0])
		var out bytes.Buffer
		cmd.Stderr = &out
		err := cmd.Run()
		if err != nil {
			fmt.Fprintf(os.Stderr, err.Error())
		}
		fmt.Println(out.String())
	}
}

package main

import (
	"bytes"
	"fmt"
	"github.com/teddywing/git-checkout-history/utils"
	"os"
	"os/exec"
)

func main() {
	args := os.Args[1:]
	
	if len(args) > 0 {
		utils.Store(args[0])
		
		cmd := exec.Command("git", "checkout", args[0])
		var out bytes.Buffer
		cmd.Stderr = &out
		err := cmd.Run()
		if err != nil {
			fmt.Fprintf(os.Stderr, err.Error())
		}
		fmt.Print(out.String())
	}
}

Use Print instead of Println for cmd output
git-checkout-store: Use Print instead of Println for cmd output

Since we're just outputting the output of `git-checkout`, there's
already a newline at the end. We don't want to output an extra one, so
just send the `git-checkout` output to the screen verbatim.
