chore(lint): various changes to appease revive

- Add `package` comments
- Rename `opts` to `_` where unused
This commit is contained in:
Christopher Allen Lane 2023-12-13 09:10:20 -05:00
parent 95a4e31b6c
commit bfb071c0b2
12 changed files with 20 additions and 5 deletions

View File

@ -6,6 +6,6 @@ import (
"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)
}

View File

@ -10,7 +10,7 @@ import (
)
// 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
var out bytes.Buffer

View File

@ -10,7 +10,7 @@ import (
)
// 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
cheatsheets, err := sheets.Load(conf.Cheatpaths)

View File

@ -1,3 +1,4 @@
// Package main serves as the executable entrypoint.
package main
//go:generate go run ../../build/embed.go

View File

@ -1,3 +1,5 @@
// Package cheatpath implements functions pertaining to cheatsheet file path
// management.
package cheatpath
// Cheatpath encapsulates cheatsheet path information

View File

@ -1,3 +1,4 @@
// Package config implements functions pertaining to configuration management.
package config
import (
@ -24,7 +25,7 @@ type 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
buf, err := os.ReadFile(confPath)

View File

@ -1,3 +1,5 @@
// Package display implement functions pertaining to writing formatted
// cheatsheet content to stdout, or alternatively the system pager.
package display
import (
@ -6,7 +8,8 @@ import (
"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 {
// make `str` faint only if colorization has been requested
if conf.Colorize {

View File

@ -1,3 +1,5 @@
// Package installer implements functions that provide a first-time
// installation wizard.
package installer
import (

View File

@ -1,3 +1,4 @@
// Package mock implements mock functions used in unit-tests.
package mock
import (

View File

@ -1,3 +1,4 @@
// Package repo implements functions pertaining to the management of git repos.
package repo
import (

View File

@ -1,3 +1,5 @@
// Package sheet implements functions pertaining to parsing, searching, and
// displaying cheatsheets.
package sheet
import (

View File

@ -1,3 +1,5 @@
// Package sheets implements functions pertaining to loading, sorting,
// filtering, and tagging cheatsheets.
package sheets
import (