package control

import (
	"fmt"
	"strings"

	"github.com/rancher/os/log"
)

func yes(question string) bool {
	fmt.Printf("%s [y/N]: ", question)
	var line string
	_, err := fmt.Scan(&line)
	if err != nil {
		log.Fatal(err)
	}

	return strings.ToLower(line[0:1]) == "y"
}

package control

import (
	"bufio"
	"fmt"
	"os"
	"strings"

	"github.com/rancher/os/log"
)

func yes(question string) bool {
	fmt.Printf("%s [y/N]: ", question)
	in := bufio.NewReader(os.Stdin)
	line, err := in.ReadString('\n')
	if err != nil {
		log.Fatal(err)
	}

	return strings.ToLower(line[0:1]) == "y"
}

Use of bufio instead of fmt.Scan for yes function
Use of bufio instead of fmt.Scan for yes function
