mirror of https://github.com/cheat/cheat.git
chore(lint): various changes to appease revive
- Add `package` comments - Rename `opts` to `_` where unused
This commit is contained in:
parent
95a4e31b6c
commit
bfb071c0b2
|
@ -6,6 +6,6 @@ import (
|
||||||
"github.com/cheat/cheat/internal/config"
|
"github.com/cheat/cheat/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func cmdConf(opts map[string]interface{}, conf config.Config) {
|
func cmdConf(_ map[string]interface{}, conf config.Config) {
|
||||||
fmt.Println(conf.Path)
|
fmt.Println(conf.Path)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// cmdDirectories lists the configured cheatpaths.
|
// cmdDirectories lists the configured cheatpaths.
|
||||||
func cmdDirectories(opts map[string]interface{}, conf config.Config) {
|
func cmdDirectories(_ map[string]interface{}, conf config.Config) {
|
||||||
|
|
||||||
// initialize a tabwriter to produce cleanly columnized output
|
// initialize a tabwriter to produce cleanly columnized output
|
||||||
var out bytes.Buffer
|
var out bytes.Buffer
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// cmdTags lists all tags in use.
|
// cmdTags lists all tags in use.
|
||||||
func cmdTags(opts map[string]interface{}, conf config.Config) {
|
func cmdTags(_ map[string]interface{}, conf config.Config) {
|
||||||
|
|
||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Package main serves as the executable entrypoint.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
//go:generate go run ../../build/embed.go
|
//go:generate go run ../../build/embed.go
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Package cheatpath implements functions pertaining to cheatsheet file path
|
||||||
|
// management.
|
||||||
package cheatpath
|
package cheatpath
|
||||||
|
|
||||||
// Cheatpath encapsulates cheatsheet path information
|
// Cheatpath encapsulates cheatsheet path information
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Package config implements functions pertaining to configuration management.
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -24,7 +25,7 @@ type Config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new Config struct
|
// New returns a new Config struct
|
||||||
func New(opts map[string]interface{}, confPath string, resolve bool) (Config, error) {
|
func New(_ map[string]interface{}, confPath string, resolve bool) (Config, error) {
|
||||||
|
|
||||||
// read the config file
|
// read the config file
|
||||||
buf, err := os.ReadFile(confPath)
|
buf, err := os.ReadFile(confPath)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Package display implement functions pertaining to writing formatted
|
||||||
|
// cheatsheet content to stdout, or alternatively the system pager.
|
||||||
package display
|
package display
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -6,7 +8,8 @@ import (
|
||||||
"github.com/cheat/cheat/internal/config"
|
"github.com/cheat/cheat/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Faint returns an faint string
|
// Faint returns a faintly-colored string that's used to de-prioritize text
|
||||||
|
// written to stdout
|
||||||
func Faint(str string, conf config.Config) string {
|
func Faint(str string, conf config.Config) string {
|
||||||
// make `str` faint only if colorization has been requested
|
// make `str` faint only if colorization has been requested
|
||||||
if conf.Colorize {
|
if conf.Colorize {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Package installer implements functions that provide a first-time
|
||||||
|
// installation wizard.
|
||||||
package installer
|
package installer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Package mock implements mock functions used in unit-tests.
|
||||||
package mock
|
package mock
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Package repo implements functions pertaining to the management of git repos.
|
||||||
package repo
|
package repo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Package sheet implements functions pertaining to parsing, searching, and
|
||||||
|
// displaying cheatsheets.
|
||||||
package sheet
|
package sheet
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Package sheets implements functions pertaining to loading, sorting,
|
||||||
|
// filtering, and tagging cheatsheets.
|
||||||
package sheets
|
package sheets
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in New Issue