aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorOleg Kovalov <iamolegkovalov@gmail.com>2020-07-06 17:40:53 +0200
committerOleg Kovalov <iamolegkovalov@gmail.com>2020-07-06 17:40:53 +0200
commita99446e290f038900b893e21362c6ff766c30f5e (patch)
tree8c9eca0445a0bf31ef57840c3950f923d5dc27b8 /plumbing
parenta9899594dfdde8bbfdf35fc7e8c2fc3ec5aa7fdb (diff)
downloadgo-git-a99446e290f038900b893e21362c6ff766c30f5e.tar.gz
Minor linter fixes
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/filemode/filemode.go2
-rw-r--r--plumbing/format/index/decoder.go2
-rw-r--r--plumbing/object/change.go2
-rw-r--r--plumbing/protocol/packp/capability/list.go5
4 files changed, 4 insertions, 7 deletions
diff --git a/plumbing/filemode/filemode.go b/plumbing/filemode/filemode.go
index 594984f..b848a97 100644
--- a/plumbing/filemode/filemode.go
+++ b/plumbing/filemode/filemode.go
@@ -118,7 +118,7 @@ func isSetSymLink(m os.FileMode) bool {
func (m FileMode) Bytes() []byte {
ret := make([]byte, 4)
binary.LittleEndian.PutUint32(ret, uint32(m))
- return ret[:]
+ return ret
}
// IsMalformed returns if the FileMode should not appear in a git packfile,
diff --git a/plumbing/format/index/decoder.go b/plumbing/format/index/decoder.go
index d341d59..036b636 100644
--- a/plumbing/format/index/decoder.go
+++ b/plumbing/format/index/decoder.go
@@ -188,7 +188,7 @@ func (d *Decoder) doReadEntryNameV4() (string, error) {
func (d *Decoder) doReadEntryName(len uint16) (string, error) {
name := make([]byte, len)
- _, err := io.ReadFull(d.r, name[:])
+ _, err := io.ReadFull(d.r, name)
return string(name), err
}
diff --git a/plumbing/object/change.go b/plumbing/object/change.go
index c9d1615..8b119bc 100644
--- a/plumbing/object/change.go
+++ b/plumbing/object/change.go
@@ -75,7 +75,7 @@ func (c *Change) Files() (from, to *File, err error) {
func (c *Change) String() string {
action, err := c.Action()
if err != nil {
- return fmt.Sprintf("malformed change")
+ return "malformed change"
}
return fmt.Sprintf("<Action: %s, Path: %s>", action, c.name())
diff --git a/plumbing/protocol/packp/capability/list.go b/plumbing/protocol/packp/capability/list.go
index 9609211..f41ec79 100644
--- a/plumbing/protocol/packp/capability/list.go
+++ b/plumbing/protocol/packp/capability/list.go
@@ -86,10 +86,7 @@ func (l *List) Get(capability Capability) []string {
// Set sets a capability removing the previous values
func (l *List) Set(capability Capability, values ...string) error {
- if _, ok := l.m[capability]; ok {
- delete(l.m, capability)
- }
-
+ delete(l.m, capability)
return l.Add(capability, values...)
}