diff options
author | Abhinav Gupta <mail@abhinavg.net> | 2021-12-04 15:16:09 -0800 |
---|---|---|
committer | Abhinav Gupta <mail@abhinavg.net> | 2021-12-04 15:40:53 -0800 |
commit | 0dcebfb72bbdaf01554f938402e699d67937c5a0 (patch) | |
tree | 512b1d1651109b3008ff610cf2abfa8adc1c211b /storage | |
parent | e4fcd078d42e945581616855ab78d8b7ed12df6c (diff) | |
download | go-git-0dcebfb72bbdaf01554f938402e699d67937c5a0.tar.gz |
error strings: Don't capitalize, use periods, or newlines
Per [Go Code Review Comments][1],
> Error strings should not be capitalized (unless beginning with proper
> nouns or acronyms) or end with punctuation
staticcheck's [ST1005][2] also complains about these. For example,
```
object_walker.go:63:10: error strings should not be capitalized (ST1005)
object_walker.go:101:10: error strings should not be capitalized (ST1005)
object_walker.go:101:10: error strings should not end with punctuation or a newline (ST1005)
plumbing/format/commitgraph/file.go:17:26: error strings should not be capitalized (ST1005)
```
This fixes all instances of this issue reported by staticcheck.
[1]: https://github.com/golang/go/wiki/CodeReviewComments#error-strings
[2]: https://staticcheck.io/docs/checks/#ST1005
Diffstat (limited to 'storage')
-rw-r--r-- | storage/filesystem/dotgit/reader.go | 2 | ||||
-rw-r--r-- | storage/memory/storage.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/storage/filesystem/dotgit/reader.go b/storage/filesystem/dotgit/reader.go index a82ac94..975f92a 100644 --- a/storage/filesystem/dotgit/reader.go +++ b/storage/filesystem/dotgit/reader.go @@ -66,7 +66,7 @@ func (e *EncodedObject) Size() int64 { func (e *EncodedObject) SetSize(int64) {} func (e *EncodedObject) Writer() (io.WriteCloser, error) { - return nil, fmt.Errorf("Not supported") + return nil, fmt.Errorf("not supported") } func NewEncodedObject(dir *DotGit, h plumbing.Hash, t plumbing.ObjectType, size int64) *EncodedObject { diff --git a/storage/memory/storage.go b/storage/memory/storage.go index a8e5669..ef6a445 100644 --- a/storage/memory/storage.go +++ b/storage/memory/storage.go @@ -193,7 +193,7 @@ func (o *ObjectStorage) DeleteOldObjectPackAndIndex(plumbing.Hash, time.Time) er return nil } -var errNotSupported = fmt.Errorf("Not supported") +var errNotSupported = fmt.Errorf("not supported") func (o *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error) { return time.Time{}, errNotSupported |