ncruces/zenity

zenity.SelectFileSave adds a \n character

Closed this issue · 3 comments

Hello!

This is weird, but when I call zenity.SelectFileSave(), it adds a newline character at the end of the filepath returned by the function, regardless of what I type in for the filename. Here's a quick test:

package main

import (
	"fmt"

	"github.com/ncruces/zenity"
)

func main() {

	filename, err := zenity.SelectFileSave()

	if err != nil {
		panic(err)
	}

	fmt.Println(fmt.Sprintf("%q", filename))

}

And here's the output with a saved file named test:
"/home/solarlune/Documents/Projects/Go/Tests/zenity/test\n"

This is a fresh project with freshly go getted zenity, Pop OS 20.10, go version 1.16.2.

This was introduced in 71541c2. I'll revert that change.

Thanks!

Tagged as v0.7.4.

Will do the release shortly, but it should be available through go get.

Fantastic. Thanks a lot for the prompt fix; really appreciate it!