style: gofmt

This commit is contained in:
yory8 2019-09-15 09:34:04 +02:00
parent bcfcd493fc
commit 9f4d0dd044

View file

@ -31,7 +31,7 @@ func dmenu(list []string, max int, tool string) (string, error) {
} }
if tool == "-" { if tool == "-" {
escaped, _ := preprocess_history(list, false) escaped, _ := preprocessHistory(list, false)
os.Stdout.WriteString(strings.Join(escaped, "\n")) os.Stdout.WriteString(strings.Join(escaped, "\n"))
return "", nil return "", nil
} }
@ -57,7 +57,7 @@ func dmenu(list []string, max int, tool string) (string, error) {
return "", fmt.Errorf("Unsupported tool") return "", fmt.Errorf("Unsupported tool")
} }
escaped, guide := preprocess_history(list, true) escaped, guide := preprocessHistory(list, true)
input := strings.NewReader(strings.Join(escaped, "\n")) input := strings.NewReader(strings.Join(escaped, "\n"))
cmd := exec.Cmd{Path: bin, Args: args, Stdin: input} cmd := exec.Cmd{Path: bin, Args: args, Stdin: input}
@ -79,7 +79,7 @@ func dmenu(list []string, max int, tool string) (string, error) {
return sel, nil return sel, nil
} }
func preprocess_history(list []string, cutting bool) ([]string, map[string]string) { func preprocessHistory(list []string, cutting bool) ([]string, map[string]string) {
// dmenu will break if items contain newlines, so we must pass them as literals. // dmenu will break if items contain newlines, so we must pass them as literals.
// however, when it sends them back, we need a way to restore them // however, when it sends them back, we need a way to restore them
var escaped []string var escaped []string