diff options
author | ferhat elmas <elmas.ferhat@gmail.com> | 2016-11-07 20:32:00 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-11-07 20:32:00 +0100 |
commit | 7b0f65f5f5486f5e32f749826744929813734e24 (patch) | |
tree | da3d4bbf7caf3fe5d712fb3a1df9c42fb549ee2c /config/refspec.go | |
parent | 0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23 (diff) | |
download | go-git-7b0f65f5f5486f5e32f749826744929813734e24.tar.gz |
gofmt simplify (#111)
Diffstat (limited to 'config/refspec.go')
-rw-r--r-- | config/refspec.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/refspec.go b/config/refspec.go index 9b5560d..0f41c5a 100644 --- a/config/refspec.go +++ b/config/refspec.go @@ -35,7 +35,7 @@ func (s RefSpec) IsValid() bool { } ws := strings.Count(spec[0:sep], refSpecWildcard) - wd := strings.Count(spec[sep+1:len(spec)], refSpecWildcard) + wd := strings.Count(spec[sep+1:], refSpecWildcard) return ws == wd && ws < 2 && wd < 2 } @@ -95,7 +95,7 @@ func (s RefSpec) matchGlob(n core.ReferenceName) bool { func (s RefSpec) Dst(n core.ReferenceName) core.ReferenceName { spec := string(s) start := strings.Index(spec, refSpecSeparator) + 1 - dst := spec[start:len(spec)] + dst := spec[start:] src := s.Src() if !s.IsWildcard() { @@ -107,7 +107,7 @@ func (s RefSpec) Dst(n core.ReferenceName) core.ReferenceName { wd := strings.Index(dst, refSpecWildcard) match := name[ws : len(name)-(len(src)-(ws+1))] - return core.ReferenceName(dst[0:wd] + match + dst[wd+1:len(dst)]) + return core.ReferenceName(dst[0:wd] + match + dst[wd+1:]) } func (s RefSpec) String() string { |