Improved documentation.

This commit is contained in:
Nuno Cruces 2020-01-29 16:45:40 +00:00
parent ba1f15ed0e
commit 5204cc85be
7 changed files with 37 additions and 12 deletions

View File

@ -374,14 +374,17 @@ func egestPaths(paths []string, err error) ([]string, error) {
return paths, err return paths, err
} }
// FileFilters is internal.
type FileFilters struct { type FileFilters struct {
zenity.FileFilters zenity.FileFilters
} }
// String is internal.
func (f *FileFilters) String() string { func (f *FileFilters) String() string {
return "zenity.FileFilters" return "zenity.FileFilters"
} }
// Set is internal.
func (f *FileFilters) Set(s string) error { func (f *FileFilters) Set(s string) error {
var filter zenity.FileFilter var filter zenity.FileFilter

View File

@ -8,6 +8,7 @@ import (
"golang.org/x/image/colornames" "golang.org/x/image/colornames"
) )
// ParseColor is internal.
func ParseColor(s string) color.Color { func ParseColor(s string) color.Color {
if len(s) == 4 || len(s) == 5 { if len(s) == 4 || len(s) == 5 {
c := color.NRGBA{A: 0xf} c := color.NRGBA{A: 0xf}
@ -46,6 +47,7 @@ func ParseColor(s string) color.Color {
return nil return nil
} }
// UnparseColor is internal.
func UnparseColor(c color.Color) string { func UnparseColor(c color.Color) string {
n := color.NRGBAModel.Convert(c).(color.NRGBA) n := color.NRGBAModel.Convert(c).(color.NRGBA)
if n.A == 255 { if n.A == 255 {

View File

@ -1,7 +1,13 @@
package zenutil package zenutil
const LineBreak = "\n" // These are internal.
const (
LineBreak = "\n"
)
var Command bool // These are internal.
var Timeout int var (
var Separator = "\x00" Command bool
Timeout int
Separator = "\x00"
)

View File

@ -3,8 +3,14 @@
// Package zenutil is internal. DO NOT USE. // Package zenutil is internal. DO NOT USE.
package zenutil package zenutil
const LineBreak = "\n" // These are internal.
const (
LineBreak = "\n"
)
var Command bool // These are internal.
var Timeout int var (
var Separator = "\x1e" Command bool
Timeout int
Separator = "\x1e"
)

View File

@ -1,7 +1,13 @@
package zenutil package zenutil
const LineBreak = "\r\n" // These are internal.
const (
LineBreak = "\r\n"
)
var Command bool // These are internal.
var Timeout int var (
var Separator string Command bool
Timeout int
Separator string
)

View File

@ -8,6 +8,7 @@ import (
"syscall" "syscall"
) )
// Run is internal.
func Run(ctx context.Context, script string, data interface{}) ([]byte, error) { func Run(ctx context.Context, script string, data interface{}) ([]byte, error) {
var buf strings.Builder var buf strings.Builder

View File

@ -22,6 +22,7 @@ func init() {
tool = "zenity" tool = "zenity"
} }
// Run is internal.
func Run(ctx context.Context, args []string) ([]byte, error) { func Run(ctx context.Context, args []string) ([]byte, error) {
if Command && path != "" { if Command && path != "" {
if Timeout > 0 { if Timeout > 0 {