MCPcopy Create free account
hub / github.com/cli/go-gh / WithPadding

Function WithPadding

pkg/tableprinter/table.go:37–41  ·  view source on GitHub ↗

WithPadding overrides the padding function for the field. The function should transform a string argument into a string that is padded to fit within the given display width. The default behavior is to pad fields with spaces except for the last field. The padding function will be called after truncat

(fn func(int, string) string)

Source from the content-addressed store, hash-verified

35// with spaces except for the last field. The padding function will be called after truncation and before coloring.
36// Pass nil to disable padding for this value.
37func WithPadding(fn func(int, string) string) fieldOption {
38 return func(f *tableField) {
39 f.paddingFunc = fn
40 }
41}
42
43// WithColor sets the color function for the field. The function should transform a string value by wrapping
44// it in ANSI escape codes. The color function will not be used if the table was initialized in non-terminal mode.

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…