rows

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package rows makes CLI output pretty

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TabRowWriter

type TabRowWriter struct {
	tabwriter.Writer
}

TabRowWriter struct is defining a new struct type called `TabRowWriter`. This struct is used to implement the `Writer` interface. It has a single field, `tabwriter.Writer`, which is embedded within the struct. This allows the `TabRowWriter` struct to have access to all the methods and fields of the embedded `tabwriter.Writer`.

func (*TabRowWriter) Write

func (w *TabRowWriter) Write(record []string) error

Write method is implementing the `Write` method of the `Writer` interface for the `TabRowWriter` struct. It takes a slice of strings called `record` as a parameter and returns an error.

type Writer

type Writer interface {
	Write([]string) error
}

Writer is defining an interface called `Writer`

func NewTabRowWriter

func NewTabRowWriter(w *tabwriter.Writer) Writer

NewTabRowWriter is a function that creates a new instance of the `TabRowWriter` struct, which implements the `Writer` interface. It takes a pointer to a `tabwriter.Writer` as a parameter and returns a `Writer` interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL