1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

update linters

This commit is contained in:
Jesse Duffield
2022-03-19 09:38:49 +11:00
parent d93fef4c61
commit a34bdf1a04
69 changed files with 1510 additions and 204 deletions

View File

@ -20,6 +20,7 @@ func (b *Buffer) Read(p []byte) (n int, err error) {
defer b.m.Unlock()
return b.b.Read(p)
}
func (b *Buffer) Write(p []byte) (n int, err error) {
b.m.Lock()
defer b.m.Unlock()

View File

@ -21,7 +21,7 @@ type FakeCmdObjRunner struct {
var _ ICmdObjRunner = &FakeCmdObjRunner{}
func NewFakeRunner(t *testing.T) *FakeCmdObjRunner {
func NewFakeRunner(t *testing.T) *FakeCmdObjRunner { //nolint:thelper
return &FakeCmdObjRunner{t: t}
}

View File

@ -103,7 +103,7 @@ func (c *OSCommand) Quote(message string) string {
// AppendLineToFile adds a new line in file
func (c *OSCommand) AppendLineToFile(filename, line string) error {
c.LogCommand(fmt.Sprintf("Appending '%s' to file '%s'", line, filename), false)
f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0o600)
if err != nil {
return utils.WrapError(err)
}
@ -145,7 +145,7 @@ func (c *OSCommand) CreateFileWithContent(path string, content string) error {
return err
}
if err := ioutil.WriteFile(path, []byte(content), 0644); err != nil {
if err := ioutil.WriteFile(path, []byte(content), 0o644); err != nil {
c.Log.Error(err)
return utils.WrapError(err)
}

View File

@ -141,7 +141,7 @@ func TestOSCommandFileType(t *testing.T) {
{
"testDirectory",
func() {
if err := os.Mkdir("testDirectory", 0644); err != nil {
if err := os.Mkdir("testDirectory", 0o644); err != nil {
panic(err)
}
},