tooling

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 9 Imported by: 4

Documentation

Overview

Package tooling provides common tooling install setup for go linting, formatting, and other Go tools with nice console output for interactive use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallTools

func InstallTools(tools []string) error

InstallTools installs tooling for the project in a local directory to avoid polluting global modules.

func SilentInstallTools

func SilentInstallTools(toolList []string) error

SilentInstallTools reads the stdout and then uses a spinner to show progress. This is designed to swallow up a lot of the noise with go install commands. Originally found from: https://www.yellowduck.be/posts/reading-command-output-line-by-line/ and modified.

func SpinnerStdOut

func SpinnerStdOut(
	binary string,
	cmdargs, list []string,
) error

SilentInstallTools reads the stdout and then uses a spinner to show progress. binary: name of tool to run, such as go, gofumpt, etc.

cmdargs: slice of string arguments to pass into command

list: optional list of strings that the command will iterate against.

- If no arguments, will range 1x over blank string

- If list is provided then loop will provide each invocation against it.

Example: SpinnerStdOut("go",[]string{"mod","tidy"},[]string{""})

Example: SpinnerStdOut("go",[]string{"install"},[]string{ "golang.org/x/tools/cmd/goimports@master","github.com/sqs/goreturns@master"}) This is designed to swallow up a lot of the noise with go install commands. Originally found from: https://www.yellowduck.be/posts/reading-command-output-line-by-line/ and modified.

Types

This section is empty.

Jump to

Keyboard shortcuts

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