mirror of
https://github.com/cheat/cheat.git
synced 2024-11-14 08:01:09 +01:00
chore(lint): various changes to appease revive
- Add `package` comments - Rename `opts` to `_` where unused
This commit is contained in:
parent
95a4e31b6c
commit
bfb071c0b2
12 changed files with 20 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package main serves as the executable entrypoint.
|
||||
package main
|
||||
|
||||
//go:generate go run ../../build/embed.go
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package cheatpath implements functions pertaining to cheatsheet file path
|
||||
// management.
|
||||
package cheatpath
|
||||
|
||||
// Cheatpath encapsulates cheatsheet path information
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package installer implements functions that provide a first-time
|
||||
// installation wizard.
|
||||
package installer
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package mock implements mock functions used in unit-tests.
|
||||
package mock
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package repo implements functions pertaining to the management of git repos.
|
||||
package repo
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package sheet implements functions pertaining to parsing, searching, and
|
||||
// displaying cheatsheets.
|
||||
package sheet
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Package sheets implements functions pertaining to loading, sorting,
|
||||
// filtering, and tagging cheatsheets.
|
||||
package sheets
|
||||
|
||||
import (
|
||||
|
|
Loading…
Reference in a new issue