chore(go): update dependency

This commit is contained in:
Jan De Dobbeleer 2023-03-20 12:38:31 +01:00 committed by Jan De Dobbeleer
parent 126d4101a1
commit 3b1823682d
12 changed files with 27 additions and 29 deletions

View file

@ -4,11 +4,11 @@ package ansi
import "github.com/jandedobbeleer/oh-my-posh/src/platform"
func GetAccentColor(env platform.Environment) (*RGB, error) {
func GetAccentColor(_ platform.Environment) (*RGB, error) {
return nil, &platform.NotImplemented{}
}
func (d *DefaultColors) SetAccentColor(env platform.Environment, defaultColor string) {
func (d *DefaultColors) SetAccentColor(_ platform.Environment, defaultColor string) {
if len(defaultColor) == 0 {
return
}

View file

@ -11,7 +11,7 @@ import (
)
var (
print bool
printOutput bool
strict bool
manual bool
@ -45,7 +45,7 @@ See the documentation to initialize your shell: https://ohmyposh.dev/docs/instal
)
func init() { //nolint:gochecknoinits
initCmd.Flags().BoolVarP(&print, "print", "p", false, "print the init script")
initCmd.Flags().BoolVarP(&printOutput, "print", "p", false, "print the init script")
initCmd.Flags().BoolVarP(&strict, "strict", "s", false, "run in strict mode")
initCmd.Flags().BoolVarP(&manual, "manual", "m", false, "enable/disable manual mode")
_ = initCmd.MarkPersistentFlagRequired("config")
@ -77,7 +77,7 @@ func runInit(shellName string) {
shell.RPrompt = true
}
}
if print {
if printOutput {
init := shell.PrintInit(env)
fmt.Print(init)
return

View file

@ -89,7 +89,7 @@ func (m *MockedWriter) Template() string {
return m.template
}
func (m *MockedWriter) Init(props properties.Properties, env platform.Environment) {}
func (m *MockedWriter) Init(_ properties.Properties, _ platform.Environment) {}
func TestIconOverride(t *testing.T) {
cases := []struct {

View file

@ -39,7 +39,7 @@ type itemDelegate struct{}
func (d itemDelegate) Height() int { return 1 }
func (d itemDelegate) Spacing() int { return 0 }
func (d itemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd { return nil }
func (d itemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd { return nil }
func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item) { //nolint: gocritic
i, ok := listItem.(*Asset)
if !ok {

View file

@ -27,10 +27,10 @@ var fontExtensions = map[string]bool{
".ttf": true,
}
// new creates a new Font struct.
// newFont creates a newFont Font struct.
// fileName is the font's file name, and data is a byte slice containing the font file data.
// It returns a FontData struct describing the font, or an error.
func new(fileName string, data []byte) (*Font, error) {
func newFont(fileName string, data []byte) (*Font, error) {
if _, ok := fontExtensions[strings.ToLower(path.Ext(fileName))]; !ok {
return nil, fmt.Errorf("not a font: %v", fileName)
}

View file

@ -33,7 +33,7 @@ func InstallZIP(data []byte) (err error) {
return err
}
fontData, err := new(zf.Name, data)
fontData, err := newFont(zf.Name, data)
if err != nil {
continue
}

View file

@ -96,4 +96,4 @@ replace github.com/atotto/clipboard v0.1.4 => github.com/jandedobbeleer/clipboar
replace github.com/shirou/gopsutil/v3 v3.22.10 => github.com/jandedobbeleer/gopsutil/v3 v3.22.10-1
replace github.com/goccy/go-yaml v1.10.0 => github.com/jandedobbeleer/go-yaml v1.10.0-3
replace github.com/goccy/go-yaml v1.10.0 => github.com/jandedobbeleer/go-yaml v1.10.0-4

View file

@ -92,8 +92,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jandedobbeleer/clipboard v0.1.4-1 h1:rJehm5W0a3hvjcxyB3snqLBV4yvMBBc12JyMP7ngNQw=
github.com/jandedobbeleer/clipboard v0.1.4-1/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/jandedobbeleer/go-yaml v1.10.0-3 h1:uJNH470S70mcQTWPPf3oa9/A2XjLqQI4b2e+fkbgoc4=
github.com/jandedobbeleer/go-yaml v1.10.0-3/go.mod h1:h/18Lr6oSQ3mvmqFoWmQ47KChOgpfHpTyIHl3yVmpiY=
github.com/jandedobbeleer/go-yaml v1.10.0-4 h1:syHCr1xD43Odtfd8eJrPVr6YU38+EvE9B6+nry9/o1U=
github.com/jandedobbeleer/go-yaml v1.10.0-4/go.mod h1:BpNLgczNY7xmm+5yoSBm62mqE8SB9eCKcemdBA3Iod4=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@ -239,7 +239,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View file

@ -145,7 +145,7 @@ func (env *MockedEnvironment) WindowsRegistryKeyValue(path string) (*platform.Wi
return args.Get(0).(*platform.WindowsRegistryValue), args.Error(1)
}
func (env *MockedEnvironment) HTTPRequest(url string, body io.Reader, timeout int, requestModifiers ...platform.HTTPRequestModifier) ([]byte, error) {
func (env *MockedEnvironment) HTTPRequest(url string, _ io.Reader, _ int, _ ...platform.HTTPRequestModifier) ([]byte, error) {
args := env.Called(url)
return args.Get(0).([]byte), args.Error(1)
}
@ -199,12 +199,12 @@ func (env *MockedEnvironment) InWSLSharedDrive() bool {
return args.Bool(0)
}
func (env *MockedEnvironment) ConvertToWindowsPath(path string) string {
func (env *MockedEnvironment) ConvertToWindowsPath(_ string) string {
args := env.Called()
return args.String(0)
}
func (env *MockedEnvironment) ConvertToLinuxPath(path string) string {
func (env *MockedEnvironment) ConvertToLinuxPath(_ string) string {
args := env.Called()
return args.String(0)
}

View file

@ -23,7 +23,7 @@ func (env *Shell) Home() string {
return os.Getenv("HOME")
}
func (env *Shell) QueryWindowTitles(processName, windowTitleRegex string) (string, error) {
func (env *Shell) QueryWindowTitles(_, _ string) (string, error) {
return "", &NotImplemented{}
}
@ -97,7 +97,7 @@ func (env *Shell) CachePath() string {
return env.Home()
}
func (env *Shell) WindowsRegistryKeyValue(path string) (*WindowsRegistryValue, error) {
func (env *Shell) WindowsRegistryKeyValue(_ string) (*WindowsRegistryValue, error) {
return nil, &NotImplemented{}
}
@ -124,7 +124,7 @@ func (env *Shell) ConvertToLinuxPath(path string) string {
return path
}
func (env *Shell) LookWinAppPath(file string) (string, error) {
func (env *Shell) LookWinAppPath(_ string) (string, error) {
return "", errors.New("not relevant")
}
@ -133,7 +133,7 @@ func (env *Shell) DirIsWritable(path string) bool {
return unix.Access(path, unix.W_OK) == nil
}
func (env *Shell) Connection(connectionType ConnectionType) (*Connection, error) {
func (env *Shell) Connection(_ ConnectionType) (*Connection, error) {
// added to disable the linting error, we can implement this later
if len(env.networks) == 0 {
return nil, &NotImplemented{}

View file

@ -175,7 +175,7 @@ func (n *Project) getPoetryPackage(item ProjectItem) *ProjectData {
}
}
func (n *Project) getNuSpecPackage(item ProjectItem) *ProjectData {
func (n *Project) getNuSpecPackage(_ ProjectItem) *ProjectData {
files := n.env.LsDir(n.env.Pwd())
var content string
// get the first match only
@ -199,7 +199,7 @@ func (n *Project) getNuSpecPackage(item ProjectItem) *ProjectData {
}
}
func (n *Project) getDotnetProject(item ProjectItem) *ProjectData {
func (n *Project) getDotnetProject(_ ProjectItem) *ProjectData {
files := n.env.LsDir(n.env.Pwd())
var name string
var content string

View file

@ -170,9 +170,8 @@ func TestRenderTemplate(t *testing.T) {
if tc.ShouldError {
assert.Error(t, err)
continue
} else {
assert.NoError(t, err)
}
assert.NoError(t, err)
assert.Equal(t, tc.Expected, text, tc.Case)
}
}